From: Bill Erickson Date: Thu, 19 Sep 2019 20:14:06 +0000 (-0400) Subject: LP1819236 Ang cat prevent keyword starts/exact searches X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=d1ea5bc27b6b0cc67fd3d99561da5dc69178cf18;p=working%2FEvergreen.git LP1819236 Ang cat prevent keyword starts/exact searches Prevent users from attempting Keyword starts-with or matches-exactly searches since these are nonsensical. Signed-off-by: Bill Erickson Signed-off-by: Ruth Frasur --- diff --git a/Open-ILS/src/eg2/src/app/staff/catalog/search-form.component.html b/Open-ILS/src/eg2/src/app/staff/catalog/search-form.component.html index f5d2e50fb0..920b008074 100644 --- a/Open-ILS/src/eg2/src/app/staff/catalog/search-form.component.html +++ b/Open-ILS/src/eg2/src/app/staff/catalog/search-form.component.html @@ -35,6 +35,7 @@
diff --git a/Open-ILS/src/eg2/src/app/staff/catalog/search-form.component.ts b/Open-ILS/src/eg2/src/app/staff/catalog/search-form.component.ts index 357f7be493..043adb0ed1 100644 --- a/Open-ILS/src/eg2/src/app/staff/catalog/search-form.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/catalog/search-form.component.ts @@ -269,6 +269,16 @@ export class SearchFormComponent implements OnInit, AfterViewInit { searchIsActive(): boolean { return this.context.searchState === CatalogSearchState.SEARCHING; } + + // It's possible to chose invalid combos depending on the order of selection + preventBogusCombos(idx: number) { + if (this.context.termSearch.fieldClass[idx] === 'keyword') { + const op = this.context.termSearch.matchOp[idx]; + if (op === 'exact' || op === 'starts') { + this.context.termSearch.matchOp[idx] = 'contains'; + } + } + } }