LP1904036 Replace barcode disable after first use
authorBill Erickson <berickxx@gmail.com>
Tue, 12 Apr 2022 19:14:13 +0000 (15:14 -0400)
committerGalen Charlton <gmc@equinoxOLI.org>
Fri, 28 Oct 2022 00:13:42 +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/staff/circ/patron/edit.component.html
Open-ILS/src/eg2/src/app/staff/circ/patron/edit.component.ts

index 3d2c868..75fcc9e 100644 (file)
     </ng-container>
     <div class="col-lg-6">
       <ng-container *ngIf="!patron.isnew()">
-        <button class="btn btn-outline-dark" (click)="replaceBarcode()" i18n>
+        <button [disabled]="replaceBarcodeUsed" class="btn btn-outline-dark" 
+          (click)="replaceBarcode()" i18n>
           Replace Barcode
         </button>
         <button class="btn btn-outline-dark ml-2" (click)="barcodesDialog.open()" i18n>
index 4314397..57cf8f9 100644 (file)
@@ -156,6 +156,7 @@ export class EditComponent implements OnInit, AfterViewInit {
     modifiedPatron: IdlObject;
     changeHandlerNeeded = false;
     nameTab = 'primary';
+    replaceBarcodeUsed = false;
 
     // Are we still fetching data and applying values?
     loading = false;
@@ -1658,6 +1659,8 @@ export class EditComponent implements OnInit, AfterViewInit {
     replaceBarcode() {
         // Disable current card
 
+        this.replaceBarcodeUsed = true;
+
         if (this.patron.card()) {
             // patron.card() is not the same in-memory object as its
             // analog in patron.cards().  Since we're about to replace