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

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


The following commit(s) were added to refs/heads/master by this push:
     new f1df13d  ATLAS-3664 - Beta UI : Fix Option to select CLASSIFIED and 
NOT_CLASSIFIED.
f1df13d is described below

commit f1df13dc72501d5e4001c72aca2ee2733a047347
Author: sameer79 <findsameersha...@yahoo.co.in>
AuthorDate: Fri Mar 13 18:05:12 2020 +0530

    ATLAS-3664 - Beta UI : Fix Option to select CLASSIFIED and NOT_CLASSIFIED.
    
    Signed-off-by: nixonrodrigues <ni...@apache.org>
---
 dashboardv3/public/js/main.js                      |  4 +-
 dashboardv3/public/js/utils/CommonViewFunction.js  |  5 ++-
 .../search/tree/ClassificationTreeLayoutView.js    | 44 +++++++++++-----------
 3 files changed, 28 insertions(+), 25 deletions(-)

diff --git a/dashboardv3/public/js/main.js b/dashboardv3/public/js/main.js
index 96ef7ae..4acbd52 100644
--- a/dashboardv3/public/js/main.js
+++ b/dashboardv3/public/js/main.js
@@ -342,10 +342,10 @@ require(['App',
 
     CommonViewFunction.fetchRootClassificationAttributes({
         url: UrlLinks.rootClassificationDefUrl(Enums.addOnClassification[0]),
-        classification: Enums.addOnClassification[0],
+        classification: Enums.addOnClassification,
         callback: function() {
             --that.asyncFetchCounter;
             startApp();
         }
     });
-});
\ No newline at end of file
+});
diff --git a/dashboardv3/public/js/utils/CommonViewFunction.js 
b/dashboardv3/public/js/utils/CommonViewFunction.js
index 6ddfb84..965753b 100644
--- a/dashboardv3/public/js/utils/CommonViewFunction.js
+++ b/dashboardv3/public/js/utils/CommonViewFunction.js
@@ -1012,7 +1012,10 @@ define(['require', 'utils/Utils', 'modules/Modal', 
'utils/Messages', 'utils/Enum
                 cache: true,
                 success: function(response) {
                     if (response) {
-                        Globals[options.classification] = 
Object.assign(response, { name: options.classification, guid: 
options.classification });
+                        _.each(options.classification, 
function(rootClassification) {
+                            var responseData = $.extend(true, {}, response);
+                            Globals[rootClassification] = 
Object.assign(responseData, { name: rootClassification, guid: 
rootClassification });
+                        });
                     }
                 },
                 complete: function(response) {
diff --git 
a/dashboardv3/public/js/views/search/tree/ClassificationTreeLayoutView.js 
b/dashboardv3/public/js/views/search/tree/ClassificationTreeLayoutView.js
index 87f0b9a..b6fec97 100644
--- a/dashboardv3/public/js/views/search/tree/ClassificationTreeLayoutView.js
+++ b/dashboardv3/public/js/views/search/tree/ClassificationTreeLayoutView.js
@@ -258,18 +258,15 @@ define([
                 this.ui.classificationSearchTree.jstree(true).deselect_all();
                 this.tagId = null;
             } else {
-                if (that.options.value.tag === "_ALL_CLASSIFICATION_TYPES" && 
this.tagId !== "_ALL_CLASSIFICATION_TYPES") {
+                if ((that.options.value.tag === "_ALL_CLASSIFICATION_TYPES" && 
this.tagId !== "_ALL_CLASSIFICATION_TYPES") || (that.options.value.tag === 
"_NOT_CLASSIFIED" && this.tagId !== "_NOT_CLASSIFIED") || 
(that.options.value.tag === "_CLASSIFIED" && this.tagId !== "_CLASSIFIED")) {
                     this.fromManualRender = true;
                     if (this.tagId) {
                         
this.ui.classificationSearchTree.jstree(true).deselect_node(this.tagId);
                     }
                     this.tagId = Globals[that.options.value.tag].guid;
                     
this.ui.classificationSearchTree.jstree(true).select_node(this.tagId);
-                } else if (this.tagId !== "_ALL_CLASSIFICATION_TYPES" && 
that.options.value.tag !== this.tagId) {
-                    if ((that.options.value.tag.indexOf('*') != -1)) {
-                        
that.ui.classificationSearchTree.jstree(true).deselect_all();
+                } else if ((this.tagId !== "_ALL_CLASSIFICATION_TYPES" && 
that.options.value.tag !== this.tagId) || (this.tagId !== "_NOT_CLASSIFIED" && 
that.options.value.tag !== this.tagId) || (this.tagId !== "_CLASSIFIED" && 
that.options.value.tag !== this.tagId)) {
                         that.ui.wildCardValue.val(that.options.value.tag);
-                    }
                     var dataFound = 
this.classificationDefCollection.fullCollection.find(function(obj) {
                         return obj.get("name") === that.options.value.tag
                     });
@@ -513,23 +510,26 @@ define([
             return classificationData;
         },
         pushRootClassificationToJstree: function(data) {
-            var rootClassification = Globals[Enums.addOnClassification[0]];
-            var isSelected = this.options.value && this.options.value.tag ? 
this.options.value.tag == rootClassification.name : false;
-            var rootClassificationNode = {
-                text: _.escape(rootClassification.name),
-                name: rootClassification.name,
-                type: rootClassification.category,
-                gType: "Classification",
-                guid: rootClassification.guid,
-                id: rootClassification.guid,
-                model: rootClassification,
-                children: [],
-                icon: "fa fa-tag",
-                state: {
-                    selected: isSelected
+            var that = this;
+            _.each(Enums.addOnClassification, function(addOnClassification) {
+                var rootClassification = Globals[addOnClassification];
+                var isSelected = that.options.value && that.options.value.tag 
? that.options.value.tag == rootClassification.name : false;
+                var rootClassificationNode = {
+                    text: _.escape(rootClassification.name),
+                    name: rootClassification.name,
+                    type: rootClassification.category,
+                    gType: "Classification",
+                    guid: rootClassification.guid,
+                    id: rootClassification.guid,
+                    model: rootClassification,
+                    children: [],
+                    icon: "fa fa-tag",
+                    state: {
+                        selected: isSelected
+                    }
                 }
-            }
-            data.push(rootClassificationNode);
+                data.push(rootClassificationNode);
+            });
             return data;
         },
         generateSearchTree: function(options) {
@@ -832,4 +832,4 @@ define([
 
     });
     return ClassificationTreeLayoutView;
-});
\ No newline at end of file
+});

Reply via email to