LP1888723 Angular holdings trims barcode spaces
authorBill Erickson <berickxx@gmail.com>
Tue, 18 Aug 2020 20:35:02 +0000 (16:35 -0400)
committerGalen Charlton <gmc@equinoxOLI.org>
Sun, 15 Aug 2021 23:54:59 +0000 (19:54 -0400)
The barcode input form trims leading and trailing spaces from barcodes
in the Angular holdings editor.

Spaces in the middle of the barcode are not removed.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Ruth Frasur <rfrasur@library.in.gov>
Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>
Open-ILS/src/eg2/src/app/staff/cat/volcopy/vol-edit.component.ts

index c8aa4d0..0d0b4ce 100644 (file)
@@ -361,7 +361,13 @@ export class VolEditComponent implements OnInit {
     }
 
     barcodeChanged(copy: IdlObject, barcode: string) {
-        // note: copy.barcode(barcode) applied via ngModel
+
+        if (barcode) {
+            // Scrub leading/trailing spaces from barcodes
+            barcode = barcode.trim();
+            copy.barcode(barcode);
+        }
+
         copy.ischanged(true);
         copy._dupe_barcode = false;