From: Galen Charlton Date: Thu, 23 Jan 2020 15:24:44 +0000 (-0500) Subject: set default search operator for acqlia fields to "contains" X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=57a4cff3579539fc8320e4e2d7b403403e76c2ee;p=working%2FEvergreen.git set default search operator for acqlia fields to "contains" Signed-off-by: Galen Charlton --- diff --git a/Open-ILS/src/eg2/src/app/staff/acq/search/acq-search-form.component.ts b/Open-ILS/src/eg2/src/app/staff/acq/search/acq-search-form.component.ts index cc7d08ed72..5125c065ad 100644 --- a/Open-ILS/src/eg2/src/app/staff/acq/search/acq-search-form.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/acq/search/acq-search-form.component.ts @@ -113,6 +113,14 @@ export class AcqSearchFormComponent implements OnInit, AfterViewInit { term.value1 = ''; term.value2 = ''; term.is_date = false; + + if (term.field.startsWith('acqlia:') && term.op === '') { + // default operator for line item attributes should be "contains" + term.op = '__fuzzy'; + } else if (this.searchTermDatatypes[term.field] !== 'text' && term.op.endsWith('__fuzzy')) { + // avoid trying to use the "contains" operator for non-text fields + term.op = ''; + } } // conditionally clear the search term after changing // to selected search operators