LP1936233 Item status indicate item not found
authorBill Erickson <berickxx@gmail.com>
Thu, 5 Aug 2021 18:01:30 +0000 (14:01 -0400)
committerBill Erickson <berickxx@gmail.com>
Mon, 24 Oct 2022 15:08:20 +0000 (11:08 -0400)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/eg2/src/app/staff/cat/item/status.component.html
Open-ILS/src/eg2/src/app/staff/cat/item/status.component.ts

index 2d074fa..b9b50c8 100644 (file)
@@ -35,7 +35,6 @@
         <span class="input-group-text" id='barcode-label' i18n>Barcode</span>
       </div>
       <input type="text" class="form-control" id="item-barcode-input" 
-        (keydown)="noSuchItem=false; true;"
         (keyup.enter)="getItemFromBarcodeInput()" [(ngModel)]="itemBarcode" 
         aria-describedby="barcode-label"/>
     </div>
   </div>
 </div>
 
+<div class="row" *ngIf="noSuchItem">
+  <div class="col-lg-6 offset-lg-3 alert alert-danger" i18n>
+    Item not found: <b>{{noSuchItem}}</b>
+  </div>
+</div>
+
+
 <ng-template #callNumberTemplate let-r="row">
   {{r.call_number().prefix().label()}}
   {{r.call_number().label()}}
index 12997ff..1965f33 100644 (file)
@@ -66,7 +66,7 @@ export class ItemStatusComponent implements OnInit, AfterViewInit {
 
     currentItemId: number;
     itemBarcode: string;
-    noSuchItem = false;
+    noSuchItem: string = null;
     item: IdlObject;
     tab: string;
     preloadCopyIds: number[];
@@ -305,11 +305,13 @@ export class ItemStatusComponent implements OnInit, AfterViewInit {
             if (bc) { barcodes.push(bc); }
         });
 
-        return this.getItemsFromBarcodes(barcodes);
+        return this.getItemsFromBarcodes(barcodes)
+        .then(_ => this.selectInput());
     }
 
     getItemsFromBarcodes(barcodes: string[]): Promise<any> {
         let index = 0;
+        this.noSuchItem = null;
 
         return from(barcodes).pipe(concatMap(bc => {
 
@@ -339,7 +341,7 @@ export class ItemStatusComponent implements OnInit, AfterViewInit {
             if (!res) {
                 // Dialog was canceled, nothing to do
             } else if (!res.id) {
-                this.noSuchItem = true;
+                this.noSuchItem = barcode;
             } else {
                 this.itemBarcode = null;
                 if (this.tab === 'list') {