Repository: atlas Updated Branches: refs/heads/master 024fd2210 -> 97ae3a3c8
ATLAS-2080: fix - tag filters should not be added in the results attributes list Signed-off-by: Madhan Neethiraj <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/97ae3a3c Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/97ae3a3c Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/97ae3a3c Branch: refs/heads/master Commit: 97ae3a3c819a371d9af39cd4de28e4f8b28e19a6 Parents: 024fd22 Author: kevalbhatt <[email protected]> Authored: Wed Aug 23 15:45:55 2017 +0530 Committer: Madhan Neethiraj <[email protected]> Committed: Wed Aug 23 09:18:53 2017 -0700 ---------------------------------------------------------------------- .../public/js/views/search/SearchLayoutView.js | 23 +++++----- .../js/views/search/SearchResultLayoutView.js | 4 +- .../public/js/views/tag/TagLayoutView.js | 45 ++++++++++---------- 3 files changed, 38 insertions(+), 34 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/atlas/blob/97ae3a3c/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 5916aa0..cd8c291 100644 --- a/dashboardv2/public/js/views/search/SearchLayoutView.js +++ b/dashboardv2/public/js/views/search/SearchLayoutView.js @@ -297,7 +297,7 @@ define(['require', var ruleUrl = CommonViewFunction.attributeFilter.generateUrl(rule.rules); this.searchTableFilters[filtertype][(isTag ? this.value.tag : this.value.type)] = ruleUrl; this.makeFilterButtonActive(filtertype); - if (this.value && this.searchTableColumns) { + if (!isTag && this.value && this.value.type && this.searchTableColumns) { if (!this.searchTableColumns[this.value.type]) { this.searchTableColumns[this.value.type] = ["selected", "name", "owner", "description", "tag", "typeName"] } @@ -344,9 +344,13 @@ define(['require', } if (this.value) { if (this.value.dslChecked == "true") { - this.ui.searchType.prop("checked", true).trigger("change"); + if (!this.ui.searchType.prop("checked")) { + this.ui.searchType.prop("checked", true).trigger("change"); + } } else { - this.ui.searchType.prop("checked", false).trigger("change"); + if (this.ui.searchType.prop("checked")) { + this.ui.searchType.prop("checked", false).trigger("change"); + } } this.ui.typeLov.val(this.value.type); if (this.ui.typeLov.data('select2')) { @@ -385,7 +389,9 @@ define(['require', searchType: this.type, dslChecked: this.ui.searchType.is(':checked'), tagFilters: null, - entityFilters: null + entityFilters: null, + attributes: null, + includeDE: null } this.query[this.type].type = this.ui.typeLov.select2('val') || null; if (!this.dsl) { @@ -398,15 +404,12 @@ define(['require', if (this.value.type) { params['entityFilters'] = entityFilterObj[this.value.type] } - } - if (this.dsl) { - params['attributes'] = null; - } else { var columnList = this.value && this.value.type && this.searchTableColumns ? this.searchTableColumns[this.value.type] : null; if (columnList) { params['attributes'] = columnList.join(','); - } else { - params['attributes'] = null; + } + if (this.value.includeDE) { + params['includeDE'] = this.value.includeDE } } http://git-wip-us.apache.org/repos/asf/atlas/blob/97ae3a3c/dashboardv2/public/js/views/search/SearchResultLayoutView.js ---------------------------------------------------------------------- diff --git a/dashboardv2/public/js/views/search/SearchResultLayoutView.js b/dashboardv2/public/js/views/search/SearchResultLayoutView.js index 80b5b04..970d6a3 100644 --- a/dashboardv2/public/js/views/search/SearchResultLayoutView.js +++ b/dashboardv2/public/js/views/search/SearchResultLayoutView.js @@ -294,7 +294,7 @@ define(['require', }); listOfColumns = _.sortBy(listOfColumns); this.value.attributes = listOfColumns.length ? listOfColumns.join(",") : null; - if (this.value && this.searchTableColumns) { + if (this.value && this.value.type && this.searchTableColumns) { this.searchTableColumns[this.value.type] = listOfColumns.length ? listOfColumns : null; } } else if (this.value && this.value.type && this.searchTableColumns && this.value.attributes) { @@ -343,7 +343,7 @@ define(['require', tagFilters = CommonViewFunction.attributeFilter.generateAPIObj(this.value.tagFilters), entityFilters = CommonViewFunction.attributeFilter.generateAPIObj(this.value.entityFilters); if (isPostMethod) { - var excludeDefaultColumn = this.searchTableColumns ? _.without(this.searchTableColumns[this.value.type], "selected", "name", "description", "typeName", "owner", "tag", "terms") : null, + var excludeDefaultColumn = this.value.type && this.searchTableColumns ? _.without(this.searchTableColumns[this.value.type], "selected", "name", "description", "typeName", "owner", "tag", "terms") : null, filterObj = { 'entityFilters': entityFilters, 'tagFilters': tagFilters, http://git-wip-us.apache.org/repos/asf/atlas/blob/97ae3a3c/dashboardv2/public/js/views/tag/TagLayoutView.js ---------------------------------------------------------------------- diff --git a/dashboardv2/public/js/views/tag/TagLayoutView.js b/dashboardv2/public/js/views/tag/TagLayoutView.js index 5f58ad7..658cab3 100644 --- a/dashboardv2/public/js/views/tag/TagLayoutView.js +++ b/dashboardv2/public/js/views/tag/TagLayoutView.js @@ -73,7 +73,7 @@ define(['require', onRender: function() { var that = this; this.bindEvents(); - this.fetchCollections(); + this.tagsGenerator(); $('body').on("click", '.tagPopoverList li', function(e) { that[$(this).find("a").data('fn')](e); }); @@ -148,31 +148,32 @@ define(['require', } }, tagsGenerator: function(searchString) { - var that = this, - str = ''; - that.collection.fullCollection.comparator = function(model) { - return Utils.getName(model.toJSON(), 'name').toLowerCase(); - }; - that.collection.fullCollection.sort().each(function(model) { - var name = Utils.getName(model.toJSON(), 'name'); - var checkTagOrTerm = Utils.checkTagOrTerm(name); - if (checkTagOrTerm.tag) { - if (searchString) { - if (name.search(new RegExp(searchString, "i")) != -1) { - str += '<li class="parent-node" data-id="tags"><div class="tools"><i class="fa fa-ellipsis-h tagPopover"></i></div><a href="#!/tag/tagAttribute/' + name + '" data-name="' + name + '" >' + name + '</a></li>'; + var str = ''; + if (this.collection && this.collection.fullCollection.length) { + this.collection.fullCollection.comparator = function(model) { + return Utils.getName(model.toJSON(), 'name').toLowerCase(); + }; + this.collection.fullCollection.sort().each(function(model) { + var name = Utils.getName(model.toJSON(), 'name'); + var checkTagOrTerm = Utils.checkTagOrTerm(name); + if (checkTagOrTerm.tag) { + if (searchString) { + if (name.search(new RegExp(searchString, "i")) != -1) { + str += '<li class="parent-node" data-id="tags"><div class="tools"><i class="fa fa-ellipsis-h tagPopover"></i></div><a href="#!/tag/tagAttribute/' + name + '" data-name="' + name + '" >' + name + '</a></li>'; + } else { + return; + } } else { - return; + str += '<li class="parent-node" data-id="tags"><div class="tools"><i class="fa fa-ellipsis-h tagPopover"></i></div><a href="#!/tag/tagAttribute/' + name + '" data-name="' + name + '">' + name + '</a></li>'; } - } else { - str += '<li class="parent-node" data-id="tags"><div class="tools"><i class="fa fa-ellipsis-h tagPopover"></i></div><a href="#!/tag/tagAttribute/' + name + '" data-name="' + name + '">' + name + '</a></li>'; } + }); + this.ui.tagsParent.empty().html(str); + this.setValues(); + this.createTagAction(); + if (this.createTag) { + this.createTag = false; } - }); - this.ui.tagsParent.empty().html(str); - this.setValues(); - this.createTagAction(); - if (this.createTag) { - this.createTag = false; } }, onClickCreateTag: function(e) {
