From be7feca36466c1df7e44cafb08a87186bc834b4b Mon Sep 17 00:00:00 2001
From: Galen Charlton <gmc@equinoxinitiative.org>
Date: Fri, 3 Jan 2020 11:50:05 -0500
Subject: [PATCH] LP#1835982: tweak a few of the new GridCellTextGenerator

- 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    | 2 +-
 Open-ILS/src/eg2/src/app/staff/catalog/record/copies.component.ts | 4 ++--
 Open-ILS/src/eg2/src/app/staff/share/holds/grid.component.ts      | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/Open-ILS/src/eg2/src/app/staff/cat/vandelay/queue.component.ts b/Open-ILS/src/eg2/src/app/staff/cat/vandelay/queue.component.ts
index 02d0034421..484e456633 100644
--- a/Open-ILS/src/eg2/src/app/staff/cat/vandelay/queue.component.ts
+++ b/Open-ILS/src/eg2/src/app/staff/cat/vandelay/queue.component.ts
@@ -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 + ''
         };
     }
diff --git a/Open-ILS/src/eg2/src/app/staff/catalog/record/copies.component.ts b/Open-ILS/src/eg2/src/app/staff/catalog/record/copies.component.ts
index b713fd6801..bfc2b03107 100644
--- a/Open-ILS/src/eg2/src/app/staff/catalog/record/copies.component.ts
+++ b/Open-ILS/src/eg2/src/app/staff/catalog/record/copies.component.ts
@@ -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
         };
diff --git a/Open-ILS/src/eg2/src/app/staff/share/holds/grid.component.ts b/Open-ILS/src/eg2/src/app/staff/share/holds/grid.component.ts
index 029883b3b0..666a4f9329 100644
--- a/Open-ILS/src/eg2/src/app/staff/share/holds/grid.component.ts
+++ b/Open-ILS/src/eg2/src/app/staff/share/holds/grid.component.ts
@@ -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
         };
     }
 
-- 
2.11.0