+
+ private removeFilterToSearch (search: string, removedFilter: AdvancedInputFilterChild) {
+ return search.replace(removedFilter.value, '')
+ }
+
+ private addFilterToSearch (search: string, newFilter: AdvancedInputFilterChild) {
+ const prefix = newFilter.value.split(':').shift()
+
+ // Tokenize search and remove a potential existing filter
+ const tokens = this.restService.tokenizeString(search)
+ .filter(t => !t.startsWith(prefix))
+
+ tokens.push(newFilter.value)
+
+ return tokens.join(' ')
+ }
+
+ private parseFilters (search: string) {
+ const tokens = this.restService.tokenizeString(search)
+
+ this.enabledFilters = new Set()
+
+ for (const group of this.filters) {
+ for (const filter of group.children) {
+ if (tokens.includes(filter.value)) {
+ this.enabledFilters.add(filter.value)
+ }
+ }
+ }
+ }