[open-ils-commits] [GIT] Evergreen ILS branch rel_3_2 updated. 70d2bf25ce47a230d378940b14986f7d76e71a71

Evergreen Git git at git.evergreen-ils.org
Tue Jul 30 19:35:03 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_2 has been updated
       via  70d2bf25ce47a230d378940b14986f7d76e71a71 (commit)
      from  fb7f84b910cc751fea35cb5c8248bd5176ca2c83 (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 70d2bf25ce47a230d378940b14986f7d76e71a71
Author: Josh Stompro <stompro at stompro.org>
Date:   Wed Feb 27 15:07:43 2019 -0600

    LP#1798187 - Support CRLF and LF format for item status import files
    
    Testing Plan:
    
    Before patch, try to import a file in CRLF end of line format that includes
    leading and trailing spaces, empty lines, lines of just spaces or
    barcodes with spaces.  The import will fail to load those items and will
    stop processing when it hits certain situations.
    
    After patch, try to import a file in CRLF EOL format that includes barcodes
    with trailing spaces, leading spaces, barcodes with spaces, and/or
    empty lines.  The import will load all barcodes.
    
    Signed-off-by: Josh Stompro <stompro at stompro.org>
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
    Signed-off-by: Jane Sandberg <sandbej at linnbenton.edu>

diff --git a/Open-ILS/src/templates/staff/cat/item/index.tt2 b/Open-ILS/src/templates/staff/cat/item/index.tt2
index 53cf23f778..c77ced848a 100644
--- a/Open-ILS/src/templates/staff/cat/item/index.tt2
+++ b/Open-ILS/src/templates/staff/cat/item/index.tt2
@@ -76,6 +76,7 @@
           <input type="file" eg-file-reader 
             container="barcodesFromFile" value="[% l('Upload from File') %]">
         </div>
+        <eg-help-popover help-text="[% l('File Format: One barcode per line. All whitespace and commas will be removed before processing.') %]">
       </div>
     </div>
     <div class="flex-cell"></div><!-- force the final divs to the right -->
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 fc3e823dfa..af59baf45b 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
@@ -325,10 +325,14 @@ function($scope , $q , $window , $location , $timeout , egCore , egNet , egGridD
             $scope.args.barcode = '';
             var barcodes = [];
 
-            angular.forEach(newVal.split(/\n/), function(line) {
+            angular.forEach(newVal.split(/\r?\n/), function(line) {
+                //remove all whitespace and commas
+                line = line.replace(/[\s,]+/g,'');
+
+                //Or remove leading/trailing whitespace
+                //line = line.replace(/(^[\s,]+|[\s,]+$/g,'');
+
                 if (!line) return;
-                // scrub any trailing spaces or commas from the barcode
-                line = line.replace(/(.*?)($|\s.*|,.*)/,'$1');
                 barcodes.push(line);
             });
 
@@ -337,10 +341,12 @@ function($scope , $q , $window , $location , $timeout , egCore , egNet , egGridD
                 var barcode = barcodes.pop();
                 egProgressDialog.increment();
 
-                if (!barcode) { // All done here.
+                if (barcode == undefined) { // All done here.
                     egProgressDialog.close();
                     copyGrid.refresh();
-                    copyGrid.selectItems([itemSvc.copies[0].index]);
+                    if(itemSvc.copies[0]){  // Were any copies actually retrieved
+                        copyGrid.selectItems([itemSvc.copies[0].index]);
+                    }
                     return;
                 }
 

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

Summary of changes:
 Open-ILS/src/templates/staff/cat/item/index.tt2  |  1 +
 Open-ILS/web/js/ui/default/staff/cat/item/app.js | 16 +++++++++++-----
 2 files changed, 12 insertions(+), 5 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list