fixes to 'not contains' operator
authorGalen Charlton <gmc@equinoxinitiative.org>
Wed, 8 Jul 2020 22:34:14 +0000 (18:34 -0400)
committerGalen Charlton <gmc@equinoxinitiative.org>
Wed, 8 Jul 2020 22:34:14 +0000 (18:34 -0400)
- now works in the main search form
- now available for vendor and user searches

Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Open-ILS/src/eg2/src/app/staff/acq/search/acq-search-form.component.html
Open-ILS/src/eg2/src/app/staff/acq/search/acq-search.service.ts

index 8b60c70..4d478a4 100644 (file)
@@ -46,7 +46,7 @@
         <option i18n value="">is</option>
         <option i18n value="__not">is NOT</option>
         <option i18n value="__fuzzy" [hidden]="searchTermDatatypes[t.field] != 'text' && searchFieldLinkedClasses[t.field] !== 'acqpro' && searchFieldLinkedClasses[t.field] !== 'au'">contains</option>
-        <option i18n value="__not,__fuzzy" [hidden]="searchTermDatatypes[t.field] != 'text'">does NOT contain</option>
+        <option i18n value="__not,__fuzzy" [hidden]="searchTermDatatypes[t.field] != 'text' && searchFieldLinkedClasses[t.field] !== 'acqpro' && searchFieldLinkedClasses[t.field] !== 'au'">does NOT contain</option>
         <option i18n value="__starts" [hidden]="searchTermDatatypes[t.field] != 'text'">STARTS with</option>
         <option i18n value="__ends" [hidden]="searchTermDatatypes[t.field] != 'text'">ENDS with</option>
         <option i18n value="__lte" [hidden]="searchTermDatatypes[t.field] != 'timestamp' && !dateLikeSearchFields[t.field]">is on or BEFORE</option>
index 860c1d5..32ad107 100644 (file)
@@ -163,7 +163,12 @@ export class AcqSearchService {
                 searchTerm[searchField] = term.value1;
             }
             if (term.op !== '') {
-                searchTerm[term.op] = true;
+                if (term.op === '__not,__fuzzy') {
+                    searchTerm['__not'] = true;
+                    searchTerm['__fuzzy'] = true;
+                } else {
+                    searchTerm[term.op] = true;
+                }
             }
             if (term.is_date) {
                 searchTerm['__castdate'] = true;