[open-ils-commits] [GIT] Evergreen ILS branch rel_3_2 updated. e308297d93c106453c81108dc477f68595b04687

Evergreen Git git at git.evergreen-ils.org
Wed Jan 9 09:35:17 EST 2019


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, rel_3_2 has been updated
       via  e308297d93c106453c81108dc477f68595b04687 (commit)
      from  b649aa200711e0940b822cdc4cbfc20006b816e7 (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 e308297d93c106453c81108dc477f68595b04687
Author: Cesar Velez <cesar.velez at equinoxinitiative.org>
Date:   Fri Dec 7 18:50:43 2018 -0500

    LP1765179 - fix issue with pending/staged user reg
    
    After completing a staged user registration, the controller
    in regctl.js was refreshing to the same route, and
    trying to fetch the same staged user, but never finding it
    as it was no longer staged/pending. This addresses that bug
    and adds a bChannel refresh to the pending grid, so once
    the user is registered in the child tab, it closes the tab and
    the pending user grid is updated.
    
    Signed-off by: Cesar Velez <cesar.velez at equinoxinitiative.org>
    
    Signed-off-by: Jason Etheridge <jason at EquinoxInitiative.org>

diff --git a/Open-ILS/web/js/ui/default/staff/circ/patron/pending.js b/Open-ILS/web/js/ui/default/staff/circ/patron/pending.js
index 0690b3c..0912eb8 100644
--- a/Open-ILS/web/js/ui/default/staff/circ/patron/pending.js
+++ b/Open-ILS/web/js/ui/default/staff/circ/patron/pending.js
@@ -50,6 +50,18 @@ function($scope , $q , $routeParams , $window , $location , egCore , egGridDataP
         provider.refresh();
     }
 
+    if (typeof BroadcastChannel != 'undefined') {
+        // connect 2 bChannel
+        holdings_bChannel = new BroadcastChannel('eg.pending_usr.update');
+        holdings_bChannel.onmessage = function(e){
+            if (e.data && e.data.usr.home_ou == $scope.context_org.id()){
+                // pending usr was registered, refresh grid!
+                console.log("Got broadcast from channel eg.pending_usr.update for usr id: " + e.data.usr.id);
+                refresh_page();
+            }
+        }
+    };
+
     provider.get = function(offset, count) {
         var deferred = $q.defer();
         var recv_index = 0;
diff --git a/Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js b/Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js
index 7599020..35fbfde 100644
--- a/Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js
+++ b/Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js
@@ -1223,10 +1223,10 @@ angular.module('egCoreMod')
 .controller('PatronRegCtrl',
        ['$scope','$routeParams','$q','$uibModal','$window','egCore',
         'patronSvc','patronRegSvc','egUnloadPrompt','egAlertDialog',
-        'egWorkLog',
+        'egWorkLog', '$timeout',
 function($scope , $routeParams , $q , $uibModal , $window , egCore ,
          patronSvc , patronRegSvc , egUnloadPrompt, egAlertDialog ,
-         egWorkLog) {
+         egWorkLog, $timeout) {
 
     $scope.page_data_loaded = false;
     $scope.hold_notify_type = { phone : null, email : null, sms : null };
@@ -2109,6 +2109,19 @@ function($scope , $routeParams , $q , $uibModal , $window , egCore ,
                     + updated_user.id();
                 $window.open(url, '_blank').focus();
 
+            } else if ($window.location.href.indexOf('stage') > -1 ){
+                // we're here after deleting a self-reg staged user.
+                // Just close tab, since refresh won't find staged user
+                $timeout(function(){
+                    if (typeof BroadcastChannel != 'undefined') {
+                        var bChannel = new BroadcastChannel("eg.pending_usr.update");
+                        bChannel.postMessage({
+                            usr: egCore.idl.toHash(updated_user)
+                        });
+                    }
+
+                    $window.close();
+                });
             } else {
                 // reload the current page
                 $window.location.href = location.href;

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

Summary of changes:
 .../web/js/ui/default/staff/circ/patron/pending.js |   12 ++++++++++++
 .../web/js/ui/default/staff/circ/patron/regctl.js  |   17 +++++++++++++++--
 2 files changed, 27 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list