This is an automated email from the ASF dual-hosted git repository.

pinal pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/atlas.git

commit 12aeec0391de47d33d0c27eb901c7e8761d9a2cf
Author: prasad pawar <prasad.pa...@freestoneinfotech.com>
AuthorDate: Wed Apr 21 11:50:13 2021 +0530

    ATLAS-4245: New UI: "Download import template" and "Import Glossary term" 
gets blocked on valid navigation,fixed
    
    Signed-off-by: Pinal <pinal-shah>
---
 .../js/views/search/tree/GlossaryTreeLayoutView.js | 23 ++++++++++++----------
 1 file changed, 13 insertions(+), 10 deletions(-)

diff --git a/dashboardv3/public/js/views/search/tree/GlossaryTreeLayoutView.js 
b/dashboardv3/public/js/views/search/tree/GlossaryTreeLayoutView.js
index f61b1b1..e58b177 100644
--- a/dashboardv3/public/js/views/search/tree/GlossaryTreeLayoutView.js
+++ b/dashboardv3/public/js/views/search/tree/GlossaryTreeLayoutView.js
@@ -96,7 +96,7 @@ define([
                 this.glossaryCollection.fullCollection, "reset add change",
                 function(skip) {
                     if (this.ui.termSearchTree.jstree(true)) {
-                        that.glossaryTreeUpdate = true; //To Keep the 
selection of Term after any new Glossary is Created.
+                        that.isGlossaryTree = true; //To Keep the selection of 
Term after any new Glossary is Created.
                         this.ui.termSearchTree.jstree(true).refresh();
                     } else {
                         this.renderGlossaryTree();
@@ -158,10 +158,12 @@ define([
             this.getViewType();
             this.bindEvents();
             //To stop the trigger Search event, if the node is selected in Old 
UI and swicthed to New UI.
-            if (Utils.getUrlState.getQueryParams()) {
-                if(Utils.getUrlState.getQueryParams().gType === "term"){
-                    this.glossaryTreeUpdate = true;
-                }
+            this.isGlossaryTree = this.isGlossryTreeview();
+        },
+        isGlossryTreeview: function() {
+            var queryParams = Utils.getUrlState.getQueryParams();
+            if (queryParams && (queryParams.gType === "term" || 
queryParams.gType === "category")) {
+                return true;
             }
         },
         onRender: function() {
@@ -181,7 +183,7 @@ define([
             this.options.categoryEvent.off("Success:TermRename")
         },
         getViewType: function() {
-            if (this.options.value) {
+            if (Utils.getUrlState.isGlossaryTab()) {
                 this.isTermView = this.options.value.viewType ? 
this.options.value.viewType == "term" ? true : false : true;
             } else {
                 this.isTermView = true;
@@ -234,9 +236,10 @@ define([
             this.createTermAction();
         },
         onNodeSelect: function(options, showCategory) {
-            if (this.glossaryTreeUpdate && options.node.original.type === 
"GlossaryTerm") {
+            var nodeType = options.node.original.type;
+            if (this.isGlossaryTree && (nodeType === "GlossaryTerm" || 
nodeType === "GlossaryCategory")) {
                 //To stop the trigger Search event,if the node is selected in 
Old UI and swicthed to New UI.
-                this.glossaryTreeUpdate = false;
+                this.isGlossaryTree = false;
                 return;
             }
             var name, type, selectedNodeId, that = this,
@@ -773,7 +776,7 @@ define([
                             
that.options.categoryEvent.trigger("Success:Category", true);
                         }
                     }
-                    //Below condition is for switching the the Show Term/Show 
Category toggle button on swicthing from Old to New UI.
+                    //Below condition is for switching the the Show Term/Show 
Category toggle button on switching from Old to New UI.
                     if (that.isTermView === false) {
                         that.glossarySwitchBtnUpdate();
                     }
@@ -800,7 +803,7 @@ define([
         refresh: function(options) {
             this.glossaryTermId = null;
             this.fetchGlossary();
-            this.glossaryTreeUpdate = true;
+            this.isGlossaryTree = true;
         },
         onClickImportGlossary: function() {
             var that = this;

Reply via email to