LP#1831788: (follow-up) properly handle case where filter value is 0
authorGalen Charlton <gmc@equinoxinitiative.org>
Wed, 31 Jul 2019 20:15:21 +0000 (16:15 -0400)
committerGalen Charlton <gmc@equinoxinitiative.org>
Thu, 1 Aug 2019 13:49:59 +0000 (09:49 -0400)
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>
Open-ILS/src/eg2/src/app/share/grid/grid-filter-control.component.ts
Open-ILS/src/eg2/src/app/staff/sandbox/sandbox.component.ts

index fbc5918..e6a3652 100644 (file)
@@ -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];
index 163a1cb..a816caf 100644 (file)
@@ -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