LP1904036 Allow newlines/spaces in long field lists
authorBill Erickson <berickxx@gmail.com>
Tue, 16 Mar 2021 16:10:25 +0000 (12:10 -0400)
committerGalen Charlton <gmc@equinoxOLI.org>
Fri, 28 Oct 2022 00:13:27 +0000 (20:13 -0400)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Jane Sandberg <js7389@princeton.edu>
Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>
Open-ILS/src/eg2/src/app/share/grid/grid.component.ts

index 49a4bec..1bb94e9 100644 (file)
@@ -174,12 +174,17 @@ export class GridComponent implements OnInit, AfterViewInit, OnDestroy {
         this.context.ignoredFields = [];
 
         if (this.showFields) {
+            // Stripping spaces allows users to add newlines to
+            // long lists of field names without consequence.
+            this.showFields = this.showFields.replace(/\s+/g, '');
             this.context.defaultVisibleFields = this.showFields.split(',');
         }
         if (this.hideFields) {
+            this.hideFields = this.hideFields.replace(/\s+/g, '');
             this.context.defaultHiddenFields = this.hideFields.split(',');
         }
         if (this.ignoreFields) {
+            this.ignoreFields = this.ignoreFields.replace(/\s+/g, '');
             this.context.ignoredFields = this.ignoreFields.split(',');
         }