From aa2fb3ebb77dbf4c8270014d6747d71fce881733 Mon Sep 17 00:00:00 2001 From: Barney Laurance Date: Mon, 25 Nov 2024 17:26:29 +0000 Subject: [PATCH 1/3] Fix BG2-2772: Donation not possible when navigating form without using continue buttons --- .../donation-start-form/donation-start-form.component.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/app/donation-start/donation-start-form/donation-start-form.component.ts b/src/app/donation-start/donation-start-form/donation-start-form.component.ts index cf05596dc..bff30493f 100644 --- a/src/app/donation-start/donation-start-form/donation-start-form.component.ts +++ b/src/app/donation-start/donation-start-form/donation-start-form.component.ts @@ -671,6 +671,10 @@ export class DonationStartFormComponent implements AfterContentChecked, AfterCon return; } + if (!this.donation && (this.idCaptchaCode || this.donor) && this.donationAmount > 0) { + this.createDonationAndMaybePerson(); + } + // We need to allow enough time for the Stepper's animation to get the window to // its final position for this step, before this scroll position update can be reliably // helpful. @@ -1185,10 +1189,6 @@ export class DonationStartFormComponent implements AfterContentChecked, AfterCon return; } - if (!this.donation && (this.idCaptchaCode || this.donor) && this.donationAmount > 0) { - this.createDonationAndMaybePerson(); - } - this.next(); } From b53bd76471a05e93398e88d1da762268c8f3656f Mon Sep 17 00:00:00 2001 From: Barney Laurance Date: Mon, 25 Nov 2024 17:29:32 +0000 Subject: [PATCH 2/3] BG2-2722: Adjust copy for payment method failure. Bug I just fixed was nothing to do with captcha, I think having a message here about captcha leads to confusion so changing --- .../donation-start-form/donation-start-form.component.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/donation-start/donation-start-form/donation-start-form.component.html b/src/app/donation-start/donation-start-form/donation-start-form.component.html index a77cc99cc..9bdedacdb 100644 --- a/src/app/donation-start/donation-start-form/donation-start-form.component.html +++ b/src/app/donation-start/donation-start-form/donation-start-form.component.html @@ -402,7 +402,8 @@

How does Big Give u @if (!donor) {
-

Payment fields require the "captcha" puzzle to be solved before we can show them safely.

+

Sorry, there was an error showing the payment field. Please try again or + contact us if the problem persists.

}
From d1c32831024537c692c7582fac01f3fbc3e10811 Mon Sep 17 00:00:00 2001 From: Barney Laurance Date: Mon, 25 Nov 2024 17:46:51 +0000 Subject: [PATCH 3/3] BG2-2722: Fix click event listener on stepper headers instead of moving function that it was supposed to call I.e. move the content of `progressToNonAmountsStep` back to where it was. --- .../donation-start-form.component.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/app/donation-start/donation-start-form/donation-start-form.component.ts b/src/app/donation-start/donation-start-form/donation-start-form.component.ts index bff30493f..fdec3e892 100644 --- a/src/app/donation-start/donation-start-form/donation-start-form.component.ts +++ b/src/app/donation-start/donation-start-form/donation-start-form.component.ts @@ -584,11 +584,13 @@ export class DonationStartFormComponent implements AfterContentChecked, AfterCon const stepperHeaders = stepper.getElementsByClassName('mat-step-header'); for (const stepperHeader of stepperHeaders) { stepperHeader.addEventListener('click', (clickEvent: any) => { - if (clickEvent.target.index > 0) { + if (this.stepper.selectedIndex > 0) { this.progressToNonAmountsStep(); // Handles amount error if needed, like Continue button does. return; } + // usages of clickEvent.target may be wrong - wouldn't type check if we typed clickEvent as PointerEvent + // instead of Any. But not changing right now as could create regression and doesn't relate to any known bug. if (clickEvent.target.innerText.includes('Your details') && this.stepper.selected?.label === 'Gift Aid') { this.triedToLeaveGiftAid = true; } @@ -671,10 +673,6 @@ export class DonationStartFormComponent implements AfterContentChecked, AfterCon return; } - if (!this.donation && (this.idCaptchaCode || this.donor) && this.donationAmount > 0) { - this.createDonationAndMaybePerson(); - } - // We need to allow enough time for the Stepper's animation to get the window to // its final position for this step, before this scroll position update can be reliably // helpful. @@ -1189,6 +1187,10 @@ export class DonationStartFormComponent implements AfterContentChecked, AfterCon return; } + if (!this.donation && (this.idCaptchaCode || this.donor) && this.donationAmount > 0) { + this.createDonationAndMaybePerson(); + } + this.next(); }