You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@atlas.apache.org by kb...@apache.org on 2020/02/17 05:43:12 UTC
[atlas] 02/02: ATLAS-3620 : Beta UI : No option to create child tag
by clicking the classificationPopover of parent tag.
This is an automated email from the ASF dual-hosted git repository.
kbhatt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/atlas.git
commit 8f6cb0e9afa07feb0fe615663650c4ee580fd657
Author: kevalbhatt <kb...@apache.org>
AuthorDate: Fri Feb 14 17:40:46 2020 +0530
ATLAS-3620 : Beta UI : No option to create child tag by clicking the classificationPopover of parent tag.
---
.../search/tree/ClassificationTreeLayoutView.js | 27 ++++++++++++++--------
1 file changed, 18 insertions(+), 9 deletions(-)
diff --git a/dashboardv3/public/js/views/search/tree/ClassificationTreeLayoutView.js b/dashboardv3/public/js/views/search/tree/ClassificationTreeLayoutView.js
index df49523..5c2026b 100644
--- a/dashboardv3/public/js/views/search/tree/ClassificationTreeLayoutView.js
+++ b/dashboardv3/public/js/views/search/tree/ClassificationTreeLayoutView.js
@@ -227,7 +227,7 @@ define([
selector: '.classificationPopover',
content: function() {
var type = $(this).data('detail'),
- liString = "<li><i class='fa fa-list-alt'></i><a href='javascript:void(0)' data-fn='onViewEdit'>View/Edit</a></li><li><i class='fa fa-trash-o'></i><a href='javascript:void(0)' data-fn='onDelete'>Delete</a></li><li><i class='fa fa-search'></i><a href='javascript:void(0)' data-fn='onSelectedSearch'>Search</a></li>"
+ liString = " <li><i class='fa fa-plus'></i><a href='javascript:void(0)' data-fn='onClickCreateTag'>Create Sub-classification</a></li><li><i class='fa fa-list-alt'></i><a href='javascript:void(0)' data-fn='onViewEdit'>View/Edit</a></li><li><i class='fa fa-trash-o'></i><a href='javascript:void(0)' data-fn='onDelete'>Delete</a></li><li><i class='fa fa-search'></i><a href='javascript:void(0)' data-fn='onSelectedSearch'>Search</a></li>"
return "<ul>" + liString + "</ul>";
}
}
@@ -585,20 +585,23 @@ define([
var aTag = that.$("#" + str.node.a_attr.id),
tagOffset = aTag.find(">.jstree-icon").offset();
that.$(".tree-tooltip").removeClass("show");
- if (tagOffset.top && tagOffset.left) {
- aTag.find(">span.tree-tooltip").css({
- top: "calc(" + tagOffset.top + "px - 45px)",
- left: "24px"
- }).addClass("show");
- }
+ setTimeout(function() {
+ if (aTag.hasClass("jstree-hovered") && tagOffset.top && tagOffset.left) {
+ aTag.find(">span.tree-tooltip").css({
+ top: "calc(" + tagOffset.top + "px - 45px)",
+ left: "24px"
+ }).addClass("show");
+ }
+ }, 1200);
}).on("dehover_node.jstree", function(nodes, str, res) {
that.$(".tree-tooltip").removeClass("show");
});
},
- onClickCreateTag: function(e) {
+
+ onClickCreateTag: function(tagName) {
var that = this;
require(["views/tag/CreateTagLayoutView", "modules/Modal"], function(CreateTagLayoutView, Modal) {
- var view = new CreateTagLayoutView({ tagCollection: that.options.classificationDefCollection, enumDefCollection: enumDefCollection }),
+ var view = new CreateTagLayoutView({ tagCollection: that.options.classificationDefCollection, enumDefCollection: enumDefCollection, selectedTag: tagName }),
modal = new Modal({
title: "Create a new classification",
content: view,
@@ -749,6 +752,12 @@ define([
}
});
},
+ onClickCreateTagClassification: function(e) {
+ var selectedNode = this.ui.classificationSearchTree.jstree("get_selected", true);
+ if (selectedNode && selectedNode[0]) {
+ this.onClickCreateTag(selectedNode[0].original.name);
+ }
+ },
onViewEditClassification: function() {
var selectedNode = this.ui.classificationSearchTree.jstree("get_selected", true);
if (selectedNode && selectedNode[0]) {