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([ ...@@ -132,7 +132,7 @@ define([
App.rSideNav.show(new SideNavLayoutView( App.rSideNav.show(new SideNavLayoutView(
_.extend({ _.extend({
'url': url 'url': url
}, that.preFetchedCollectionLists) }, that.preFetchedCollectionLists, that.sharedObj)
)); ));
} else { } else {
App.rSideNav.currentView.RBusinessCatalogLayoutView.currentView.manualRender("/" + url); App.rSideNav.currentView.RBusinessCatalogLayoutView.currentView.manualRender("/" + url);
...@@ -163,7 +163,7 @@ define([ ...@@ -163,7 +163,7 @@ define([
App.rNHeader.show(new Header()); App.rNHeader.show(new Header());
if (!App.rSideNav.currentView) { if (!App.rSideNav.currentView) {
App.rSideNav.show(new SideNavLayoutView( App.rSideNav.show(new SideNavLayoutView(
_.extend({}, that.preFetchedCollectionLists) _.extend({}, that.preFetchedCollectionLists, that.sharedObj)
)); ));
} else { } else {
App.rSideNav.currentView.selectTab(); App.rSideNav.currentView.selectTab();
...@@ -171,7 +171,7 @@ define([ ...@@ -171,7 +171,7 @@ define([
App.rNContent.show(new DetailPageLayoutView(_.extend({ App.rNContent.show(new DetailPageLayoutView(_.extend({
'collection': this.entityCollection, 'collection': this.entityCollection,
'id': id, 'id': id,
}, that.preFetchedCollectionLists))); }, that.preFetchedCollectionLists, that.sharedObj)));
this.entityCollection.url = UrlLinks.entitiesApiUrl(id); this.entityCollection.url = UrlLinks.entitiesApiUrl(id);
this.entityCollection.fetch({ reset: true }); this.entityCollection.fetch({ reset: true });
}); });
...@@ -201,7 +201,7 @@ define([ ...@@ -201,7 +201,7 @@ define([
App.rSideNav.show(new SideNavLayoutView( App.rSideNav.show(new SideNavLayoutView(
_.extend({ _.extend({
'tag': tagName 'tag': tagName
}, that.preFetchedCollectionLists) }, that.preFetchedCollectionLists, that.sharedObj)
)); ));
} else { } else {
if (paramObj && paramObj.dlttag) { if (paramObj && paramObj.dlttag) {
...@@ -225,7 +225,7 @@ define([ ...@@ -225,7 +225,7 @@ define([
App.rNContent.show(new TagDetailLayoutView( App.rNContent.show(new TagDetailLayoutView(
_.extend({ _.extend({
'tag': tagName 'tag': tagName
}, that.preFetchedCollectionLists) }, that.preFetchedCollectionLists, that.sharedObj)
)); ));
} }
}); });
......
...@@ -289,7 +289,10 @@ define(['require', ...@@ -289,7 +289,10 @@ define(['require',
okAttrFilterButton: function(e) { okAttrFilterButton: function(e) {
var isTag = this.attrModal.tag ? true : false, var isTag = this.attrModal.tag ? true : false,
filtertype = isTag ? 'tagFilters' : 'entityFilters', 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) { if (rule) {
var ruleUrl = CommonViewFunction.attributeFilter.generateUrl(rule.rules); var ruleUrl = CommonViewFunction.attributeFilter.generateUrl(rule.rules);
this.searchTableFilters[filtertype][(isTag ? this.value.tag : this.value.type)] = ruleUrl; this.searchTableFilters[filtertype][(isTag ? this.value.tag : this.value.type)] = ruleUrl;
...@@ -380,7 +383,9 @@ define(['require', ...@@ -380,7 +383,9 @@ define(['require',
this.query[this.type].query = value || null; this.query[this.type].query = value || null;
var params = { var params = {
searchType: this.type, 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; this.query[this.type].type = this.ui.typeLov.select2('val') || null;
if (!this.dsl) { if (!this.dsl) {
...@@ -436,13 +441,15 @@ define(['require', ...@@ -436,13 +441,15 @@ define(['require',
this.updateQueryObject(paramObj); this.updateQueryObject(paramObj);
} }
if (paramObj && this.type == "basic") { 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({ Utils.setUrl({
url: '#!/search/searchResult', url: '#!/search/searchResult',
urlParams: _.extend(this.query[this.type], { urlParams: _.extend(this.query[this.type], {
searchType: this.type, searchType: this.type,
dslChecked: this.ui.searchType.is(':checked') dslChecked: this.ui.searchType.is(':checked'),
includeDE: this.value.includeDE
}), }),
updateTabState: function() { updateTabState: function() {
return { searchUrl: this.url, stateChanged: true }; return { searchUrl: this.url, stateChanged: true };
...@@ -450,13 +457,14 @@ define(['require', ...@@ -450,13 +457,14 @@ define(['require',
mergeBrowserUrl: false, mergeBrowserUrl: false,
trigger: true trigger: true
}); });
}
}, },
clearSearchData: function() { clearSearchData: function() {
this.updateQueryObject(); this.updateQueryObject();
this.ui.typeLov.val("").trigger("change"); this.ui.typeLov.val("").trigger("change");
this.ui.tagLov.val("").trigger("change"); this.ui.tagLov.val("").trigger("change");
this.ui.searchInput.val(""); this.ui.searchInput.val("");
if (this.dsl) { if (!this.dsl) {
this.searchTableFilters.tagFilters = {}; this.searchTableFilters.tagFilters = {};
this.searchTableFilters.entityFilters = {}; 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