[open-ils-commits] [GIT] Evergreen ILS branch rel_3_4 updated. 064ef0cd796d9195ec6533765230ac8ce4e5fbde

Evergreen Git git at git.evergreen-ils.org
Fri Feb 21 11:49:37 EST 2020


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, rel_3_4 has been updated
       via  064ef0cd796d9195ec6533765230ac8ce4e5fbde (commit)
      from  effec3e2a44c94e696c8996ec30d29a893df940b (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 064ef0cd796d9195ec6533765230ac8ce4e5fbde
Author: Bill Erickson <berickxx at gmail.com>
Date:   Thu Sep 19 16:14:06 2019 -0400

    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 <berickxx at gmail.com>
    Signed-off-by: Ruth Frasur <rfrasur at gmail.com>

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
             </div>
             <div class="col-lg-2 pl-0 pr-2">
               <select class="form-control" 
+                (change)="preventBogusCombos(idx)"
                 [(ngModel)]="context.termSearch.fieldClass[idx]">
                 <option i18n value='keyword'>Keyword</option>
                 <option i18n value='title'>Title</option>
@@ -42,8 +43,10 @@ TODO focus search input
                 <option i18n value='contains'>Contains</option>
                 <option i18n value='nocontains'>Does not contain</option>
                 <option i18n value='phrase'>Contains phrase</option>
-                <option i18n value='exact'>Matches exactly</option>
-                <option i18n value='starts'>Starts with</option>
+                <option [disabled]="context.termSearch.fieldClass[idx]=='keyword'"
+                  i18n value='exact'>Matches exactly</option>
+                <option [disabled]="context.termSearch.fieldClass[idx]=='keyword'"
+                  i18n value='starts'>Starts with</option>
               </select>
             </div>
             <div class="col-lg-4 pl-0 pr-2">
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';
+            }
+        }
+    }
 }
 
 

-----------------------------------------------------------------------

Summary of changes:
 .../src/eg2/src/app/staff/catalog/search-form.component.html   |  7 +++++--
 .../src/eg2/src/app/staff/catalog/search-form.component.ts     | 10 ++++++++++
 2 files changed, 15 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list