From d1ea5bc27b6b0cc67fd3d99561da5dc69178cf18 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Thu, 19 Sep 2019 16:14:06 -0400 Subject: [PATCH] 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 --- .../src/app/staff/catalog/search-form.component.html | 7 +++++-- .../eg2/src/app/staff/catalog/search-form.component.ts | 10 ++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) 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'; + } + } + } } -- 2.43.2