Skip to content

Commit

Permalink
rm redundant getFilter from base-search-view; add unwrap arg in getFi…
Browse files Browse the repository at this point in the history
…lter re #10804
  • Loading branch information
whatisgalen committed Aug 13, 2024
1 parent fad1310 commit beaa8f7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,6 @@ define([
});
},

getFilter: function(filterName) {
return ko.unwrap(this.searchFilterVms[filterName]);
},

clearQuery: function(){
Object.values(this.searchFilterVms).forEach(function(value){
if (value()){
Expand Down
6 changes: 4 additions & 2 deletions arches/app/media/js/views/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,10 @@ define([
this.searchFilterConfigs = Object.values(SearchComponents);
this.defaultSearchViewConfig = this.searchFilterConfigs.find(filter => filter.type == "search-view");
this.searchViewComponentName = ko.observable(false);
this.getFilter = function(filterName) {
return ko.unwrap(this.searchFilterVms[filterName]);
this.getFilter = function(filterName, unwrap=true) {
if (unwrap)
return ko.unwrap(this.searchFilterVms[filterName]);
return this.searchFilterVms[filterName];
};
this.getFilterByType = function(type, unwrap=true) {
const filter = this.searchFilterConfigs.find(component => component.type == type);
Expand Down

0 comments on commit beaa8f7

Please sign in to comment.