LP#1642378 Webstaff negative balance UI progress dialog
authorBill Erickson <berickxx@gmail.com>
Fri, 3 Mar 2017 16:42:44 +0000 (11:42 -0500)
committerKathy Lussier <klussier@masslnc.org>
Mon, 6 Mar 2017 22:09:51 +0000 (17:09 -0500)
Display a progress dialog while loading the Patrons With Negative
Balances UI.  Dialog starts indeterminate, morphing into
semi-determinate as patron data streams in.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Open-ILS/web/js/ui/default/staff/admin/local/circ/neg_balance_users.js

index 1697aa7..1386c6c 100644 (file)
@@ -3,14 +3,17 @@ angular.module('egAdminCirc',
     ['ngRoute','ui.bootstrap','egCoreMod','egUiMod','egGridMod'])
 
 .controller('NegBalances',
-       ['$scope','$q','$timeout','$location','$window','egCore','egGridDataProvider',
-function($scope , $q , $timeout , $location , $window , egCore , egGridDataProvider) {
+       ['$scope','$q','$timeout','$location','$window','egCore',
+        'egGridDataProvider','egProgressDialog',
+function($scope , $q , $timeout , $location , $window , egCore , 
+         egGridDataProvider , egProgressDialog) {
 
     $scope.grid_provider = egGridDataProvider.instance({});
 
     // API does not currenlty support paging, so it's all or none.
     $scope.grid_provider.get = function(offset, count) {
         if (!$scope.context_org) return $q.when();
+        egProgressDialog.open();
 
         var deferred = $q.defer();
 
@@ -19,10 +22,11 @@ function($scope , $q , $timeout , $location , $window , egCore , egGridDataProvi
             'open-ils.actor.users.negative_balance',
             egCore.auth.token(), $scope.context_org.id())
         .then(deferred.resolve, null, function(blob) {
+            egProgressDialog.increment();
             // Give the grid a top-level identifier field
             blob.usr_id = blob.usr.id();
             deferred.notify(blob)
-        });
+        }).finally(egProgressDialog.close);
 
         return deferred.promise;
     }