LP1904036 Allow newlines/spaces in long field lists
authorBill Erickson <berickxx@gmail.com>
Tue, 16 Mar 2021 16:10:25 +0000 (12:10 -0400)
committerBill Erickson <berickxx@gmail.com>
Thu, 6 Oct 2022 16:51:48 +0000 (12:51 -0400)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
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(',');
         }