Commit 2841b85e by kevalbhatt Committed by Madhan Neethiraj

ATLAS-2073: UI - removing tag or type from drop-down will not exclude respective filters

Signed-off-by: 's avatarMadhan Neethiraj <madhan@apache.org> (cherry picked from commit fa1a5d702dc47658fff168ddb0700a0e0b4d629b)
parent ce8f65c9
......@@ -132,7 +132,7 @@ define([
App.rSideNav.show(new SideNavLayoutView(
_.extend({
'url': url
}, that.preFetchedCollectionLists)
}, that.preFetchedCollectionLists, that.sharedObj)
));
} else {
App.rSideNav.currentView.RBusinessCatalogLayoutView.currentView.manualRender("/" + url);
......@@ -163,7 +163,7 @@ define([
App.rNHeader.show(new Header());
if (!App.rSideNav.currentView) {
App.rSideNav.show(new SideNavLayoutView(
_.extend({}, that.preFetchedCollectionLists)
_.extend({}, that.preFetchedCollectionLists, that.sharedObj)
));
} else {
App.rSideNav.currentView.selectTab();
......@@ -171,7 +171,7 @@ define([
App.rNContent.show(new DetailPageLayoutView(_.extend({
'collection': this.entityCollection,
'id': id,
}, that.preFetchedCollectionLists)));
}, that.preFetchedCollectionLists, that.sharedObj)));
this.entityCollection.url = UrlLinks.entitiesApiUrl(id);
this.entityCollection.fetch({ reset: true });
});
......@@ -201,7 +201,7 @@ define([
App.rSideNav.show(new SideNavLayoutView(
_.extend({
'tag': tagName
}, that.preFetchedCollectionLists)
}, that.preFetchedCollectionLists, that.sharedObj)
));
} else {
if (paramObj && paramObj.dlttag) {
......@@ -225,7 +225,7 @@ define([
App.rNContent.show(new TagDetailLayoutView(
_.extend({
'tag': tagName
}, that.preFetchedCollectionLists)
}, that.preFetchedCollectionLists, that.sharedObj)
));
}
});
......
......@@ -289,7 +289,10 @@ define(['require',
okAttrFilterButton: function(e) {
var isTag = this.attrModal.tag ? true : false,
filtertype = isTag ? 'tagFilters' : 'entityFilters',
rule = this.attrModal.RQueryBuilder.currentView.ui.builder.queryBuilder('getRules');
queryBuilderRef = this.attrModal.RQueryBuilder.currentView.ui.builder;
if (queryBuilderRef.data('queryBuilder')) {
var rule = queryBuilderRef.queryBuilder('getRules');
}
if (rule) {
var ruleUrl = CommonViewFunction.attributeFilter.generateUrl(rule.rules);
this.searchTableFilters[filtertype][(isTag ? this.value.tag : this.value.type)] = ruleUrl;
......@@ -380,7 +383,9 @@ define(['require',
this.query[this.type].query = value || null;
var params = {
searchType: this.type,
dslChecked: this.ui.searchType.is(':checked')
dslChecked: this.ui.searchType.is(':checked'),
tagFilters: null,
entityFilters: null
}
this.query[this.type].type = this.ui.typeLov.select2('val') || null;
if (!this.dsl) {
......@@ -436,27 +441,30 @@ define(['require',
this.updateQueryObject(paramObj);
}
if (paramObj && this.type == "basic") {
this.query[this.type].attribute = paramObj.attributes ? paramObj.attributes : null;
this.query[this.type].attributes = paramObj.attributes ? paramObj.attributes : null;
}
if (Utils.getUrlState.isSearchTab()) {
Utils.setUrl({
url: '#!/search/searchResult',
urlParams: _.extend(this.query[this.type], {
searchType: this.type,
dslChecked: this.ui.searchType.is(':checked'),
includeDE: this.value.includeDE
}),
updateTabState: function() {
return { searchUrl: this.url, stateChanged: true };
},
mergeBrowserUrl: false,
trigger: true
});
}
Utils.setUrl({
url: '#!/search/searchResult',
urlParams: _.extend(this.query[this.type], {
searchType: this.type,
dslChecked: this.ui.searchType.is(':checked')
}),
updateTabState: function() {
return { searchUrl: this.url, stateChanged: true };
},
mergeBrowserUrl: false,
trigger: true
});
},
clearSearchData: function() {
this.updateQueryObject();
this.ui.typeLov.val("").trigger("change");
this.ui.tagLov.val("").trigger("change");
this.ui.searchInput.val("");
if (this.dsl) {
if (!this.dsl) {
this.searchTableFilters.tagFilters = {};
this.searchTableFilters.entityFilters = {};
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment