[open-ils-commits] [GIT] Evergreen ILS branch rel_3_0 updated. f0d2a0a57ee4d9cd8d0fa019b9a08763e8da2392

Evergreen Git git at git.evergreen-ils.org
Tue Feb 20 13:06:55 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_0 has been updated
       via  f0d2a0a57ee4d9cd8d0fa019b9a08763e8da2392 (commit)
      from  31f93434a98993fb8839f7ed568712b6a51dac0e (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 f0d2a0a57ee4d9cd8d0fa019b9a08763e8da2392
Author: Dan Wells <dbw2 at calvin.edu>
Date:   Tue Feb 20 11:05:49 2018 -0500

    LP#1749992 Disable payment button during payment
    
    Since the display is not refreshed until the payment finishes, it
    is possible to fire off a second payment by double-clicking.
    
    This commit is a simple way to disable the button while a payment is
    in process, then enable it again after the display refreshes.
    
    Since the 'sendPayment()' function is wrapped, we may need to move
    this logic up, but this being a single promise is simpler, and it
    solved the problem in testing.
    
    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
    Signed-off-by: Jason Stephenson <jason at sigio.com>

diff --git a/Open-ILS/src/templates/staff/circ/patron/t_bills.tt2 b/Open-ILS/src/templates/staff/circ/patron/t_bills.tt2
index c3fda5c..835e1bf 100644
--- a/Open-ILS/src/templates/staff/circ/patron/t_bills.tt2
+++ b/Open-ILS/src/templates/staff/circ/patron/t_bills.tt2
@@ -87,7 +87,7 @@
             <button
                 type="submit"
                 class="btn btn-default"
-                ng-disabled="invalid_check_number() || !gridControls.selectedItems().length"
+                ng-disabled="invalid_check_number() || !gridControls.selectedItems().length || applyingPayment"
             >[% l('Apply Payment') %]</button>
           </div>
         </div>
diff --git a/Open-ILS/web/js/ui/default/staff/circ/patron/bills.js b/Open-ILS/web/js/ui/default/staff/circ/patron/bills.js
index 05c2326..24d2e54 100644
--- a/Open-ILS/web/js/ui/default/staff/circ/patron/bills.js
+++ b/Open-ILS/web/js/ui/default/staff/circ/patron/bills.js
@@ -325,6 +325,7 @@ function($scope , $q , $routeParams , egCore , egConfirmDialog , $location,
     // generates payments, collects user note if needed, and sends payment
     // to server.
     function sendPayment(note, cc_args) {
+        $scope.applyingPayment = true;
         var make_payments = generatePayments();
         billSvc.applyPayment($scope.payment_type, 
             make_payments, note, $scope.check_number, cc_args)
@@ -342,6 +343,7 @@ function($scope , $q , $routeParams , egCore , egConfirmDialog , $location,
                 console.error('Payment was rejected: ' + msg);
             }
         )
+        .finally(function() { $scope.applyingPayment = false; })
     }
 
     $scope.onReceiptOnPayChanged = function(){

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

Summary of changes:
 .../src/templates/staff/circ/patron/t_bills.tt2    |    2 +-
 .../web/js/ui/default/staff/circ/patron/bills.js   |    2 ++
 2 files changed, 3 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list