Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
atlas
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dataplatform
atlas
Commits
42426a1b
Commit
42426a1b
authored
Apr 11, 2017
by
kalyani
Committed by
Madhan Neethiraj
Apr 12, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-1719: updated tag association UI to support enum-type attribute values from a drop-down
Signed-off-by:
Madhan Neethiraj
<
madhan@apache.org
>
parent
7f03fc8e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
16 deletions
+47
-16
addTagModalView_tmpl.html
...boardv2/public/js/templates/tag/addTagModalView_tmpl.html
+1
-1
addTagModalView.js
dashboardv2/public/js/views/tag/addTagModalView.js
+46
-15
No files found.
dashboardv2/public/js/templates/tag/addTagModalView_tmpl.html
View file @
42426a1b
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
* limitations under the License.
* limitations under the License.
-->
-->
<div>
<div>
<div
class=
"form-group"
>
<div
class=
"form-group
hide
"
>
<select
class=
"form-control row-margin-bottom"
data-id=
"addTagOptions"
required
>
<select
class=
"form-control row-margin-bottom"
data-id=
"addTagOptions"
required
>
</select>
</select>
</div>
</div>
...
...
dashboardv2/public/js/views/tag/addTagModalView.js
View file @
42426a1b
...
@@ -51,7 +51,11 @@ define(['require',
...
@@ -51,7 +51,11 @@ define(['require',
_
.
extend
(
this
,
_
.
pick
(
options
,
'modalCollection'
,
'guid'
,
'callback'
,
'multiple'
,
'showLoader'
,
'hideLoader'
,
'tagList'
));
_
.
extend
(
this
,
_
.
pick
(
options
,
'modalCollection'
,
'guid'
,
'callback'
,
'multiple'
,
'showLoader'
,
'hideLoader'
,
'tagList'
));
this
.
collection
=
new
VTagList
();
this
.
collection
=
new
VTagList
();
this
.
commonCollection
=
new
VTagList
();
this
.
commonCollection
=
new
VTagList
();
this
.
enumCollection
=
new
VTagList
();
this
.
enumCollection
.
url
=
UrlLinks
.
typedefsUrl
().
defs
;
this
.
enumCollection
.
modelAttrName
=
"enumDefs"
;
this
.
asyncAttrFetchCounter
=
0
;
this
.
asyncAttrFetchCounter
=
0
;
this
.
asyncEnumFetchCounter
=
2
;
this
.
modal
=
new
Modal
({
this
.
modal
=
new
Modal
({
title
:
'Add Tag'
,
title
:
'Add Tag'
,
content
:
this
,
content
:
this
,
...
@@ -86,7 +90,6 @@ define(['require',
...
@@ -86,7 +90,6 @@ define(['require',
}
else
{
}
else
{
obj
.
skipEntity
.
push
(
name
);
obj
.
skipEntity
.
push
(
name
);
}
}
}
}
});
});
if
(
obj
.
deletedEntity
.
length
)
{
if
(
obj
.
deletedEntity
.
length
)
{
...
@@ -168,21 +171,33 @@ define(['require',
...
@@ -168,21 +171,33 @@ define(['require',
},
},
onRender
:
function
()
{
onRender
:
function
()
{
var
that
=
this
;
$
.
extend
(
this
.
collection
.
queryParams
,
{
type
:
'TRAIT'
,
notsupertype
:
'TaxonomyTerm'
});
$
.
extend
(
this
.
collection
.
queryParams
,
{
type
:
'TRAIT'
,
notsupertype
:
'TaxonomyTerm'
});
this
.
collection
.
fetch
({
reset
:
true
});
this
.
hideAttributeBox
();
this
.
collection
.
fetch
({
reset
:
true
,
complete
:
function
()
{
--
that
.
asyncEnumFetchCounter
;
that
.
showAttributeBox
(
that
.
asyncEnumFetchCounter
);
},
});
that
.
enumCollection
.
fetch
({
complete
:
function
()
{
--
that
.
asyncEnumFetchCounter
;
that
.
showAttributeBox
(
that
.
asyncEnumFetchCounter
);
},
reset
:
true
});
},
},
bindEvents
:
function
()
{
bindEvents
:
function
()
{
var
that
=
this
;
this
.
enumArr
=
[];
this
.
listenTo
(
this
.
collection
,
'reset'
,
function
()
{
this
.
listenTo
(
this
.
collection
,
'reset'
,
function
()
{
this
.
tagsCollection
();
this
.
tagsCollection
();
},
this
);
},
this
);
this
.
listenTo
(
this
.
commonCollection
,
'reset'
,
function
()
{
this
.
listenTo
(
this
.
commonCollection
,
'reset'
,
function
()
{
--
this
.
asyncAttrFetchCounter
this
.
subAttributeData
();
this
.
subAttributeData
();
},
this
);
},
this
);
this
.
listenTo
(
this
.
commonCollection
,
'error'
,
function
()
{
--
this
.
asyncAttrFetchCounter
this
.
$
(
'.attrLoader'
).
hide
();
},
this
);
},
},
tagsCollection
:
function
()
{
tagsCollection
:
function
()
{
var
that
=
this
;
var
that
=
this
;
...
@@ -216,13 +231,21 @@ define(['require',
...
@@ -216,13 +231,21 @@ define(['require',
this
.
fetchTagSubData
(
tagname
);
this
.
fetchTagSubData
(
tagname
);
},
},
fetchTagSubData
:
function
(
tagname
)
{
fetchTagSubData
:
function
(
tagname
)
{
var
that
=
this
;
++
this
.
asyncAttrFetchCounter
;
this
.
commonCollection
.
url
=
UrlLinks
.
typesClassicationApiUrl
(
tagname
);
this
.
commonCollection
.
url
=
UrlLinks
.
typesClassicationApiUrl
(
tagname
);
++
this
.
asyncAttrFetchCounter
this
.
commonCollection
.
fetch
({
this
.
commonCollection
.
fetch
({
reset
:
true
});
reset
:
true
,
complete
:
function
()
{
--
that
.
asyncAttrFetchCounter
;
that
.
showAttributeBox
();
}
});
},
},
showAttributeBox
:
function
()
{
showAttributeBox
:
function
(
counter
)
{
if
(
this
.
asyncAttrFetchCounter
===
0
)
{
if
(
(
counter
||
this
.
asyncAttrFetchCounter
)
===
0
)
{
this
.
$
(
'.attrLoader'
).
hide
();
this
.
$
(
'.attrLoader'
).
hide
();
this
.
$
(
'.form-group.hide'
).
removeClass
(
'hide'
);
if
(
this
.
ui
.
tagAttribute
.
children
().
length
!==
0
)
{
if
(
this
.
ui
.
tagAttribute
.
children
().
length
!==
0
)
{
this
.
ui
.
tagAttribute
.
parent
().
show
();
this
.
ui
.
tagAttribute
.
parent
().
show
();
}
}
...
@@ -239,11 +262,22 @@ define(['require',
...
@@ -239,11 +262,22 @@ define(['require',
if
(
this
.
commonCollection
.
models
[
0
].
get
(
'attributeDefs'
))
{
if
(
this
.
commonCollection
.
models
[
0
].
get
(
'attributeDefs'
))
{
_
.
each
(
this
.
commonCollection
.
models
[
0
].
get
(
'attributeDefs'
),
function
(
obj
)
{
_
.
each
(
this
.
commonCollection
.
models
[
0
].
get
(
'attributeDefs'
),
function
(
obj
)
{
var
name
=
Utils
.
getName
(
obj
,
'name'
);
var
name
=
Utils
.
getName
(
obj
,
'name'
);
var
typeName
=
Utils
.
getName
(
obj
,
'typeName'
);
var
typeNameValue
=
that
.
enumCollection
.
fullCollection
.
findWhere
({
'name'
:
typeName
});
if
(
typeNameValue
)
{
var
str
=
"<option disabled='disabled' selected>-- Select "
+
typeName
+
" --</option>"
;
var
enumValue
=
typeNameValue
.
get
(
'elementDefs'
);
_
.
each
(
enumValue
,
function
(
key
,
value
)
{
str
+=
'<option>'
+
key
.
value
+
'</option>'
;
})
that
.
ui
.
tagAttribute
.
append
(
'<div class="form-group"><label>'
+
name
+
'</label>'
+
'<select class="form-control attributeInputVal attrName" data-key="'
+
name
+
'">'
+
str
+
'</select></div>'
);
}
else
{
that
.
ui
.
tagAttribute
.
append
(
'<div class="form-group"><label>'
+
name
+
'</label>'
+
that
.
ui
.
tagAttribute
.
append
(
'<div class="form-group"><label>'
+
name
+
'</label>'
+
'<input type="text" class="form-control attributeInputVal attrName" data-key="'
+
name
+
'" ></input></div>'
);
'<input type="text" class="form-control attributeInputVal attrName" data-key="'
+
name
+
'" ></input></div>'
);
}
});
});
}
}
if
(
this
.
commonCollection
.
models
[
0
].
get
(
'superTypes'
))
{
if
(
this
.
commonCollection
.
models
[
0
].
get
(
'superTypes'
))
{
var
superTypes
=
this
.
commonCollection
.
models
[
0
].
get
(
'superTypes'
);
var
superTypes
=
this
.
commonCollection
.
models
[
0
].
get
(
'superTypes'
);
if
(
!
_
.
isArray
(
superTypes
))
{
if
(
!
_
.
isArray
(
superTypes
))
{
...
@@ -256,7 +290,6 @@ define(['require',
...
@@ -256,7 +290,6 @@ define(['require',
}
else
{
}
else
{
this
.
showAttributeBox
();
this
.
showAttributeBox
();
}
}
}
else
{
}
else
{
this
.
showAttributeBox
();
this
.
showAttributeBox
();
}
}
...
@@ -292,7 +325,6 @@ define(['require',
...
@@ -292,7 +325,6 @@ define(['require',
if
(
that
.
callback
)
{
if
(
that
.
callback
)
{
that
.
callback
();
that
.
callback
();
}
}
},
},
cust_error
:
function
(
model
,
response
)
{
cust_error
:
function
(
model
,
response
)
{
var
message
=
"Tag "
+
tagName
+
" could not be added"
;
var
message
=
"Tag "
+
tagName
+
" could not be added"
;
...
@@ -305,7 +337,6 @@ define(['require',
...
@@ -305,7 +337,6 @@ define(['require',
if
(
that
.
hideLoader
)
{
if
(
that
.
hideLoader
)
{
that
.
hideLoader
();
that
.
hideLoader
();
}
}
}
}
});
});
},
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment