FIX: simplifies updating searchedTerms from connectors (#10674)

This commit is contained in:
Joffrey JAFFEUX 2020-09-15 11:21:38 +02:00 committed by GitHub
parent 324aa3eb61
commit 53e281a3fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View File

@ -412,6 +412,12 @@ export default Component.extend({
this.updateInRegex(REGEXP_SPECIAL_IN_TITLE_MATCH, "title");
},
@action
onChangeSearchedTermField(path, updateFnName, value) {
this.set(`searchedTerms.${path}`, value);
this[updateFnName]();
},
_updateSearchTermForTags() {
const match = this.filterBlocks(REGEXP_TAGS_PREFIX);
const tagFilter = this.get("searchedTerms.tags");

View File

@ -1,4 +1,4 @@
{{plugin-outlet name="advanced-search-options-above" args=(hash searchedTerms=searchedTerms) tagName=""}}
{{plugin-outlet name="advanced-search-options-above" args=(hash searchedTerms=searchedTerms onChangeSearchedTermField=onChangeSearchedTermField) tagName=""}}
<div class="container advanced-search-posted-by-group">
<div class="control-group pull-left">
@ -162,4 +162,4 @@
</div>
</div>
{{plugin-outlet name="advanced-search-options-below" args=(hash searchedTerms=searchedTerms) tagName=""}}
{{plugin-outlet name="advanced-search-options-below" args=(hash searchedTerms=searchedTerms onChangeSearchedTermField=onChangeSearchedTermField) tagName=""}}