You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@atlas.apache.org by ni...@apache.org on 2018/03/21 14:44:09 UTC

[2/2] atlas git commit: ATLAS-2506 : Attributes of filters in the inner filter group are not added to attributes JSON array of the Basic POST request body

ATLAS-2506 : Attributes of filters in the inner filter group are not added to attributes JSON array of the Basic POST request body

Signed-off-by: nixonrodrigues <ni...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/65c6f9c8
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/65c6f9c8
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/65c6f9c8

Branch: refs/heads/master
Commit: 65c6f9c8ed36d77c9a1e673da6e07a066414a1e5
Parents: 6ad7a5a
Author: pratik24mac <pr...@gmail.com>
Authored: Mon Mar 19 17:29:25 2018 +0530
Committer: nixonrodrigues <ni...@apache.org>
Committed: Wed Mar 21 20:13:28 2018 +0530

----------------------------------------------------------------------
 .../public/js/views/search/SearchLayoutView.js  | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/atlas/blob/65c6f9c8/dashboardv2/public/js/views/search/SearchLayoutView.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/views/search/SearchLayoutView.js b/dashboardv2/public/js/views/search/SearchLayoutView.js
index a0cd41e..e8405ee 100644
--- a/dashboardv2/public/js/views/search/SearchLayoutView.js
+++ b/dashboardv2/public/js/views/search/SearchLayoutView.js
@@ -106,8 +106,8 @@ define(['require',
                         pageLimit: null,
                         entityFilters: null,
                         includeDE: null,
-                        excludeST:null,
-                        excludeSC : null
+                        excludeST: null,
+                        excludeSC: null
                     }
                 };
                 if (!this.value) {
@@ -383,7 +383,8 @@ define(['require',
             okAttrFilterButton: function(e) {
                 var isTag = this.attrModal.tag ? true : false,
                     filtertype = isTag ? 'tagFilters' : 'entityFilters',
-                    queryBuilderRef = this.attrModal.RQueryBuilder.currentView.ui.builder;
+                    queryBuilderRef = this.attrModal.RQueryBuilder.currentView.ui.builder,
+                    col = [];
                 if (queryBuilderRef.data('queryBuilder')) {
                     var rule = queryBuilderRef.queryBuilder('getRules');
                 }
@@ -395,12 +396,23 @@ define(['require',
                         if (!this.searchTableColumns[this.value.type]) {
                             this.searchTableColumns[this.value.type] = ["selected", "name", "owner", "description", "tag", "typeName"]
                         }
-                        this.searchTableColumns[this.value.type] = _.sortBy(_.union(this.searchTableColumns[this.value.type], _.pluck(rule.rules, 'id')));
+                        this.searchTableColumns[this.value.type] = _.sortBy(_.union(this.searchTableColumns[this.value.type], getIdFromRuleObject(rule)));
                     }
                     this.attrModal.modal.close();
                     if ($(e.currentTarget).hasClass('search')) {
                         this.findSearchResult();
                     }
+
+                    function getIdFromRuleObject(rule) {
+                        _.map(rule.rules, function(obj, key) {
+                            if (_.has(obj, 'condition')) {
+                                return getIdFromRuleObject(obj);
+                            } else {
+                                return col.push(obj.id)
+                            }
+                        });
+                        return col;
+                    }
                 }
             },
             manualRender: function(paramObj) {