Skip to content

Commit

Permalink
Add custom query to autocomplete options filter
Browse files Browse the repository at this point in the history
  • Loading branch information
MichalKinas committed Nov 8, 2023
1 parent 38580d2 commit 30690b1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export class SearchFilterAutocompleteChipsComponent implements SearchWidget, OnI
if (this.settings.field === AutocompleteField.CATEGORIES) {
queryFragments = this.selectedOptions.map(val => `${this.settings.field}:"workspace://SpacesStore/${val.id}"`);
} else {
queryFragments = this.selectedOptions.map(val => `${this.settings.field}:"${val.value}"`);
queryFragments = this.selectedOptions.map(val => val.query ?? `${this.settings.field}:"${val.value}"`);
}
this.context.queryFragments[this.id] = queryFragments.join(' OR ');
this.context.update();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export interface AutocompleteOption {
value: string;
id?: string;
fullPath?: string;
query?: string;
}

export enum AutocompleteField {
Expand Down

0 comments on commit 30690b1

Please sign in to comment.