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
The following commit(s) were added to refs/heads/master by this push:
new ceb7f39 ATLAS-4553 : Columns added in search results page gets reset
after clicking refresh button
ceb7f39 is described below
commit ceb7f393e1fcd6032362ab78c86e7444fab4fc03
Author: Farhan Khan <[email protected]>
AuthorDate: Wed Feb 23 15:45:02 2022 +0530
ATLAS-4553 : Columns added in search results page gets reset after clicking
refresh button
Signed-off-by: Pinal Shah <[email protected]>
---
.../public/js/views/search/SearchResultLayoutView.js | 15 ++++++++-------
.../public/js/views/search/SearchResultLayoutView.js | 14 +++++++-------
2 files changed, 15 insertions(+), 14 deletions(-)
diff --git a/dashboardv2/public/js/views/search/SearchResultLayoutView.js
b/dashboardv2/public/js/views/search/SearchResultLayoutView.js
index b98ef9a..66466e2 100644
--- a/dashboardv2/public/js/views/search/SearchResultLayoutView.js
+++ b/dashboardv2/public/js/views/search/SearchResultLayoutView.js
@@ -248,6 +248,7 @@ define(['require',
}
}, this);
this.listenTo(this.searchVent, "search:refresh",
function(model, response) {
+ this.updateColumnList();
this.fetchCollection();
}, this);
this.listenTo(this.searchCollection, "backgrid:sorted",
function(model, response) {
@@ -371,11 +372,11 @@ define(['require',
});
listOfColumns = _.sortBy(listOfColumns);
this.value.attributes = listOfColumns.length ?
listOfColumns.join(",") : null;
- if (this.value && this.value.type &&
this.searchTableColumns) {
- this.searchTableColumns[this.value.type] =
listOfColumns.length ? listOfColumns : null;
+ if (this.value && (this.value.type || this.value.tag) &&
this.searchTableColumns) {
+ this.searchTableColumns[this.value.type ||
this.value.tag] = listOfColumns.length ? listOfColumns : null;
}
- } else if (this.value && this.value.type &&
this.searchTableColumns && this.value.attributes) {
- this.searchTableColumns[this.value.type] =
this.value.attributes.split(",");
+ } else if (this.value && (this.value.type || this.value.tag)
&& this.searchTableColumns && this.value.attributes) {
+ this.searchTableColumns[this.value.type || this.value.tag]
= this.value.attributes.split(",");
}
},
fetchCollection: function(value, options) {
@@ -392,7 +393,7 @@ define(['require',
}
if (isPostMethod && isSearchTab) {
- var excludeDefaultColumn = this.value.type &&
this.searchTableColumns ?
_.difference(this.searchTableColumns[this.value.type], this.defaultColumns) :
null,
+ var excludeDefaultColumn = ((this.value.type ||
this.value.tag) && this.searchTableColumns) ?
_.difference(this.searchTableColumns[this.value.type || this.value.tag],
this.defaultColumns) : null,
filterObj = {
'entityFilters': entityFilters,
'tagFilters': tagFilters,
@@ -666,8 +667,8 @@ define(['require',
columnToShow = null,
col = {};
this.value = this.fromView === "glossary" ? this.value :
Utils.getUrlState.getQueryParams() || this.value;
- if (this.value && this.value.searchType === "basic" &&
this.searchTableColumns && (this.searchTableColumns[this.value.type] !==
undefined)) {
- columnToShow = this.searchTableColumns[this.value.type] ==
null ? [] : this.searchTableColumns[this.value.type];
+ if (this.value && this.value.searchType === "basic" &&
this.searchTableColumns && (this.searchTableColumns[this.value.type ||
this.value.tag] !== undefined)) {
+ columnToShow = this.searchTableColumns[this.value.type ||
this.value.tag] == null ? [] : this.searchTableColumns[this.value.type ||
this.value.tag];
}
col['Check'] = {
name: "selected",
diff --git a/dashboardv3/public/js/views/search/SearchResultLayoutView.js
b/dashboardv3/public/js/views/search/SearchResultLayoutView.js
index 9837b5a..d9d2383 100644
--- a/dashboardv3/public/js/views/search/SearchResultLayoutView.js
+++ b/dashboardv3/public/js/views/search/SearchResultLayoutView.js
@@ -385,11 +385,11 @@ define(['require',
});
listOfColumns = _.sortBy(listOfColumns);
this.value.attributes = listOfColumns.length ?
listOfColumns.join(",") : null;
- if (this.value && this.value.type &&
this.searchTableColumns) {
- this.searchTableColumns[this.value.type] =
listOfColumns.length ? listOfColumns : null;
+ if (this.value && (this.value.type || this.value.tag) &&
this.searchTableColumns) {
+ this.searchTableColumns[this.value.type ||
this.value.tag] = listOfColumns.length ? listOfColumns : null;
}
- } else if (this.value && this.value.type &&
this.searchTableColumns && this.value.attributes) {
- this.searchTableColumns[this.value.type] =
this.value.attributes.split(",");
+ } else if (this.value && (this.value.type || this.value.tag)
&& this.searchTableColumns && this.value.attributes) {
+ this.searchTableColumns[this.value.type || this.value.tag]
= this.value.attributes.split(",");
}
},
fetchCollection: function(value, options) {
@@ -406,7 +406,7 @@ define(['require',
}
if (isPostMethod && isSearchTab) {
- var excludeDefaultColumn = this.value.type &&
this.searchTableColumns ?
_.difference(this.searchTableColumns[this.value.type], this.defaultColumns) :
null,
+ var excludeDefaultColumn = ((this.value.type ||
this.value.tag) && this.searchTableColumns) ?
_.difference(this.searchTableColumns[this.value.type || this.value.tag],
this.defaultColumns) : null,
filterObj = {
'entityFilters': entityFilters,
'tagFilters': tagFilters,
@@ -682,8 +682,8 @@ define(['require',
columnToShow = null,
col = {};
this.value = Utils.getUrlState.getQueryParams() || this.value;
- if (this.value && this.value.searchType === "basic" &&
this.searchTableColumns && (this.searchTableColumns[this.value.type] !==
undefined)) {
- columnToShow = this.searchTableColumns[this.value.type] ==
null ? [] : this.searchTableColumns[this.value.type];
+ if (this.value && this.value.searchType === "basic" &&
this.searchTableColumns && (this.searchTableColumns[this.value.type ||
this.value.tag] !== undefined)) {
+ columnToShow = this.searchTableColumns[this.value.type ||
this.value.tag] == null ? [] : this.searchTableColumns[this.value.type ||
this.value.tag];
}
col['Check'] = {
name: "selected",