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
19d344cd
Commit
19d344cd
authored
Apr 28, 2017
by
Kalyani
Committed by
kevalbhatt
Apr 28, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-1737: UI - Delete tag(classification) from UI.
parent
3a70d11d
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
88 additions
and
16 deletions
+88
-16
VTag.js
dashboardv2/public/js/models/VTag.js
+9
-1
CommonViewFunction.js
dashboardv2/public/js/utils/CommonViewFunction.js
+1
-1
Utils.js
dashboardv2/public/js/utils/Utils.js
+8
-3
SideNavLayoutView.js
...dv2/public/js/views/business_catalog/SideNavLayoutView.js
+2
-1
TagLayoutView.js
dashboardv2/public/js/views/tag/TagLayoutView.js
+68
-10
No files found.
dashboardv2/public/js/models/VTag.js
View file @
19d344cd
...
@@ -40,7 +40,7 @@ define(['require',
...
@@ -40,7 +40,7 @@ define(['require',
/*************************
/*************************
* Non - CRUD operations
* Non - CRUD operations
*************************/
*************************/
delete
Tag
:
function
(
guid
,
name
,
options
)
{
delete
Association
:
function
(
guid
,
name
,
options
)
{
var
url
=
UrlLinks
.
entitiesApiUrl
(
guid
,
name
);
var
url
=
UrlLinks
.
entitiesApiUrl
(
guid
,
name
);
options
=
_
.
extend
({
options
=
_
.
extend
({
contentType
:
'application/json'
,
contentType
:
'application/json'
,
...
@@ -48,6 +48,14 @@ define(['require',
...
@@ -48,6 +48,14 @@ define(['require',
},
options
);
},
options
);
return
this
.
constructor
.
nonCrudOperation
.
call
(
this
,
url
,
'DELETE'
,
options
);
return
this
.
constructor
.
nonCrudOperation
.
call
(
this
,
url
,
'DELETE'
,
options
);
},
},
deleteTag
:
function
(
options
)
{
var
url
=
UrlLinks
.
typesClassicationApiUrl
();
options
=
_
.
extend
({
contentType
:
'application/json'
,
dataType
:
'json'
},
options
);
return
this
.
constructor
.
nonCrudOperation
.
call
(
this
,
url
,
'DELETE'
,
options
);
},
saveTagAttribute
:
function
(
options
)
{
saveTagAttribute
:
function
(
options
)
{
var
url
=
UrlLinks
.
typesClassicationApiUrl
();
var
url
=
UrlLinks
.
typesClassicationApiUrl
();
options
=
_
.
extend
({
options
=
_
.
extend
({
...
...
dashboardv2/public/js/utils/CommonViewFunction.js
View file @
19d344cd
...
@@ -39,7 +39,7 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
...
@@ -39,7 +39,7 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
if
(
options
.
showLoader
)
{
if
(
options
.
showLoader
)
{
options
.
showLoader
();
options
.
showLoader
();
}
}
tagModel
.
delete
Tag
(
options
.
guid
,
options
.
tagName
,
{
tagModel
.
delete
Association
(
options
.
guid
,
options
.
tagName
,
{
skipDefaultError
:
true
,
skipDefaultError
:
true
,
success
:
function
(
data
)
{
success
:
function
(
data
)
{
var
msg
=
"Tag "
+
name
.
name
+
Messages
.
removeSuccessMessage
;
var
msg
=
"Tag "
+
name
.
name
+
Messages
.
removeSuccessMessage
;
...
...
dashboardv2/public/js/utils/Utils.js
View file @
19d344cd
...
@@ -94,10 +94,12 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'pnotify.button
...
@@ -94,10 +94,12 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'pnotify.button
history
:
false
history
:
false
}
}
},
options
)).
get
().
on
(
'pnotify.confirm'
,
function
()
{
},
options
)).
get
().
on
(
'pnotify.confirm'
,
function
()
{
$
(
'.ui-pnotify-modal-overlay'
).
remove
().
fadeOut
();
if
(
options
.
ok
)
{
if
(
options
.
ok
)
{
options
.
ok
();
options
.
ok
();
}
}
}).
on
(
'pnotify.cancel'
,
function
()
{
}).
on
(
'pnotify.cancel'
,
function
()
{
$
(
'.ui-pnotify-modal-overlay'
).
remove
().
fadeOut
();
if
(
options
.
cancel
)
{
if
(
options
.
cancel
)
{
options
.
cancel
();
options
.
cancel
();
}
}
...
@@ -229,8 +231,11 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'pnotify.button
...
@@ -229,8 +231,11 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'pnotify.button
};
};
Utils
.
getUrlState
=
{
Utils
.
getUrlState
=
{
getQueryUrl
:
function
()
{
getQueryUrl
:
function
(
url
)
{
var
hashValue
=
window
.
location
.
hash
;
var
hashValue
=
window
.
location
.
hash
;
if
(
url
)
{
hashValue
=
url
;
}
return
{
return
{
firstValue
:
hashValue
.
split
(
'/'
)[
1
],
firstValue
:
hashValue
.
split
(
'/'
)[
1
],
hash
:
hashValue
,
hash
:
hashValue
,
...
@@ -259,8 +264,8 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'pnotify.button
...
@@ -259,8 +264,8 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'pnotify.button
getFirstValue
:
function
()
{
getFirstValue
:
function
()
{
return
this
.
getQueryUrl
().
firstValue
;
return
this
.
getQueryUrl
().
firstValue
;
},
},
getQueryParams
:
function
()
{
getQueryParams
:
function
(
url
)
{
var
qs
=
this
.
getQueryUrl
().
queyParams
[
1
];
var
qs
=
this
.
getQueryUrl
(
url
).
queyParams
[
1
];
if
(
typeof
qs
==
"string"
)
{
if
(
typeof
qs
==
"string"
)
{
qs
=
qs
.
split
(
'+'
).
join
(
' '
);
qs
=
qs
.
split
(
'+'
).
join
(
' '
);
var
params
=
{},
var
params
=
{},
...
...
dashboardv2/public/js/views/business_catalog/SideNavLayoutView.js
View file @
19d344cd
...
@@ -97,7 +97,8 @@ define(['require',
...
@@ -97,7 +97,8 @@ define(['require',
require
([
'views/tag/TagLayoutView'
],
function
(
TagLayoutView
)
{
require
([
'views/tag/TagLayoutView'
],
function
(
TagLayoutView
)
{
that
.
RTagLayoutView
.
show
(
new
TagLayoutView
({
that
.
RTagLayoutView
.
show
(
new
TagLayoutView
({
collection
:
that
.
collection
,
collection
:
that
.
collection
,
tag
:
that
.
tag
tag
:
that
.
tag
,
typeHeaders
:
that
.
typeHeaders
}));
}));
});
});
},
},
...
...
dashboardv2/public/js/views/tag/TagLayoutView.js
View file @
19d344cd
...
@@ -22,8 +22,9 @@ define(['require',
...
@@ -22,8 +22,9 @@ define(['require',
'utils/Utils'
,
'utils/Utils'
,
'utils/Messages'
,
'utils/Messages'
,
'utils/Globals'
,
'utils/Globals'
,
'utils/UrlLinks'
'utils/UrlLinks'
,
],
function
(
require
,
Backbone
,
TagLayoutViewTmpl
,
Utils
,
Messages
,
Globals
,
UrlLinks
)
{
'models/VTag'
],
function
(
require
,
Backbone
,
TagLayoutViewTmpl
,
Utils
,
Messages
,
Globals
,
UrlLinks
,
VTag
)
{
'use strict'
;
'use strict'
;
var
TagLayoutView
=
Backbone
.
Marionette
.
LayoutView
.
extend
(
var
TagLayoutView
=
Backbone
.
Marionette
.
LayoutView
.
extend
(
...
@@ -58,11 +59,11 @@ define(['require',
...
@@ -58,11 +59,11 @@ define(['require',
* @constructs
* @constructs
*/
*/
initialize
:
function
(
options
)
{
initialize
:
function
(
options
)
{
_
.
extend
(
this
,
_
.
pick
(
options
,
'tag'
,
'collection'
));
_
.
extend
(
this
,
_
.
pick
(
options
,
'tag'
,
'collection'
,
'typeHeaders'
));
},
},
bindEvents
:
function
()
{
bindEvents
:
function
()
{
var
that
=
this
;
var
that
=
this
;
this
.
listenTo
(
this
.
collection
,
"reset add"
,
function
()
{
this
.
listenTo
(
this
.
collection
,
"reset add
remove
"
,
function
()
{
this
.
tagsAndTypeGenerator
(
'collection'
);
this
.
tagsAndTypeGenerator
(
'collection'
);
},
this
);
},
this
);
this
.
ui
.
tagsParent
.
on
(
'click'
,
'li.parent-node a'
,
function
()
{
this
.
ui
.
tagsParent
.
on
(
'click'
,
'li.parent-node a'
,
function
()
{
...
@@ -163,7 +164,6 @@ define(['require',
...
@@ -163,7 +164,6 @@ define(['require',
if
(
this
.
createTag
)
{
if
(
this
.
createTag
)
{
this
.
createTag
=
false
;
this
.
createTag
=
false
;
}
}
},
},
onClickCreateTag
:
function
(
e
)
{
onClickCreateTag
:
function
(
e
)
{
var
that
=
this
;
var
that
=
this
;
...
@@ -257,8 +257,6 @@ define(['require',
...
@@ -257,8 +257,6 @@ define(['require',
duplicateAttributeList
.
push
(
obj
.
name
);
duplicateAttributeList
.
push
(
obj
.
name
);
}
}
});
});
var
notifyObj
=
{
var
notifyObj
=
{
confirm
:
{
confirm
:
{
confirm
:
true
,
confirm
:
true
,
...
@@ -288,7 +286,6 @@ define(['require',
...
@@ -288,7 +286,6 @@ define(['require',
Utils
.
notifyConfirm
(
notifyObj
);
Utils
.
notifyConfirm
(
notifyObj
);
return
false
;
return
false
;
}
}
}
}
this
.
json
=
{
this
.
json
=
{
classificationDefs
:
[{
classificationDefs
:
[{
...
@@ -312,6 +309,7 @@ define(['require',
...
@@ -312,6 +309,7 @@ define(['require',
content
:
"Tag "
+
that
.
name
+
Messages
.
addSuccessMessage
content
:
"Tag "
+
that
.
name
+
Messages
.
addSuccessMessage
});
});
modal
.
trigger
(
'cancel'
);
modal
.
trigger
(
'cancel'
);
that
.
typeHeaders
.
fetch
({
reset
:
true
});
}
}
});
});
},
},
...
@@ -342,7 +340,8 @@ define(['require',
...
@@ -342,7 +340,8 @@ define(['require',
container
:
'body'
,
container
:
'body'
,
content
:
function
()
{
content
:
function
()
{
return
"<ul class='tagPopoverList'>"
+
return
"<ul class='tagPopoverList'>"
+
"<li class='listTerm' ><i class='fa fa-search'></i> <a href='javascript:void(0)' data-fn='onSearchTerm'>Search Tag</a></li>"
+
"<li class='listTerm' ><i class='fa fa-search'></i> <a href='javascript:void(0)' data-fn='onSearchTag'>Search Tag</a></li>"
+
"<li class='listTerm' ><i class='fa fa-trash-o'></i> <a href='javascript:void(0)' data-fn='onDeleteTag'>Delete Tag</a></li>"
+
"</ul>"
;
"</ul>"
;
}
}
});
});
...
@@ -353,7 +352,7 @@ define(['require',
...
@@ -353,7 +352,7 @@ define(['require',
$
(
this
).
popover
(
'toggle'
);
$
(
this
).
popover
(
'toggle'
);
});
});
},
},
onSearchT
erm
:
function
()
{
onSearchT
ag
:
function
()
{
Utils
.
setUrl
({
Utils
.
setUrl
({
url
:
'#!/search/searchResult'
,
url
:
'#!/search/searchResult'
,
urlParams
:
{
urlParams
:
{
...
@@ -367,6 +366,65 @@ define(['require',
...
@@ -367,6 +366,65 @@ define(['require',
mergeBrowserUrl
:
false
,
mergeBrowserUrl
:
false
,
trigger
:
true
trigger
:
true
});
});
},
onDeleteTag
:
function
()
{
var
that
=
this
;
this
.
tagName
=
this
.
ui
.
tagsParent
.
find
(
'li.active'
).
find
(
"a"
).
data
(
'name'
);
this
.
tagDeleteData
=
this
.
ui
.
tagsParent
.
find
(
'li.active'
);
var
notifyObj
=
{
ok
:
function
(
argument
)
{
that
.
onNotifyOk
();
},
cancel
:
function
(
argument
)
{}
}
var
text
=
"Are you sure you want to delete the tag"
notifyObj
[
'text'
]
=
text
;
notifyObj
[
'stack'
]
=
{
'dir1'
:
'down'
,
'dir2'
:
'right'
,
'modal'
:
true
};
Utils
.
notifyConfirm
(
notifyObj
);
},
onNotifyOk
:
function
(
data
)
{
var
that
=
this
,
deleteTagData
=
this
.
collection
.
fullCollection
.
findWhere
({
name
:
this
.
tagName
}),
classificationData
=
deleteTagData
.
toJSON
(),
deleteJson
=
{
classificationDefs
:
[
classificationData
],
entityDefs
:
[],
enumDefs
:
[],
structDefs
:
[]
};
deleteTagData
.
deleteTag
({
data
:
JSON
.
stringify
(
deleteJson
),
success
:
function
()
{
Utils
.
notifySuccess
({
content
:
"Tag "
+
that
.
tagName
+
Messages
.
deleteSuccessMessage
});
var
searchUrl
=
Globals
.
saveApplicationState
.
tabState
.
searchUrl
;
var
urlObj
=
Utils
.
getUrlState
.
getQueryParams
(
searchUrl
);
if
(
urlObj
&&
urlObj
.
tag
&&
urlObj
.
tag
===
that
.
tagName
)
{
Globals
.
saveApplicationState
.
tabState
.
searchUrl
=
"#!/search"
;
}
that
.
ui
.
tagsParent
.
find
(
'li.active'
).
removeClass
(
'active'
);
if
(
that
.
tagDeleteData
.
prev
().
length
===
0
)
{
that
.
tagDeleteData
.
next
().
addClass
(
'active'
);
}
else
{
that
.
tagDeleteData
.
prev
().
addClass
(
'active'
);
}
Utils
.
setUrl
({
url
:
that
.
ui
.
tagsParent
.
find
(
'li.active'
).
find
(
"a"
).
attr
(
"href"
),
mergeBrowserUrl
:
false
,
trigger
:
true
,
updateTabState
:
function
()
{
return
{
tagUrl
:
that
.
url
,
stateChanged
:
true
};
}
});
that
.
collection
.
remove
(
deleteTagData
);
that
.
typeHeaders
.
fetch
({
reset
:
true
});
}
});
}
}
});
});
return
TagLayoutView
;
return
TagLayoutView
;
...
...
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