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
c9a91264
Commit
c9a91264
authored
Apr 11, 2017
by
kalyani
Committed by
kevalbhatt
Apr 11, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-1433 : Atlas allows creation of tag with attributes' name same as that of its parent tags.
parent
97209e81
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
147 additions
and
17 deletions
+147
-17
graph.scss
dashboardv2/public/css/scss/graph.scss
+8
-0
tag.scss
dashboardv2/public/css/scss/tag.scss
+12
-0
VTag.js
dashboardv2/public/js/models/VTag.js
+1
-1
TagAttributeDetailLayoutView_tmpl.html
...c/js/templates/tag/TagAttributeDetailLayoutView_tmpl.html
+5
-0
TagAttributeDetailLayoutView.js
...ardv2/public/js/views/tag/TagAttributeDetailLayoutView.js
+69
-16
TagLayoutView.js
dashboardv2/public/js/views/tag/TagLayoutView.js
+52
-0
No files found.
dashboardv2/public/css/scss/graph.scss
View file @
c9a91264
...
...
@@ -118,3 +118,11 @@ g.type-TK > rect {
top
:
4px
;
right
:
5px
;
}
.legends
{
>
i
{
>
span
{
font-family
:
'Source Sans Pro'
;
}
}
}
dashboardv2/public/css/scss/tag.scss
View file @
c9a91264
...
...
@@ -64,6 +64,7 @@
text-overflow
:
ellipsis
;
max-width
:
91%
;
overflow
:
hidden
;
font-size
:
14px
;
}
}
ul
{
...
...
@@ -252,6 +253,10 @@
}
}
.superType
{
margin-bottom
:
15px
;
}
form-control
.tagInpput
{
margin-bottom
:
15px
;
margin-top
:
15px
;
...
...
@@ -288,6 +293,13 @@ form-control .tagInpput {
margin-right
:
5px
;
}
.superTypeLabel
{
font-weight
:
600
;
width
:
90px
;
margin-right
:
5px
;
float
:
left
;
}
.inputAssignTag
{
display
:
block
;
padding
:
2px
5px
;
...
...
dashboardv2/public/js/models/VTag.js
View file @
c9a91264
...
...
@@ -48,7 +48,7 @@ define(['require',
},
options
);
return
this
.
constructor
.
nonCrudOperation
.
call
(
this
,
url
,
'DELETE'
,
options
);
},
saveTagAttribute
:
function
(
guid
,
options
)
{
saveTagAttribute
:
function
(
options
)
{
var
url
=
UrlLinks
.
typesClassicationApiUrl
();
options
=
_
.
extend
({
contentType
:
'application/json'
,
...
...
dashboardv2/public/js/templates/tag/TagAttributeDetailLayoutView_tmpl.html
View file @
c9a91264
...
...
@@ -22,6 +22,11 @@
<h1><span
data-id=
"title"
></span></h1>
<button
type=
"button"
data-id=
"editButton"
class=
"btn btn-default pull-right editbutton"
id=
"editText"
><i
class=
"fa fa-pencil"
></i></button>
<p
class=
"sub-title"
data-id=
"description"
></p>
<div
class=
"superType"
style=
"display:none"
>
<span
class=
"superTypeLabel"
>
Derived From:
</span>
<div
data-id=
"showSuperType"
style=
"display: inline-block;"
>
</div>
</div>
<div
class=
"attributes"
>
<span
class=
"attrLabel"
>
Attributes:
</span>
<div
data-id=
"showAttribute"
>
...
...
dashboardv2/public/js/views/tag/TagAttributeDetailLayoutView.js
View file @
c9a91264
...
...
@@ -45,7 +45,8 @@ define(['require',
addTagPlus
:
'[data-id="addTagPlus"]'
,
addTagBtn
:
'[data-id="addTagBtn"]'
,
description
:
'[data-id="description"]'
,
publishButton
:
'[data-id="publishButton"]'
publishButton
:
'[data-id="publishButton"]'
,
showSuperType
:
"[data-id='showSuperType']"
},
/** ui events hash */
events
:
function
()
{
...
...
@@ -100,8 +101,9 @@ define(['require',
},
renderTagDetail
:
function
()
{
var
attributeData
=
""
,
attributeDefs
=
this
.
model
.
get
(
"attributeDefs"
);
supertypeData
=
""
,
attributeDefs
=
this
.
model
.
get
(
"attributeDefs"
),
superTypeArr
=
this
.
model
.
get
(
'superTypes'
);
this
.
ui
.
title
.
html
(
'<span>'
+
(
Utils
.
getName
(
this
.
model
.
toJSON
()))
+
'</span>'
);
if
(
this
.
model
.
get
(
"description"
))
{
this
.
ui
.
description
.
text
(
this
.
model
.
get
(
"description"
));
...
...
@@ -115,6 +117,13 @@ define(['require',
});
this
.
ui
.
showAttribute
.
html
(
attributeData
);
}
if
(
superTypeArr
.
length
>
0
)
{
this
.
$
(
".superType"
).
show
();
_
.
each
(
superTypeArr
,
function
(
value
,
key
)
{
supertypeData
+=
' <a class="inputAttribute" href="#!/tag/tagAttribute/'
+
value
+
'">'
+
value
+
'</a>'
;
});
this
.
ui
.
showSuperType
.
html
(
supertypeData
);
}
Utils
.
hideTitleLoader
(
this
.
$
(
'.fontLoader'
),
this
.
$
(
'.tagDetail'
));
},
onSaveButton
:
function
(
saveObject
,
message
)
{
...
...
@@ -138,7 +147,7 @@ define(['require',
return
;
}
Utils
.
showTitleLoader
(
this
.
$
(
'.page-title .fontLoader'
),
this
.
$
(
'.tagDetail'
));
this
.
model
.
saveTagAttribute
(
this
.
model
.
get
(
'guid'
),
{
this
.
model
.
saveTagAttribute
({
data
:
JSON
.
stringify
({
classificationDefs
:
[
saveObject
],
entityDefs
:
[],
...
...
@@ -154,6 +163,9 @@ define(['require',
Utils
.
notifySuccess
({
content
:
message
});
},
cust_error
:
function
()
{
Utils
.
hideTitleLoader
(
that
.
$
(
'.fontLoader'
),
that
.
$
(
'.tagDetail'
));
}
});
that
.
modal
.
close
();
...
...
@@ -182,20 +194,61 @@ define(['require',
}
});
that
.
modal
.
on
(
'ok'
,
function
()
{
var
newAttributeList
=
view
.
collection
.
toJSON
();
try
{
var
saveJSON
=
JSON
.
parse
(
JSON
.
stringify
(
that
.
model
.
toJSON
()));
}
catch
(
err
)
{
Utils
.
serverErrorHandler
();
}
if
(
saveJSON
)
{
var
oldAttributeList
=
saveJSON
.
attributeDefs
;
}
var
newAttributeList
=
view
.
collection
.
toJSON
(),
activeTagAttribute
=
_
.
extend
([],
that
.
model
.
get
(
'attributeDefs'
)),
superTypes
=
that
.
model
.
get
(
'superTypes'
);
_
.
each
(
superTypes
,
function
(
name
)
{
var
parentTags
=
that
.
collection
.
fullCollection
.
findWhere
({
name
:
name
});
activeTagAttribute
=
activeTagAttribute
.
concat
(
parentTags
.
get
(
'attributeDefs'
));
});
var
duplicateAttributeList
=
[],
saveObj
=
$
.
extend
(
true
,
{},
that
.
model
.
toJSON
());
_
.
each
(
newAttributeList
,
function
(
obj
)
{
oldAttributeList
.
push
(
obj
);
var
duplicateCheck
=
_
.
find
(
activeTagAttribute
,
function
(
activeTagObj
)
{
return
activeTagObj
.
name
.
toLowerCase
()
===
obj
.
name
.
toLowerCase
();
});
if
(
duplicateCheck
)
{
duplicateAttributeList
.
push
(
obj
.
name
);
}
else
{
saveObj
.
attributeDefs
.
push
(
obj
);
}
});
if
(
saveJSON
)
{
that
.
onSaveButton
(
saveJSON
,
Messages
.
addAttributeSuccessMessage
);
var
notifyObj
=
{
confirm
:
{
confirm
:
true
,
buttons
:
[{
text
:
'Ok'
,
addClass
:
'btn-primary'
,
click
:
function
(
notice
)
{
notice
.
remove
();
}
},
null
]
}
}
if
(
saveObj
&&
!
duplicateAttributeList
.
length
)
{
that
.
onSaveButton
(
saveObj
,
Messages
.
addAttributeSuccessMessage
);
}
else
{
if
(
duplicateAttributeList
.
length
<
2
)
{
var
text
=
"Attribute <b>"
+
duplicateAttributeList
.
join
(
","
)
+
"</b> is duplicate !"
}
else
{
if
(
newAttributeList
.
length
>
duplicateAttributeList
.
length
)
{
var
text
=
"Attributes: <b>"
+
duplicateAttributeList
.
join
(
","
)
+
"</b> are duplicate ! Do you want to continue with other attributes ?"
notifyObj
=
{
ok
:
function
(
argument
)
{
that
.
onSaveButton
(
saveObj
,
Messages
.
addAttributeSuccessMessage
);
},
cancel
:
function
(
argument
)
{}
}
}
else
{
var
text
=
"All attributes are duplicate !"
}
}
notifyObj
[
'text'
]
=
text
;
Utils
.
notifyConfirm
(
notifyObj
);
}
});
that
.
modal
.
on
(
'closeModal'
,
function
()
{
...
...
dashboardv2/public/js/views/tag/TagLayoutView.js
View file @
c9a91264
...
...
@@ -228,6 +228,7 @@ define(['require',
});
return
;
}
this
.
name
=
ref
.
ui
.
tagName
.
val
();
this
.
description
=
ref
.
ui
.
description
.
val
();
var
superTypes
=
[];
...
...
@@ -238,6 +239,57 @@ define(['require',
if
(
ref
.
collection
.
length
===
1
&&
ref
.
collection
.
first
().
get
(
"name"
)
===
""
)
{
attributeObj
=
[];
}
if
(
attributeObj
.
length
)
{
var
superTypesAttributes
=
[];
_
.
each
(
superTypes
,
function
(
name
)
{
var
parentTags
=
that
.
collection
.
fullCollection
.
findWhere
({
name
:
name
});
superTypesAttributes
=
superTypesAttributes
.
concat
(
parentTags
.
get
(
'attributeDefs'
));
});
var
duplicateAttributeList
=
[];
_
.
each
(
attributeObj
,
function
(
obj
)
{
var
duplicateCheck
=
_
.
find
(
superTypesAttributes
,
function
(
activeTagObj
)
{
return
activeTagObj
.
name
.
toLowerCase
()
===
obj
.
name
.
toLowerCase
();
});
if
(
duplicateCheck
)
{
duplicateAttributeList
.
push
(
obj
.
name
);
}
});
var
notifyObj
=
{
confirm
:
{
confirm
:
true
,
buttons
:
[{
text
:
'Ok'
,
addClass
:
'btn-primary'
,
click
:
function
(
notice
)
{
notice
.
remove
();
}
},
null
]
}
}
if
(
duplicateAttributeList
.
length
)
{
if
(
duplicateAttributeList
.
length
<
2
)
{
var
text
=
"Attribute <b>"
+
duplicateAttributeList
.
join
(
","
)
+
"</b> is duplicate !"
}
else
{
if
(
attributeObj
.
length
>
duplicateAttributeList
.
length
)
{
var
text
=
"Attributes: <b>"
+
duplicateAttributeList
.
join
(
","
)
+
"</b> are duplicate !"
}
else
{
var
text
=
"All attributes are duplicate !"
}
}
notifyObj
[
'text'
]
=
text
;
Utils
.
notifyConfirm
(
notifyObj
);
return
false
;
}
}
this
.
json
=
{
classificationDefs
:
[{
'name'
:
this
.
name
.
trim
(),
...
...
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