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
7f03fc8e
Commit
7f03fc8e
authored
Apr 12, 2017
by
kalyani
Committed by
Madhan Neethiraj
Apr 12, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-1718: UI update to support enum-type attributes for tags
Signed-off-by:
Madhan Neethiraj
<
madhan@apache.org
>
parent
ceea868d
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
50 additions
and
8 deletions
+50
-8
AddTagAttributeView_tmpl.html
...dv2/public/js/templates/tag/AddTagAttributeView_tmpl.html
+4
-1
createTagLayoutView_tmpl.html
...dv2/public/js/templates/tag/createTagLayoutView_tmpl.html
+4
-1
AddTagAttributeView.js
dashboardv2/public/js/views/tag/AddTagAttributeView.js
+17
-2
CreateTagLayoutView.js
dashboardv2/public/js/views/tag/CreateTagLayoutView.js
+19
-1
TagAttributeItemView.js
dashboardv2/public/js/views/tag/TagAttributeItemView.js
+6
-3
No files found.
dashboardv2/public/js/templates/tag/AddTagAttributeView_tmpl.html
View file @
7f03fc8e
...
...
@@ -14,7 +14,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
-->
<div
class=
"row row-margin-bottom"
>
<div
class=
"fontLoader"
style=
"margin-top:-10px"
>
<i
class=
"fa fa-refresh fa-spin-custom"
></i>
</div>
<div
class=
"row row-margin-bottom hide"
>
<div
class=
"col-sm-12"
>
<div
class=
"clearfix"
>
<button
type=
"button"
class=
"btn btn-success btn-sm pull-right"
data-id=
"attributeData"
><i
class=
"fa fa-plus"
></i>
Add New Attribute
</button>
...
...
dashboardv2/public/js/templates/tag/createTagLayoutView_tmpl.html
View file @
7f03fc8e
...
...
@@ -14,7 +14,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
-->
<form
name=
"tagDefinitionform"
class=
"css-form"
data-id=
"createTagForm"
>
<div
class=
"fontLoader"
style=
"margin-top:-10px"
>
<i
class=
"fa fa-refresh fa-spin-custom"
></i>
</div>
<form
name=
"tagDefinitionform"
class=
"css-form hide"
data-id=
"createTagForm"
>
<div
class=
"form-group"
>
{{#if create}}
<input
class=
"form-control row-margin-bottom"
data-id=
"tagName"
placeholder=
"Name(required)"
autofocus
>
...
...
dashboardv2/public/js/views/tag/AddTagAttributeView.js
View file @
7f03fc8e
...
...
@@ -20,8 +20,10 @@ define(['require',
'backbone'
,
'hbs!tmpl/tag/AddTagAttributeView_tmpl'
,
'views/tag/TagAttributeItemView'
,
'utils/UrlLinks'
,
'collection/VTagList'
],
function
(
require
,
Backbone
,
AddTagAttributeView_tmpl
,
TagAttributeItemView
)
{
],
function
(
require
,
Backbone
,
AddTagAttributeView_tmpl
,
TagAttributeItemView
,
UrlLinks
,
VTagList
)
{
'use strict'
;
return
Backbone
.
Marionette
.
CompositeView
.
extend
(
...
...
@@ -61,13 +63,25 @@ define(['require',
initialize
:
function
(
options
)
{
// this.parentView = options.parentView;
this
.
collection
=
new
Backbone
.
Collection
();
this
.
collectionAttribute
();
this
.
typeEnum
=
new
VTagList
();
this
.
typeEnum
.
url
=
UrlLinks
.
typedefsUrl
().
defs
;
this
.
typeEnum
.
modelAttrName
=
"enumDefs"
;
},
onRender
:
function
()
{
var
that
=
this
;
this
.
$
(
'.fontLoader'
).
show
();
this
.
ui
.
addAttributeDiv
.
find
(
'.closeInput'
).
hide
();
if
(
!
(
'placeholder'
in
HTMLInputElement
.
prototype
))
{
this
.
ui
.
addAttributeDiv
.
find
(
'input,textarea'
).
placeholder
();
}
that
.
typeEnum
.
fetch
({
reset
:
true
,
complete
:
function
(
model
,
response
)
{
that
.
collectionAttribute
();
that
.
$
(
'.fontLoader'
).
hide
();
that
.
$
(
'.hide'
).
removeClass
(
'hide'
);
}
});
},
bindEvents
:
function
()
{},
collectionAttribute
:
function
()
{
...
...
@@ -81,6 +95,7 @@ define(['require',
"isUnique"
:
false
,
"isIndexable"
:
false
}));
},
onClickAddAttriBtn
:
function
()
{
if
(
this
.
ui
.
addAttributeDiv
.
find
(
"input"
).
length
>
0
)
{
...
...
dashboardv2/public/js/views/tag/CreateTagLayoutView.js
View file @
7f03fc8e
...
...
@@ -21,8 +21,10 @@ define(['require',
'hbs!tmpl/tag/createTagLayoutView_tmpl'
,
'utils/Utils'
,
'views/tag/TagAttributeItemView'
,
'collection/VTagList'
,
'utils/UrlLinks'
,
'platform'
],
function
(
require
,
Backbone
,
CreateTagLayoutViewTmpl
,
Utils
,
TagAttributeItemView
,
platform
)
{
],
function
(
require
,
Backbone
,
CreateTagLayoutViewTmpl
,
Utils
,
TagAttributeItemView
,
VTagList
,
UrlLinks
,
platform
)
{
var
CreateTagLayoutView
=
Backbone
.
Marionette
.
CompositeView
.
extend
(
/** @lends CreateTagLayoutView */
...
...
@@ -81,9 +83,14 @@ define(['require',
this
.
create
=
true
;
}
this
.
collection
=
new
Backbone
.
Collection
();
this
.
typeEnum
=
new
VTagList
();
this
.
typeEnum
.
url
=
UrlLinks
.
typedefsUrl
().
defs
;
this
.
typeEnum
.
modelAttrName
=
"enumDefs"
;
},
bindEvents
:
function
()
{},
onRender
:
function
()
{
var
that
=
this
;
this
.
$
(
'.fontLoader'
).
show
();
if
(
this
.
create
)
{
this
.
tagCollectionList
();
}
else
{
...
...
@@ -92,6 +99,12 @@ define(['require',
if
(
!
(
'placeholder'
in
HTMLInputElement
.
prototype
))
{
this
.
ui
.
createTagForm
.
find
(
'input,textarea'
).
placeholder
();
}
that
.
typeEnum
.
fetch
({
reset
:
true
,
complete
:
function
(
model
,
response
)
{
that
.
hideLoader
();
}
});
},
tagCollectionList
:
function
()
{
var
str
=
''
,
...
...
@@ -114,6 +127,10 @@ define(['require',
});
}
},
hideLoader
:
function
()
{
this
.
$
(
'.fontLoader'
).
hide
();
this
.
$
(
'.hide'
).
removeClass
(
'hide'
);
},
collectionAttribute
:
function
()
{
this
.
collection
.
add
(
new
Backbone
.
Model
({
"name"
:
""
,
...
...
@@ -131,6 +148,7 @@ define(['require',
if
(
!
(
'placeholder'
in
HTMLInputElement
.
prototype
))
{
this
.
ui
.
addAttributeDiv
.
find
(
'input,textarea'
).
placeholder
();
}
}
});
return
CreateTagLayoutView
;
...
...
dashboardv2/public/js/views/tag/TagAttributeItemView.js
View file @
7f03fc8e
...
...
@@ -35,7 +35,7 @@ define(['require',
ui
:
{
attributeInput
:
"[data-id='attributeInput']"
,
close
:
"[data-id='close']"
,
dataTypeSelector
:
"[data-id='dataTypeSelector']"
,
dataTypeSelector
:
"[data-id='dataTypeSelector']"
},
/** ui events hash */
events
:
function
()
{
...
...
@@ -56,11 +56,14 @@ define(['require',
*/
initialize
:
function
(
options
)
{
this
.
parentView
=
options
.
parentView
;
},
onRender
:
function
()
{
var
that
=
this
;
_
.
each
(
this
.
parentView
.
typeEnum
.
models
,
function
(
objValue
)
{
that
.
ui
.
dataTypeSelector
.
append
(
"<option>"
+
objValue
.
attributes
.
name
+
"</option>"
);
});
},
bindEvents
:
function
()
{},
onCloseButton
:
function
()
{
if
(
this
.
parentView
.
collection
.
models
.
length
>
0
)
{
this
.
model
.
destroy
();
...
...
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