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

kbhatt pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/atlas.git

commit 722ce23ae36a3537d3aadf4aaba31376120af6b5
Author: kevalbhatt <[email protected]>
AuthorDate: Thu Feb 20 20:51:52 2020 +0530

    ATLAS-3623 : Beta UI: Basic search improvement to search for namespace 
attribute: Bug fix for column selection
    
    (cherry picked from commit e159f767820b3e25a5cf9f351586126201cda387)
---
 .../js/views/search/SearchDefaultLayoutView.js     | 22 ++++++++--------------
 .../js/views/search/SearchResultLayoutView.js      |  2 +-
 2 files changed, 9 insertions(+), 15 deletions(-)

diff --git a/dashboardv3/public/js/views/search/SearchDefaultLayoutView.js 
b/dashboardv3/public/js/views/search/SearchDefaultLayoutView.js
index 4f5c434..1f66331 100644
--- a/dashboardv3/public/js/views/search/SearchDefaultLayoutView.js
+++ b/dashboardv3/public/js/views/search/SearchDefaultLayoutView.js
@@ -352,7 +352,7 @@ define(["require", "backbone", "utils/Globals", 
"hbs!tmpl/search/SearchDefaultLa
             },
             getIdFromRuleObj: function(rule) {
                 var that = this,
-                    col = [];
+                    col = new Set();
                 _.map(rule.rules, function(obj, key) {
                     if (obj.id === "__state") {
                         that.options.value.includeDE = (obj.value === "ACTIVE" 
&& obj.operator === "=") || (obj.value === "DELETED" && obj.operator === "!=") 
? false : true;
@@ -360,10 +360,14 @@ define(["require", "backbone", "utils/Globals", 
"hbs!tmpl/search/SearchDefaultLa
                     if (_.has(obj, "condition")) {
                         return that.getIdFromRuleObj(obj);
                     } else {
-                        return col.push(obj.id);
+                        if (obj && obj.data && obj.data.entityType === 
"namespace") {
+                            return col.add("namespace");
+                        } else {
+                            return col.add(obj.id);
+                        }
                     }
                 });
-                return col;
+                return Array.from(col);
             },
             updateFilterOptions: function(rule, filtertype, isTag) {
                 var that = this,
@@ -371,19 +375,9 @@ define(["require", "backbone", "utils/Globals", 
"hbs!tmpl/search/SearchDefaultLa
                 this.options.searchTableFilters[filtertype][isTag ? 
this.options.value.tag : this.options.value.type] = ruleUrl;
                 if (!isTag && this.options.value && this.options.value.type && 
this.options.searchTableColumns) {
                     if 
(!this.options.searchTableColumns[this.options.value.type]) {
-                        
this.options.searchTableColumns[this.options.value.type] = ["selected", "name", 
"owner", "description", "tag", "typeName"];
+                        
this.options.searchTableColumns[this.options.value.type] = ["selected", "name", 
"description", "typeName", "owner", "tag", "term"];
                     }
                     this.options.searchTableColumns[this.options.value.type] = 
_.sortBy(_.union(this.options.searchTableColumns[this.options.value.type], 
this.getIdFromRuleObj(rule)));
-                    if (rule.rules) {
-                        _.find(rule.rules, function(checkNamespace) {
-                            if (checkNamespace.data && 
checkNamespace.data.entityType && checkNamespace.data.entityType == 
'namespace') {
-                                if 
(that.options.searchTableColumns[that.options.value.type].indexOf('namespace') 
== -1) {
-                                    
that.options.searchTableColumns[that.options.value.type].push(checkNamespace.data.entityType);
-                                }
-                                return true;
-                            }
-                        });
-                    }
                 }
             },
             renderQueryBuilder: function(obj, rQueryBuilder) {
diff --git a/dashboardv3/public/js/views/search/SearchResultLayoutView.js 
b/dashboardv3/public/js/views/search/SearchResultLayoutView.js
index 6d67bb6..4cc5358 100644
--- a/dashboardv3/public/js/views/search/SearchResultLayoutView.js
+++ b/dashboardv3/public/js/views/search/SearchResultLayoutView.js
@@ -787,7 +787,7 @@ define(['require',
                             }
                         })
                     };
-                    col['Namespaces'] = {
+                    col['namespace'] = {
                         label: "Namespaces",
                         cell: "Html",
                         editable: false,

Reply via email to