From d1bb45351ebc585a8f2ace174c63810b4e7a26b4 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Thu, 19 May 2022 14:12:20 -0400 Subject: [PATCH] LP#1968082: (follow-up) show progress bar when adding/removing items from bucket Signed-off-by: Galen Charlton --- Open-ILS/web/js/ui/default/staff/cat/bucket/copy/app.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) 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 -- 2.11.0