[open-ils-commits] [GIT] Evergreen ILS branch rel_3_1 updated. c932d8fdf6bed1e3449d418ee0e6548d70c3ba44

Evergreen Git git at git.evergreen-ils.org
Tue Nov 13 09:53:53 EST 2018


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_1 has been updated
       via  c932d8fdf6bed1e3449d418ee0e6548d70c3ba44 (commit)
       via  808d37022d3080635493432198129a753d51cfa9 (commit)
       via  efd3a536a662c46e61c213c1cb0765015d914246 (commit)
      from  5b8fa44fbda159040a10a1db510ac517449e8e30 (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 c932d8fdf6bed1e3449d418ee0e6548d70c3ba44
Author: Cesar Velez <cesar.velez at equinoxinitiative.org>
Date:   Wed Nov 7 11:09:10 2018 -0500

    LP#1684202 - fix holdings grid refresh... bre_id array always be integers
    
    For some strange reason the volcopy bchannel event data.records
    would be an array of string integers or a array of ints depending
    on whether you're adding or editing holdings. This addresses that
    weirdness.
    
    Signed-off by: Cesar Velez <cesar.velez at equinoxinitiative.org>
    
    Signed-off-by: Chris Sharp <csharp at georgialibraries.org>

diff --git a/Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js b/Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js
index c7150a2..406c0c0 100644
--- a/Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js
+++ b/Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js
@@ -1992,7 +1992,7 @@ function($scope , $q , $window , $routeParams , $location , $timeout , egCore ,
                         $timeout(function(){
                             if (typeof BroadcastChannel != 'undefined') {
                                 var bChannel = new BroadcastChannel("eg.holdings.update");
-                                var bre_ids = cnList && cnList.length > 0 ? cnList.map(function(cn){ return cn.record() }) : [];
+                                var bre_ids = cnList && cnList.length > 0 ? cnList.map(function(cn){ return Number(cn.record()) }) : [];
                                 var cn_ids = cnList && cnList.length > 0 ? cnList.map(function(cn){ return cn.id() }) : [];
                                 bChannel.postMessage({
                                     copies : copy_ids,

commit 808d37022d3080635493432198129a753d51cfa9
Author: Cesar Velez <cesar.velez at equinoxinitiative.org>
Date:   Wed Oct 17 18:06:01 2018 -0400

    LP#1684202 - fix bug the prevented automatic refresh
    
    Turns out that Array.includes() does not do implicit type convertions
    Typical javascript...
    
    Signed-off by: Cesar Velez <cesar.velez at equinoxinitiative.org>
    
    Signed-off-by: Chris Sharp <csharp at georgialibraries.org>

diff --git a/Open-ILS/web/js/ui/default/staff/cat/catalog/app.js b/Open-ILS/web/js/ui/default/staff/cat/catalog/app.js
index 63699d5..891e2ab 100644
--- a/Open-ILS/web/js/ui/default/staff/cat/catalog/app.js
+++ b/Open-ILS/web/js/ui/default/staff/cat/catalog/app.js
@@ -1048,7 +1048,7 @@ function($scope , $routeParams , $location , $window , $q , egCore , egHolds , e
                     if (e.data
                         && e.data.records
                         && e.data.records.length
-                        && e.data.records.includes($scope.record_id)
+                        && e.data.records.includes(Number($scope.record_id))
                     ){ // it's for us, refresh grid!
                         console.log("Got broadcast from channel eg.holdings.update for records " + e.data.records);
                         $scope.holdings_record_id_changed($scope.record_id);

commit efd3a536a662c46e61c213c1cb0765015d914246
Author: Mike Rylander <mrylander at gmail.com>
Date:   Fri Sep 14 11:03:30 2018 -0400

    LP#1684202: Protect against missing features; Make feature more general
    
    I've wrapped the BroadcastChannel code in a test derived from the auth version
    of the same concept.  Also broadcasting the full set of record IDs and the
    pre-update call number IDs for other interfaces that might be interested. The
    channel name is also made more generic and made to follow the precedent from
    the auth channel name.
    
    Signed-off-by: Mike Rylander <mrylander at gmail.com>
    Signed-off-by: Chris Sharp <csharp at georgialibraries.org>

diff --git a/Open-ILS/web/js/ui/default/staff/cat/catalog/app.js b/Open-ILS/web/js/ui/default/staff/cat/catalog/app.js
index fee140e..63699d5 100644
--- a/Open-ILS/web/js/ui/default/staff/cat/catalog/app.js
+++ b/Open-ILS/web/js/ui/default/staff/cat/catalog/app.js
@@ -1034,6 +1034,34 @@ function($scope , $routeParams , $location , $window , $q , egCore , egHolds , e
         });
     }
 
+    var holdings_bChannel = null;
+    // subscribe to BroadcastChannel for any child VolCopy tabs
+    // refresh grid if needed to show new updates
+    // if ($scope.record_tab === 'holdings'){
+    $scope.$watch('record_tab', function(n){
+    
+        if (n === 'holdings'){
+            if (typeof BroadcastChannel != 'undefined') {
+                // we're in holdings tab, connect 2 bChannel
+                holdings_bChannel = new BroadcastChannel('eg.holdings.update');
+                holdings_bChannel.onmessage = function(e){
+                    if (e.data
+                        && e.data.records
+                        && e.data.records.length
+                        && e.data.records.includes($scope.record_id)
+                    ){ // it's for us, refresh grid!
+                        console.log("Got broadcast from channel eg.holdings.update for records " + e.data.records);
+                        $scope.holdings_record_id_changed($scope.record_id);
+                    }
+                }
+            };
+
+        } else if (holdings_bChannel){ // we're leaving holding tab, close bChannel
+            holdings_bChannel.close();
+        }
+    
+    });
+
     // refresh the list of holdings when the record_id is changed.
     $scope.holdings_record_id_changed = function(id) {
         if ($scope.record_id != id) $scope.record_id = id;
diff --git a/Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js b/Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js
index 0928b7c..c7150a2 100644
--- a/Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js
+++ b/Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js
@@ -1989,7 +1989,20 @@ function($scope , $q , $window , $routeParams , $location , $timeout , egCore ,
                             }
                         });
                     } else {
-                        $timeout(function(){$window.close()});
+                        $timeout(function(){
+                            if (typeof BroadcastChannel != 'undefined') {
+                                var bChannel = new BroadcastChannel("eg.holdings.update");
+                                var bre_ids = cnList && cnList.length > 0 ? cnList.map(function(cn){ return cn.record() }) : [];
+                                var cn_ids = cnList && cnList.length > 0 ? cnList.map(function(cn){ return cn.id() }) : [];
+                                bChannel.postMessage({
+                                    copies : copy_ids,
+                                    volumes: cn_ids,
+                                    records: bre_ids
+                                });
+                            }
+
+                            $window.close();
+                        });
                     }
                 }
             });

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

Summary of changes:
 .../web/js/ui/default/staff/cat/catalog/app.js     |   28 ++++++++++++++++++++
 .../web/js/ui/default/staff/cat/volcopy/app.js     |   15 ++++++++++-
 2 files changed, 42 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list