From: Galen Charlton Date: Thu, 19 May 2022 18:12:20 +0000 (-0400) Subject: LP#1968082: (follow-up) show progress bar when adding/removing items from bucket X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=80f4dede70e311720da4318501edc315271f5a1c;p=Evergreen.git LP#1968082: (follow-up) show progress bar when adding/removing items from bucket Signed-off-by: Galen Charlton --- diff --git a/Open-ILS/web/js/ui/default/staff/cat/bucket/copy/app.js b/Open-ILS/web/js/ui/default/staff/cat/bucket/copy/app.js index 442c3a1ac6..d7712c160d 100644 --- a/Open-ILS/web/js/ui/default/staff/cat/bucket/copy/app.js +++ b/Open-ILS/web/js/ui/default/staff/cat/bucket/copy/app.js @@ -234,9 +234,9 @@ angular.module('egCatCopyBuckets', */ .controller('CopyBucketCtrl', ['$scope','$location','$q','$timeout','$uibModal', - '$window','egCore','bucketSvc', + '$window','egCore','bucketSvc','egProgressDialog', function($scope, $location, $q, $timeout, $uibModal, - $window, egCore, bucketSvc) { + $window, egCore, bucketSvc , egProgressDialog) { $scope.bucketSvc = bucketSvc; $scope.bucket = function() { return bucketSvc.currentBucket } @@ -265,13 +265,17 @@ function($scope, $location, $q, $timeout, $uibModal, var ids = recs.map(function(rec) { return rec.id; }); + egProgressDialog.open(); + egCore.net.request( 'open-ils.actor', 'open-ils.actor.container.item.create.batch', egCore.auth.token(), 'copy', 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 @@ -548,13 +552,17 @@ function($scope, $q , $routeParams , $timeout , $window , $uibModal , bucketSvc bucketSvc.bucketNeedsRefresh = true; var ids = copies.map(function(rec) { return rec.id; }); + + egProgressDialog.open(); return egCore.net.request( 'open-ils.actor', 'open-ils.actor.container.item.delete.batch', egCore.auth.token(), 'copy', bucketSvc.currentBucket.id(), ids ).then( - null, // complete + function() { + egProgressDialog.close(); + }, // complete null, // error function(resp) { // Remove the items as the API responds so the UI can show