LP#1835982: tweak a few of the new GridCellTextGenerator
authorGalen Charlton <gmc@equinoxinitiative.org>
Fri, 3 Jan 2020 16:50:05 +0000 (11:50 -0500)
committerJane Sandberg <sandbej@linnbenton.edu>
Sat, 18 Jan 2020 18:39:48 +0000 (10:39 -0800)
- do not display 'null' for Vandelay import errors and
  holds table current copy barcodes
- trim leading and trailing whitespace from the items table
  call number

Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Jane Sandberg <sandbej@linnbenton.edu>
Open-ILS/src/eg2/src/app/staff/cat/vandelay/queue.component.ts
Open-ILS/src/eg2/src/app/staff/catalog/record/copies.component.ts
Open-ILS/src/eg2/src/app/staff/share/holds/grid.component.ts

index 02d0034..484e456 100644 (file)
@@ -61,7 +61,7 @@ export class QueueComponent implements OnInit, AfterViewInit {
 
         this.cellTextGenerator = {
             '+matches': row => row.matches.length + '',
-            'import_error': row => row.import_error,
+            'import_error': row => (row.import_error == null) ? '' : row.import_error,
             'imported_as': row => row.imported_as + ''
         };
     }
index b713fd6..bfc2b03 100644 (file)
@@ -56,8 +56,8 @@ export class CopiesComponent implements OnInit {
         };
 
         this.cellTextGenerator = {
-            callnumber: row => `${row.call_number_prefix_label} ` +
-                `${row.call_number_label} ${row.call_number_suffix_label}`,
+            callnumber: row => (`${row.call_number_prefix_label} ` +
+                `${row.call_number_label} ${row.call_number_suffix_label}`).trim(),
             holdable: row => this.copyContext.holdable(row),
             barcode: row => row.barcode
         };
index 029883b..666a4f9 100644 (file)
@@ -148,7 +148,7 @@ export class HoldsGridComponent implements OnInit {
         // Text-ify function for cells that use display templates.
         this.cellTextGenerator = {
             title: row => row.title,
-            cp_barcode: row => row.cp_barcode
+            cp_barcode: row => (row.cp_barcode == null) ? '' : row.cp_barcode
         };
     }