[open-ils-commits] [GIT] Evergreen ILS branch rel_2_11 updated. 45f3a75b182a58546db5edacdd622b45973adb2c

Evergreen Git git at git.evergreen-ils.org
Tue Mar 14 10:40:37 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, rel_2_11 has been updated
       via  45f3a75b182a58546db5edacdd622b45973adb2c (commit)
      from  81d53a8ba69e47d0addbe4586272451f3fdce9d7 (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 45f3a75b182a58546db5edacdd622b45973adb2c
Author: Jason Etheridge <jason at esilibrary.com>
Date:   Wed Nov 2 14:28:08 2016 -0400

    lp1261835 stop colliding bill UI refreshes
    
    for want of promises in Angular :)
    
    population of the bill list in this implementation is asynchronous, but the rest
    of the refresh action is not, and it's sadly being invoked multiple times. There
    are different ways to fix this, but using a semaphore seems to work.
    
    Signed-off-by: Jason Etheridge <jason at esilibrary.com>
    Signed-off-by: Dawn Dale <ddale at georgialibraries.org>
    Signed-off-by: Kathy Lussier <klussier at masslnc.org>

diff --git a/Open-ILS/xul/staff_client/server/patron/bill2.js b/Open-ILS/xul/staff_client/server/patron/bill2.js
index 8e7764b..91c0ad0 100644
--- a/Open-ILS/xul/staff_client/server/patron/bill2.js
+++ b/Open-ILS/xul/staff_client/server/patron/bill2.js
@@ -20,6 +20,8 @@ function my_init() {
 
         g.funcs = []; g.bill_map = {}; g.row_map = {}; g.check_map = {};
 
+        g.safe_for_refresh = false;
+
         g.patron_id = xul_param('patron_id');
 
         $('circulating_hint').hidden = true;
@@ -63,6 +65,8 @@ function my_init() {
             );
         }
 
+        g.funcs.push( function() { g.safe_for_refresh = true; } );
+
     } catch(E) {
         var err_msg = $("commonStrings").getFormattedString('common.exception', ['patron/bill2.xul', E]);
         try { g.error.sdump('D_ERROR',err_msg); } catch(E) { dump(err_msg); }
@@ -522,11 +526,12 @@ function retrieve_mbts_for_list() {
     } else {
    
         g.mbts_ids.reverse();
- 
+        g.safe_for_refresh = false;
         for (var i = 0; i < g.mbts_ids.length; i++) {
             dump('i = ' + i + ' g.mbts_ids[i] = ' + g.mbts_ids[i] + '\n');
             g.funcs.push( gen_list_append_func(g.mbts_ids[i]) );
         }
+        g.funcs.push( function() { g.safe_for_refresh = true; } );
     }
 }
 
@@ -1107,14 +1112,16 @@ function pay(payment_blob) {
 
 function refresh(params) {
     try {
-        if (params && params.clear_voided_summary) {
-            g.data.voided_billings = []; g.data.stash('voided_billings');
+        if (g.safe_for_refresh) {
+            if (params && params.clear_voided_summary) {
+                g.data.voided_billings = []; g.data.stash('voided_billings');
+            }
+            refresh_patron();
+            g.bill_list.clear();
+            retrieve_mbts_for_list();
+            tally_voided();
+            distribute_payment();
         }
-        refresh_patron();
-        g.bill_list.clear();
-        retrieve_mbts_for_list();
-        tally_voided();
-        distribute_payment(); 
     } catch(E) {
         alert('Error in bill2.js, refresh(): ' + E);
     }

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

Summary of changes:
 Open-ILS/xul/staff_client/server/patron/bill2.js |   23 ++++++++++++++-------
 1 files changed, 15 insertions(+), 8 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list