jenkins-bot has submitted this change and it was merged.

Change subject: Reuse common error display code
......................................................................


Reuse common error display code

This surfaces server errors in the iDEAL forms.

Plus some js lint

Bug: T92567
Change-Id: Id9ab41f4060be4e592c62ab17abc2f4c7366f0a6
---
M globalcollect_gateway/forms/html/rtbt/rtbt-ideal-noadd.html
M globalcollect_gateway/forms/html/rtbt/rtbt-ideal.html
M globalcollect_gateway/forms/js/webitects2nd.js
3 files changed, 13 insertions(+), 43 deletions(-)

Approvals:
  Ejegg: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/globalcollect_gateway/forms/html/rtbt/rtbt-ideal-noadd.html 
b/globalcollect_gateway/forms/html/rtbt/rtbt-ideal-noadd.html
index 23217cd..f73d55e 100644
--- a/globalcollect_gateway/forms/html/rtbt/rtbt-ideal-noadd.html
+++ b/globalcollect_gateway/forms/html/rtbt/rtbt-ideal-noadd.html
@@ -40,6 +40,9 @@
                                <div id="donate">
                                        <div id="donate-content">
                                                <div id="donate-body" 
style="padding: 0 1em;">
+                                                       @noscript
+                                                       <p id="topError" 
class="errorMsg"></p>
+
                                                        <form method="post" 
name="paypalcontribution">
                                                                <div 
id="step1header"><h3>%donate_interface-amount-legend% <span 
id="selected-amount"></span> <span class="mute" id="change-amount" 
style="display: none;">(<a 
href="#">%donate_interface-change%</a>)</span></h3></div>
                                                                <div 
id="step1wrapper" style="display: none;">
diff --git a/globalcollect_gateway/forms/html/rtbt/rtbt-ideal.html 
b/globalcollect_gateway/forms/html/rtbt/rtbt-ideal.html
index b6b1ce3..c735fab 100644
--- a/globalcollect_gateway/forms/html/rtbt/rtbt-ideal.html
+++ b/globalcollect_gateway/forms/html/rtbt/rtbt-ideal.html
@@ -40,6 +40,9 @@
                                <div id="donate">
                                        <div id="donate-content">
                                                <div id="donate-body" 
style="padding: 0 1em;">
+                                                       @noscript
+                                                       <p id="topError" 
class="errorMsg"></p>
+
                                                        <form method="post" 
name="paypalcontribution">
                                                                <div 
id="step1header"><h3>%donate_interface-amount-legend% <span 
id="selected-amount"></span> <span class="mute" id="change-amount" 
style="display: none;">(<a 
href="#">%donate_interface-change%</a>)</span></h3></div>
                                                                <div 
id="step1wrapper" style="display: none;">
diff --git a/globalcollect_gateway/forms/js/webitects2nd.js 
b/globalcollect_gateway/forms/js/webitects2nd.js
index fa1ef82..5d3c644 100644
--- a/globalcollect_gateway/forms/js/webitects2nd.js
+++ b/globalcollect_gateway/forms/js/webitects2nd.js
@@ -1,52 +1,16 @@
-/*global validateAmount:true, setAmount:true, showAmount:true, 
amountErrors:true, billingErrors:true, paymentErrors:true, actionURL:true, 
validate_personal: true, displayCreditCardForm:true*/
+/*global validateAmount:true, setAmount:true, showAmount:true, actionURL:true, 
validate_personal: true, displayCreditCardForm:true*/
 /*exported setAmount*/
 $( document ).ready( function () {
+
+       var amount,
+               matched,
+               otherAmount,
+               previousAmount;
 
        $( '#step2header' ).show();
        $( '#step2wrapper' ).show();
 
-       // check for RapidHtml errors and display, if any
-       var temp, e, f, g, prevError, previousAmount, matched, amount, 
otherAmount,
-               amountErrorString = '',
-               billingErrorString = '',
-               paymentErrorString = '';
-
-       // generate formatted errors to display
-       temp = [];
-       for ( e in amountErrors ) {
-               if ( amountErrors[ e ] !== '' ) {
-                       temp[ temp.length ] = amountErrors[ e ];
-               }
-       }
-       amountErrorString = temp.join( '<br />' );
-
-       temp = [];
-       for ( f in billingErrors ) {
-               if ( billingErrors[ f ] !== '' ) {
-                       temp[ temp.length ] = billingErrors[ f ];
-               }
-       }
-       billingErrorString = temp.join( '<br />' );
-
-       temp = [];
-       for ( g in paymentErrors ) {
-               if ( paymentErrors[ g ] !== '' ) {
-                       temp[ temp.length ] = paymentErrors[ g ];
-               }
-       }
-       paymentErrorString = temp.join( '<br />' );
-
-       // show the errors
-       prevError = false;
-       if ( amountErrorString !== '' ) {
-               $( '#amtErrorMessages' ).html( amountErrorString );
-       }
-       if ( billingErrorString !== '' ) {
-               $( '#billingErrorMessages' ).html( billingErrorString );
-       }
-       if ( paymentErrorString !== '' ) {
-               $( '#paymentErrorMessages' ).html( paymentErrorString );
-       }
+       window.displayErrors();
 
        $( '#paymentContinueBtn' ).on( 'click', function () {
                if ( validate_personal( document.paypalcontribution ) && 
validateAmount() ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/282001
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Id9ab41f4060be4e592c62ab17abc2f4c7366f0a6
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/DonationInterface
Gerrit-Branch: master
Gerrit-Owner: Awight <[email protected]>
Gerrit-Reviewer: AndyRussG <[email protected]>
Gerrit-Reviewer: Awight <[email protected]>
Gerrit-Reviewer: Cdentinger <[email protected]>
Gerrit-Reviewer: Ejegg <[email protected]>
Gerrit-Reviewer: Ssmith <[email protected]>
Gerrit-Reviewer: XenoRyet <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to