From: Mike Rylander Date: Tue, 21 Apr 2020 21:21:41 +0000 (-0400) Subject: Provide exists/does-not-exist (NOT NULL and NULL) operators for acq search fields X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=0fde3263061b3989c24b94ca3492821a9f3988b1;p=working%2FEvergreen.git Provide exists/does-not-exist (NOT NULL and NULL) operators for acq search fields Signed-off-by: Mike Rylander Signed-off-by: Galen Charlton --- diff --git a/Open-ILS/src/eg2/src/app/staff/acq/search/acq-search-form.component.html b/Open-ILS/src/eg2/src/app/staff/acq/search/acq-search-form.component.html index a039578a6a..962a10cc97 100644 --- a/Open-ILS/src/eg2/src/app/staff/acq/search/acq-search-form.component.html +++ b/Open-ILS/src/eg2/src/app/staff/acq/search/acq-search-form.component.html @@ -50,14 +50,18 @@ + +
- - + + + + - +
{ - if (term.value1 === '') { + if (term.value1 === '' && !(term.op === '__isnull' || term.op === '__isnotnull')) { return; } const searchTerm: Object = {}; const recType = term.field.split(':')[0]; const searchField = term.field.split(':')[1]; - if (term.op === '__between') { + if (term.op === '__isnull') { + searchTerm[searchField] = null; + } else if (term.op === '__isnotnull') { + searchTerm[searchField] = { '!=' : null }; + } else if (term.op === '__between') { searchTerm[searchField] = [term.value1, term.value2]; } else { searchTerm[searchField] = term.value1;