[open-ils-commits] [GIT] Evergreen ILS branch master updated. dba71f8017e2d6ff351c9ef6210972e9dcca2c56

Evergreen Git git at git.evergreen-ils.org
Wed Oct 4 12:02:33 EDT 2017


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, master has been updated
       via  dba71f8017e2d6ff351c9ef6210972e9dcca2c56 (commit)
      from  75b242b233ba1f084ff8c74d87f75cc1cc301ee6 (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 dba71f8017e2d6ff351c9ef6210972e9dcca2c56
Author: Bill Erickson <berickxx at gmail.com>
Date:   Wed Sep 27 11:30:47 2017 -0400

    LP#1717007 Improve egProgressDialog collision handling
    
    Resolves a race condition where egProgressDialog.open() is called twice
    before the first call completes (i.e. the dialog is opened), leaving 2
    open dialogs, one of which cannot be closed because its reference is
    lost.
    
    Going forward, attempts to open multiple dialogs will always result in
    the most recently visible dialog taking preference.  When collisions
    occur, a warning is also issued to the console.
    
    Signed-off-by: Bill Erickson <berickxx at gmail.com>
    Signed-off-by: Cesar Velez <cesar.velez at equinoxinitiative.org>
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>

diff --git a/Open-ILS/web/js/ui/default/staff/services/ui.js b/Open-ILS/web/js/ui/default/staff/services/ui.js
index 0c385fa..b33358f 100644
--- a/Open-ILS/web/js/ui/default/staff/services/ui.js
+++ b/Open-ILS/web/js/ui/default/staff/services/ui.js
@@ -310,26 +310,32 @@ function($timeout , $parse) {
     var service = {};
 
     service.open = function(args) {
-        service.close(); // force-kill existing instances.
-
-        // Reset to an indeterminate progress bar, 
-        // overlay with caller values.
-        egProgressData.reset();
-        service.update(angular.extend({}, args));
-
         return $uibModal.open({
             templateUrl: './share/t_progress_dialog',
             controller: ['$scope','$uibModalInstance','egProgressData',
                 function( $scope , $uibModalInstance , egProgressData) {
-                  service.currentInstance = $uibModalInstance;
-                  $scope.data = egProgressData; // tiny service
+                    // Once the new modal instance is available, force-
+                    // kill any other instances
+                    service.close(true); 
+
+                    // Reset to an indeterminate progress bar, 
+                    // overlay with caller values.
+                    egProgressData.reset();
+                    service.update(angular.extend({}, args));
+
+                    service.currentInstance = $uibModalInstance;
+                    $scope.data = egProgressData; // tiny service
                 }
             ]
         });
     };
 
-    service.close = function() {
+    service.close = function(warn) {
         if (service.currentInstance) {
+            if (warn) {
+                console.warn("egProgressDialog replacing existing instance. "
+                    + "Only one may be open at a time.");
+            }
             service.currentInstance.close();
             delete service.currentInstance;
         }

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

Summary of changes:
 Open-ILS/web/js/ui/default/staff/services/ui.js |   26 ++++++++++++++--------
 1 files changed, 16 insertions(+), 10 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list