From: Galen Charlton <gmc@equinoxinitiative.org>
Date: Wed, 31 Jul 2019 20:15:21 +0000 (-0400)
Subject: LP#1831788: (follow-up) properly handle case where filter value is 0
X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=d0ab509dab731f1f03cd32d05c49256f9cb30ba2;p=contrib%2FConifer.git

LP#1831788: (follow-up) properly handle case where filter value is 0

To test
-------
[1] In the sandbox's copy grid, display the status column and filter
    by the 'Available' status (ccs.id = 0).
[2] Verify that the correct rows are returned.

Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Signed-off-by: Jane Sandberg <sandbej@linnbenton.edu>
---

diff --git a/Open-ILS/src/eg2/src/app/share/grid/grid-filter-control.component.ts b/Open-ILS/src/eg2/src/app/share/grid/grid-filter-control.component.ts
index fbc59186c2..e6a36523dc 100644
--- a/Open-ILS/src/eg2/src/app/share/grid/grid-filter-control.component.ts
+++ b/Open-ILS/src/eg2/src/app/share/grid/grid-filter-control.component.ts
@@ -217,7 +217,8 @@ export class GridFilterControlComponent implements OnInit {
         if (col.filterOperator === undefined) { col.filterOperator = '='; }
 
         if ( (col.filterOperator !== 'null') && (col.filterOperator !== 'not null') &&
-             (!col.filterValue || col.filterValue === '') ) {
+             (!col.filterValue || col.filterValue === '') &&
+             (col.filterValue != '0') ) {
             // if value is empty and we're _not_ checking for null/not null, clear
             // the filter
             delete this.context.dataSource.filters[col.name];
diff --git a/Open-ILS/src/eg2/src/app/staff/sandbox/sandbox.component.ts b/Open-ILS/src/eg2/src/app/staff/sandbox/sandbox.component.ts
index 163a1cb723..a816caffb8 100644
--- a/Open-ILS/src/eg2/src/app/staff/sandbox/sandbox.component.ts
+++ b/Open-ILS/src/eg2/src/app/staff/sandbox/sandbox.component.ts
@@ -186,7 +186,7 @@ export class SandboxComponent implements OnInit {
             return this.pcrud.search('acp',
                 query, {
                 flesh: 1,
-                flesh_fields: {acp: ['location']},
+                flesh_fields: {acp: ['location','status']},
                 offset: pager.offset,
                 limit: pager.limit,
                 order_by: orderBy