[open-ils-commits] [GIT] Evergreen ILS branch rel_3_3 updated. dca8175365b11a2e53d8adf06505d4f7598827bd

Evergreen Git git at git.evergreen-ils.org
Mon Oct 21 09:41:06 EDT 2019


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, rel_3_3 has been updated
       via  dca8175365b11a2e53d8adf06505d4f7598827bd (commit)
      from  0cf35416ac19de66ba0ba87c3659c80a42891c82 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit dca8175365b11a2e53d8adf06505d4f7598827bd
Author: Dan Briem <dbriem at wlsmail.org>
Date:   Sat Aug 10 21:02:00 2019 -0400

    LP#1777698 Duplicate barcode alert appearing on new barcodes
    
    When scanning new copy barcodes, ng-change quickly fires multiple times
    and sends promises to check for duplicates. If 1234 exists and you scan
    12345, if the 1234 promise resolves after 12345, it will indicate it's a
    duplicate. This patch keeps a count of the promises sent and only the
    latest promise will set the boolean to indicate if it's a duplicate.
    
    Hard to test because the promises usually resolve in order:
    1. Add a new holding with the first few characters of an unused barcode
    2. Scan the new barcode multiple times until you see the dup error
    3. Apply patch and scan the new barcode multiple times (no error)
    
    Signed-off-by: Dan Briem <dbriem at wlsmail.org>
    Signed-off-by: Mike Rylander <mrylander at gmail.com>

diff --git a/Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js b/Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js
index 6813258c47..9b5b57e98d 100644
--- a/Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js
+++ b/Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js
@@ -508,6 +508,7 @@ function(egCore , $q) {
                 $scope.empty_barcode = false;
                 $scope.duplicate_barcode_string = window.duplicate_barcode_string;
                 $scope.empty_barcode_string = window.empty_barcode_string;
+                var duplicate_check_count = 0;
 
                 if (!$scope.copy.barcode()) $scope.copy.empty_barcode = true;
 
@@ -524,8 +525,13 @@ function(egCore , $q) {
                     if ($scope.barcode != '') {
                         $scope.copy.empty_barcode = $scope.empty_barcode = false;
                         $scope.barcode_has_error = !Boolean(itemSvc.checkBarcode($scope.barcode));
+
+                        var duplicate_check_id = ++duplicate_check_count;
                         itemSvc.checkDuplicateBarcode($scope.barcode, $scope.copy.id())
-                            .then(function (state) { $scope.copy.duplicate_barcode = $scope.duplicate_barcode = state });
+                            .then(function (state) {
+                                if (duplicate_check_id == duplicate_check_count)
+                                    $scope.copy.duplicate_barcode = $scope.duplicate_barcode = state;
+                            });
                     } else {
                         $scope.copy.empty_barcode = $scope.empty_barcode = true;
                     }

-----------------------------------------------------------------------

Summary of changes:
 Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list