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

Evergreen Git git at git.evergreen-ils.org
Thu Mar 7 14:39:06 EST 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  cbfdbd554f1147357c11bf94f0ef34c667c40e9e (commit)
      from  8b0f6581a9d47b738452a8cefc5e50346af0f8cc (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 cbfdbd554f1147357c11bf94f0ef34c667c40e9e
Author: Jane Sandberg <sandbej at linnbenton.edu>
Date:   Fri Mar 1 17:03:31 2019 -0800

    LP1721109: Update item status when holdings are edited
    
    To test:
    1) Go to Item Status List View, select an item, and go to Actions >
    Edit > Items (or Call Numbers, or both).
    2) Make a change to one of the columns you have active in
    the Item Status list view. Click Save and Exit.
    3) Note that the list view of Item Status has not updated.
    4) Load this commit.
    5) Repeat steps 1-2.
    6) Note that the columns are updated this time.  Note that
    there is a new status column, and that an icon appears for
    all the rows that you have changed.  Also, note that there
    is a toast message in the bottom right hand corner of the
    screen confirming that you have successfully made your change.
    
    Signed-off-by: Jane Sandberg <sandbej at linnbenton.edu>
    Signed-off-by: Chris Sharp <csharp at georgialibraries.org>

diff --git a/Open-ILS/src/templates/staff/cat/item/index.tt2 b/Open-ILS/src/templates/staff/cat/item/index.tt2
index 8373049e04..53cf23f778 100644
--- a/Open-ILS/src/templates/staff/cat/item/index.tt2
+++ b/Open-ILS/src/templates/staff/cat/item/index.tt2
@@ -35,7 +35,12 @@
     s.SUCCESS_UPDATE_INVENTORY =
       "[% l('Updated most recent inventory data for selected items.') %]";
     s.FAIL_UPDATE_INVENTORY =
-      "[% l('Failed to update recent inventory data for selected items.')%]"
+      "[% l('Failed to update recent inventory data for selected items.')%]";
+    s.ITEM_SUCCESSFULLY_MODIFIED =
+      "[% l('Item successfully modified') %]";
+    s.ITEMS_SUCCESSFULLY_MODIFIED =
+      "[% l('Item(s) successfully modified') %]";
+
   }])
 </script>
 [% END %]
diff --git a/Open-ILS/src/templates/staff/cat/item/t_list.tt2 b/Open-ILS/src/templates/staff/cat/item/t_list.tt2
index acf90e4a58..c0ac0c25d5 100644
--- a/Open-ILS/src/templates/staff/cat/item/t_list.tt2
+++ b/Open-ILS/src/templates/staff/cat/item/t_list.tt2
@@ -7,6 +7,7 @@
   items-provider="gridDataProvider"
   grid-controls="gridControls"
   persist-key="cat.items"
+  status-column="statusIconColumn"
   dateformat="{{$root.egDateAndTimeFormat}}">
 
   <eg-grid-action handler="add_copies_to_bucket"
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 26f21ba16e..2e98c386f3 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
@@ -290,6 +290,8 @@ function($scope , $q , $window , $location , $timeout , egCore , egNet , egGridD
         copyId = cp_list.split(',');
     }
 
+    var modified_items = new Set();
+
     $scope.context.page = 'list';
 
     /*
@@ -423,6 +425,21 @@ function($scope , $q , $window , $location , $timeout , egCore , egNet , egGridD
         return cp_id_list;
     }
 
+    $scope.refreshGridData = function() {
+        var chain = $q.when();
+        var all_items = itemSvc.copies.map((item) => {return item.id});
+        angular.forEach(all_items.reverse(), function(i) {
+            itemSvc.copies.shift();
+            chain = chain.then(function() {
+                return itemSvc.fetch(null, i);
+            });
+        });
+        return chain.then(function() {
+            copyGrid.refresh();
+        });
+    }
+
+
     $scope.add_copies_to_bucket = function() {
         var copy_list = gatherSelectedHoldingsIds();
         itemSvc.add_copies_to_bucket(copy_list);
@@ -613,6 +630,34 @@ function($scope , $q , $window , $location , $timeout , egCore , egNet , egGridD
         );
     }
 
+    $scope.statusIconColumn = {
+        isEnabled: true,
+        template:  function(item) {
+            var icon = '';
+            if (modified_items.has(item['id'])) {
+                icon = '<span class="glyphicon glyphicon-floppy-saved"' +
+                    'title="' + egCore.strings.ITEM_SUCCESSFULLY_MODIFIED + '" ' +
+                    'aria-label="' + egCore.strings.ITEM_SUCCESSFULLY_MODIFIED + '">' +
+                    '</span>';
+            }
+            return icon
+        }
+    }
+
+    if (typeof BroadcastChannel != 'undefined') {
+        var holdings_bChannel = new BroadcastChannel("eg.holdings.update");
+        holdings_bChannel.onmessage = function(e) {
+            angular.forEach(e.data.copies, function(i) {
+                modified_items.add(i);
+            });
+            ngToast.create(egCore.strings.ITEMS_SUCCESSFULLY_MODIFIED);
+            $scope.refreshGridData();
+        }
+        $scope.$on('$destroy', function() {
+            holdings_bChannel.close();
+        });
+    }
+
 }])
 
 /**

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

Summary of changes:
 Open-ILS/src/templates/staff/cat/item/index.tt2  |  7 +++-
 Open-ILS/src/templates/staff/cat/item/t_list.tt2 |  1 +
 Open-ILS/web/js/ui/default/staff/cat/item/app.js | 45 ++++++++++++++++++++++++
 3 files changed, 52 insertions(+), 1 deletion(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list