From 3d0819bcdcadcc941e2166b3157c1331dc5a8707 Mon Sep 17 00:00:00 2001 From: Jane Sandberg Date: Mon, 19 Aug 2019 12:43:33 -0700 Subject: [PATCH] LP1739288: report back on invalid barcodes in Item Status screen To test: 1) Make a text file with both valid and invalid item barcodes. 2) Go to Circulation > Item Status and upload your file. 3) Note that the valid barcodes result in rows in the item status screen, and the invalid barcodes are not displayed anywhere. 4) Apply this commit. 5) Repeat step 2. 6) Notice that the invalid barcodes are now reported in a new alert. 7) Make a text file with only valid barcodes and upload it. 8) Upload it. Notice that the alert disappears. Signed-off-by: Jane Sandberg Signed-off-by: Josh Stompro LP1739288: Add a summary report to the list of bad barcodes. Signed-off-by: Jane Sandberg Signed-off-by: Josh Stompro Signed-off-by: Rogan Hamby --- Open-ILS/src/templates/staff/cat/item/index.tt2 | 21 +++++++++++++++++++++ Open-ILS/web/js/ui/default/staff/cat/item/app.js | 12 +++++++++++- 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/templates/staff/cat/item/index.tt2 b/Open-ILS/src/templates/staff/cat/item/index.tt2 index 9cb8be84b7..51c014da0d 100644 --- a/Open-ILS/src/templates/staff/cat/item/index.tt2 +++ b/Open-ILS/src/templates/staff/cat/item/index.tt2 @@ -149,6 +149,27 @@ +
+
+ +
+
+ +
+
+
[% END %] diff --git a/Open-ILS/web/js/ui/default/staff/cat/item/app.js b/Open-ILS/web/js/ui/default/staff/cat/item/app.js index 52d2d021fa..5f0b01aa85 100644 --- a/Open-ILS/web/js/ui/default/staff/cat/item/app.js +++ b/Open-ILS/web/js/ui/default/staff/cat/item/app.js @@ -359,6 +359,9 @@ function($scope , $q , $window , $location , $timeout , egCore , egNet , egGridD }; $scope.$watch('barcodesFromFile', function(newVal, oldVal) { + $scope.context.itemsNotFound = []; + $scope.context.fileDoneLoading = false; + $scope.context.numBarcodesInFile = 0; if (newVal && newVal != oldVal) { $scope.args.barcode = ''; var barcodes = []; @@ -385,13 +388,20 @@ function($scope , $q , $window , $location , $timeout , egCore , egNet , egGridD if(itemSvc.copies[0]){ // Were any copies actually retrieved copyGrid.selectItems([itemSvc.copies[0].index]); } + $scope.context.fileDoneLoading = true; return; } - itemSvc.fetch(barcode).then(fetch_next_copy); + itemSvc.fetch(barcode).then(function(item) { + if (!item) { + $scope.context.itemsNotFound.push(barcode); + } + fetch_next_copy(); + }) } if (barcodes.length) { + $scope.context.numBarcodesInFile = barcodes.length; egProgressDialog.open({value: 0, max: barcodes.length}); fetch_next_copy(); } -- 2.11.0