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=064ef0cd796d9195ec6533765230ac8ce4e5fbde;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 d032f3d08f..37132fdb87 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 @@ -27,6 +27,7 @@ TODO focus search input
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 84dd830538..e7478a159f 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 @@ -239,6 +239,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'; + } + } + } }