LP # 1814966: No popup warning for invalid barcode
authorJessica Woolford <jwoolford@biblio.org>
Tue, 13 Dec 2022 19:41:44 +0000 (14:41 -0500)
committerChris Sharp <csharp@georgialibraries.org>
Mon, 9 Jan 2023 15:38:38 +0000 (10:38 -0500)
Adds a check for an invalid barcode if "Use Checkdigit" is selected.
Prevents saving if the check fails.

Signed-off-by: Jessica Woolford <jwoolford@biblio.org>
Open-ILS/src/eg2/src/app/staff/cat/volcopy/vol-edit.component.html

index 0e9142d..6f2b0d0 100644 (file)
               placeholder="New Barcode..." i18n-placeholder
               [disabled]="volcopy.copyStatIsMagic(copyNode.target.status())"
               [ngClass]="{
-                'text-danger': copyNode.target._dupe_barcode,
+                'text-danger': copyNode.target._dupe_barcode || copyNode.target._bad_barcode,
                 'invalid': !copyNode.target.barcode() && !copyNode.target.isnew()
               }"
               (change)="barcodeChanged(copyNode.target, $event.target.value)"  
             class="alert alert-danger font-italic p-1" i18n>
             Duplicate Barcode
           </div>
+          <div *ngIf="copyNode.target._bad_barcode"
+          class="alert alert-danger font-italic p-1" i18n>
+          Invalid Barcode
+        </div>  
         </div>
         <div class="p-1" [ngStyle]="{flex: flexAt(9)}">
           <ng-container *ngIf="displayColumn('copy_number_vc')">