LP#1946531: (follow-up) show progress bar when adding users to bucket
authorGalen Charlton <gmc@equinoxOLI.org>
Thu, 19 May 2022 21:25:52 +0000 (17:25 -0400)
committerJane Sandberg <js7389@princeton.edu>
Thu, 19 May 2022 23:56:08 +0000 (17:56 -0600)
Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>
Signed-off-by: Jane Sandberg <js7389@princeton.edu>

Open-ILS/web/js/ui/default/staff/circ/patron/bucket/app.js

index d0e7c98..a01df57 100644 (file)
@@ -55,9 +55,9 @@ angular.module('egCatUserBuckets',
  */
 .controller('UserBucketCtrl',
        ['$scope','$location','$q','$timeout','$uibModal',
-        '$window','egCore','bucketSvc','ngToast',
+        '$window','egCore','bucketSvc','ngToast','egProgressDialog',
 function($scope,  $location,  $q,  $timeout,  $uibModal,  
-         $window,  egCore,  bucketSvc , ngToast) {
+         $window,  egCore,  bucketSvc , ngToast , egProgressDialog) {
 
     $scope.bucketSvc = bucketSvc;
     $scope.bucket = function() { return bucketSvc.currentBucket }
@@ -84,6 +84,7 @@ function($scope,  $location,  $q,  $timeout,  $uibModal,
         if (recs.length == 0) return;
         bucketSvc.bucketNeedsRefresh = true;
 
+        egProgressDialog.open();
         var ids = recs.map(function(rec) {
             $scope.removeFromPendingList(rec.id);
             return rec.id;
@@ -95,7 +96,9 @@ function($scope,  $location,  $q,  $timeout,  $uibModal,
             egCore.auth.token(), 'user',
             bucketSvc.currentBucket.id(), ids
         ).then(
-            null, // complete
+            function() {
+                egProgressDialog.close();
+            }, // complete
             null, // error
             function(resp) {
                 // HACK: add the IDs of the added items so that the size