From 84fa277259048e97566e4c56a0662520b8bdf735 Mon Sep 17 00:00:00 2001 From: Joshua Hawxwell Date: Wed, 1 Nov 2023 14:54:19 +0000 Subject: [PATCH] MLPAB-1395 Evidence successfully uploaded page (#814) --- cypress/e2e/donor/payment.cy.js | 5 ++--- .../donor/previous-application-number.cy.js | 6 +++--- .../page/donor/previous_application_number.go | 2 +- .../donor/previous_application_number_test.go | 4 ++-- internal/page/donor/register.go | 6 +++--- internal/page/donor/register_test.go | 4 ++-- internal/page/paths.go | 8 ++++---- lang/cy.json | 7 ++++++- lang/en.json | 9 +++++++-- .../evidence_successfully_uploaded.gohtml | 19 +++++++++++++++++++ web/template/payment_confirmation.gohtml | 6 +++--- web/template/what_happens_after_no_fee.gohtml | 17 ----------------- 12 files changed, 52 insertions(+), 41 deletions(-) create mode 100644 web/template/evidence_successfully_uploaded.gohtml delete mode 100644 web/template/what_happens_after_no_fee.gohtml diff --git a/cypress/e2e/donor/payment.cy.js b/cypress/e2e/donor/payment.cy.js index dc4814a905..4a3e43c608 100644 --- a/cypress/e2e/donor/payment.cy.js +++ b/cypress/e2e/donor/payment.cy.js @@ -132,7 +132,7 @@ describe('Pay for LPA', () => { cy.contains('button', 'Continue').click() - cy.url().should('contain', '/what-happens-after-no-fee'); + cy.url().should('contain', '/evidence-successfully-uploaded'); cy.checkA11yApp(); }) @@ -187,8 +187,7 @@ describe('Pay for LPA', () => { cy.contains('button', 'Continue').click() - // TODO: update once designs for page are finalised - cy.url().should('contain', '/what-happens-after-no-fee'); + cy.url().should('contain', '/evidence-successfully-uploaded'); cy.checkA11yApp(); }) diff --git a/cypress/e2e/donor/previous-application-number.cy.js b/cypress/e2e/donor/previous-application-number.cy.js index 34177b924e..f6a898547e 100644 --- a/cypress/e2e/donor/previous-application-number.cy.js +++ b/cypress/e2e/donor/previous-application-number.cy.js @@ -9,7 +9,7 @@ describe('Previous application number', () => { cy.get('#f-previous-application-number').type('MABC'); cy.contains('button', 'Save and continue').click(); - cy.url().should('contain', '/what-happens-after-no-fee'); + cy.url().should('contain', '/evidence-successfully-uploaded'); }); it('errors when unselected', () => { @@ -27,9 +27,9 @@ describe('Previous application number', () => { cy.contains('button', 'Save and continue').click(); cy.get('.govuk-error-summary').within(() => { - cy.contains('Previous reference number must begin with 7 or M'); + cy.contains('Previous reference number must begin with the number 7 or the letter M'); }); - cy.contains('.govuk-error-message', 'Previous reference number must begin with 7 or M'); + cy.contains('.govuk-error-message', 'Previous reference number must begin with the number 7 or the letter M'); }); }); diff --git a/internal/page/donor/previous_application_number.go b/internal/page/donor/previous_application_number.go index 75795a299d..603de59ccb 100644 --- a/internal/page/donor/previous_application_number.go +++ b/internal/page/donor/previous_application_number.go @@ -39,7 +39,7 @@ func PreviousApplicationNumber(tmpl template.Template, donorStore DonorStore) Ha if lpa.PreviousApplicationNumber[0] == '7' { return appData.Redirect(w, r, lpa, page.Paths.PreviousFee.Format(lpa.ID)) } else { - return appData.Redirect(w, r, lpa, page.Paths.WhatHappensAfterNoFee.Format(lpa.ID)) + return appData.Redirect(w, r, lpa, page.Paths.EvidenceSuccessfullyUploaded.Format(lpa.ID)) } } } diff --git a/internal/page/donor/previous_application_number_test.go b/internal/page/donor/previous_application_number_test.go index 5802711587..627c3f4dc2 100644 --- a/internal/page/donor/previous_application_number_test.go +++ b/internal/page/donor/previous_application_number_test.go @@ -72,7 +72,7 @@ func TestGetPreviousApplicationNumberWhenTemplateErrors(t *testing.T) { func TestPostPreviousApplicationNumber(t *testing.T) { testcases := map[string]page.LpaPath{ "7": page.Paths.PreviousFee, - "M": page.Paths.WhatHappensAfterNoFee, + "M": page.Paths.EvidenceSuccessfullyUploaded, } for start, redirect := range testcases { @@ -125,7 +125,7 @@ func TestPostPreviousApplicationNumberWhenNotChanged(t *testing.T) { assert.Nil(t, err) assert.Equal(t, http.StatusFound, resp.StatusCode) - assert.Equal(t, page.Paths.WhatHappensAfterNoFee.Format("lpa-id"), resp.Header.Get("Location")) + assert.Equal(t, page.Paths.EvidenceSuccessfullyUploaded.Format("lpa-id"), resp.Header.Get("Location")) } func TestPostPreviousApplicationNumberWhenStoreErrors(t *testing.T) { diff --git a/internal/page/donor/register.go b/internal/page/donor/register.go index 162e88499a..8cf0a7e2ab 100644 --- a/internal/page/donor/register.go +++ b/internal/page/donor/register.go @@ -311,8 +311,8 @@ func Register( HowWouldYouLikeToSendEvidence(tmpls.Get("how_would_you_like_to_send_evidence.gohtml"))) handleWithLpa(page.Paths.UploadEvidence, CanGoBack, UploadEvidence(tmpls.Get("upload_evidence.gohtml"), payer, donorStore, random.UuidString, evidenceS3Client)) - handleWithLpa(page.Paths.WhatHappensAfterNoFee, None, - Guidance(tmpls.Get("what_happens_after_no_fee.gohtml"))) + handleWithLpa(page.Paths.EvidenceSuccessfullyUploaded, None, + Guidance(tmpls.Get("evidence_successfully_uploaded.gohtml"))) handleWithLpa(page.Paths.HowToEmailOrPostEvidence, CanGoBack, HowToEmailOrPostEvidence(tmpls.Get("how_to_email_or_post_evidence.gohtml"), payer)) handleWithLpa(page.Paths.FeeDenied, None, @@ -484,7 +484,7 @@ func (p *payHelper) Pay(appData page.AppData, w http.ResponseWriter, r *http.Req return err } - return appData.Redirect(w, r, lpa, page.Paths.WhatHappensAfterNoFee.Format(lpa.ID)) + return appData.Redirect(w, r, lpa, page.Paths.EvidenceSuccessfullyUploaded.Format(lpa.ID)) } createPaymentBody := pay.CreatePaymentBody{ diff --git a/internal/page/donor/register_test.go b/internal/page/donor/register_test.go index 621ec1a2a8..0809d7b52f 100644 --- a/internal/page/donor/register_test.go +++ b/internal/page/donor/register_test.go @@ -473,7 +473,7 @@ func TestPayHelperPayWhenPaymentNotRequired(t *testing.T) { assert.Nil(t, err) assert.Equal(t, http.StatusFound, resp.StatusCode) - assert.Equal(t, page.Paths.WhatHappensAfterNoFee.Format("lpa-id"), resp.Header.Get("Location")) + assert.Equal(t, page.Paths.EvidenceSuccessfullyUploaded.Format("lpa-id"), resp.Header.Get("Location")) }) } } @@ -521,7 +521,7 @@ func TestPayHelperPayWhenMoreEvidenceProvided(t *testing.T) { assert.Nil(t, err) assert.Equal(t, http.StatusFound, resp.StatusCode) - assert.Equal(t, page.Paths.WhatHappensAfterNoFee.Format("lpa-id"), resp.Header.Get("Location")) + assert.Equal(t, page.Paths.EvidenceSuccessfullyUploaded.Format("lpa-id"), resp.Header.Get("Location")) } func TestPayHelperPayNoPaymentRequiredWhenS3ClientError(t *testing.T) { diff --git a/internal/page/paths.go b/internal/page/paths.go index 1b8ff0be02..0debdc4fc3 100644 --- a/internal/page/paths.go +++ b/internal/page/paths.go @@ -135,6 +135,7 @@ type AppPaths struct { EnterTrustCorporation LpaPath EnterTrustCorporationAddress LpaPath EvidenceRequired LpaPath + EvidenceSuccessfullyUploaded LpaPath FeeDenied LpaPath GettingHelpSigning LpaPath HowDoYouKnowYourCertificateProvider LpaPath @@ -157,6 +158,7 @@ type AppPaths struct { NeedHelpSigningConfirmation LpaPath PaymentConfirmation LpaPath PreviousApplicationNumber LpaPath + PreviousFee LpaPath Progress LpaPath ProveYourIdentity LpaPath ReadYourLpa LpaPath @@ -172,8 +174,6 @@ type AppPaths struct { UploadEvidence LpaPath UseExistingAddress LpaPath WhatACertificateProviderDoes LpaPath - WhatHappensAfterNoFee LpaPath - PreviousFee LpaPath WhenCanTheLpaBeUsed LpaPath WhichFeeTypeAreYouApplyingFor LpaPath WithdrawThisLpa LpaPath @@ -268,6 +268,7 @@ var Paths = AppPaths{ EnterTrustCorporation: "/enter-trust-corporation", EnterTrustCorporationAddress: "/enter-trust-corporation-address", EvidenceRequired: "/evidence-required", + EvidenceSuccessfullyUploaded: "/evidence-successfully-uploaded", FeeDenied: "/fee-denied", Fixtures: "/fixtures", GettingHelpSigning: "/getting-help-signing", @@ -295,6 +296,7 @@ var Paths = AppPaths{ NeedHelpSigningConfirmation: "/need-help-signing-confirmation", PaymentConfirmation: "/payment-confirmation", PreviousApplicationNumber: "/previous-application-number", + PreviousFee: "/how-much-did-you-previously-pay-for-your-lpa", Progress: "/progress", ProveYourIdentity: "/prove-your-identity", ReadYourLpa: "/read-your-lpa", @@ -313,8 +315,6 @@ var Paths = AppPaths{ UploadEvidence: "/upload-evidence", UseExistingAddress: "/use-existing-address", WhatACertificateProviderDoes: "/what-a-certificate-provider-does", - WhatHappensAfterNoFee: "/what-happens-after-no-fee", - PreviousFee: "/how-much-did-you-previously-pay-for-your-lpa", WhenCanTheLpaBeUsed: "/when-can-the-lpa-be-used", WhichFeeTypeAreYouApplyingFor: "/which-fee-type-are-you-applying-for", WithdrawThisLpa: "/withdraw-this-lpa", diff --git a/lang/cy.json b/lang/cy.json index 0910fe9da1..75a568013e 100644 --- a/lang/cy.json +++ b/lang/cy.json @@ -918,5 +918,10 @@ "halfFee": "Welsh", "nothingExemption": "Welsh", "nothingHardship": "Welsh", - "howMuchYouPreviouslyPaid": "Welsh" + "howMuchYouPreviouslyPaid": "Welsh", + "evidenceSuccessfullyUploaded": "Welsh", + "weWillReviewYourLpaApplicationAndSupportingEvidence": "

Welsh

", + "applicationNoFee": "welsh", + "applicationHalfFee": "welsh", + "applicationHardshipFee": "welsh" } diff --git a/lang/en.json b/lang/en.json index 46a7309661..41ce42a7ed 100644 --- a/lang/en.json +++ b/lang/en.json @@ -50,7 +50,7 @@ "errorSelect": "Select {{.Label}}", "errorEmail": "{{.Label}} must be in the correct format, like name@example.com", "errorPostcode": "{{.Label}} must be a UK postcode", - "errorReferenceNumber": "{{.Label}} must begin with 7 or M", + "errorReferenceNumber": "{{.Label}} must begin with the number 7 or the letter M", "donorMatchesActorWarning": "The donor’s name is also {{.FirstNames}} {{.LastName}}. The donor cannot be {{.Type}}.", "attorneyMatchesActorWarning": "There is also an attorney called {{.FirstNames}} {{.LastName}}. An attorney cannot be {{.Type}}.", "attorneyMatchesAttorneyWarning": "There is already an attorney called {{.FirstNames}} {{.LastName}}.", @@ -862,5 +862,10 @@ "halfFee": "£41 (half fee)", "nothingExemption": "Nothing - I paid no fee because I got an exemption", "nothingHardship": "Nothing - I paid no fee because I got a hardship fee waiver", - "howMuchYouPreviouslyPaid": "how much you previously paid" + "howMuchYouPreviouslyPaid": "how much you previously paid", + "evidenceSuccessfullyUploaded": "Evidence successfully uploaded", + "weWillReviewYourLpaApplicationAndSupportingEvidence": "

We will review your LPA application and supporting evidence.

What happens next

Sign your LPA

You can still sign your LPA while we’re reviewing your application. Your certificate provider must be there as a witness when you sign it.

However, we will not contact your certificate provider to provide their certificate until your {{.Application}} has been approved.

If your application is successful

Once we have approved your payment, we will contact your certificate provider to provide their certificate.

If your application is not successful

We will contact you if we need more information or if your application is unsuccessful.

Appealing the decision

If your application is unsuccessful, you can appeal within 4 weeks of the decision by writing to the Head of Corporate Services.

If the original decision is upheld, it will be referred to the Public Guardian for confirmation.

", + "applicationNoFee": "application to pay no fee", + "applicationHalfFee": "application to pay a half fee", + "applicationHardshipFee": "hardship application" } diff --git a/web/template/evidence_successfully_uploaded.gohtml b/web/template/evidence_successfully_uploaded.gohtml new file mode 100644 index 0000000000..3d73f9fb4b --- /dev/null +++ b/web/template/evidence_successfully_uploaded.gohtml @@ -0,0 +1,19 @@ +{{ template "page" . }} + +{{ define "pageTitle" }}{{ tr .App "evidenceSuccessfullyUploaded" }}{{ end }} + +{{ define "main" }} +
+
+
+

{{ tr .App "evidenceSuccessfullyUploaded" }}

+
+ + {{ trFormatHtml .App "weWillReviewYourLpaApplicationAndSupportingEvidence" "Application" (printf "application%s" .Lpa.FeeType.String | tr .App) }} + + +
+
+{{ end }} diff --git a/web/template/payment_confirmation.gohtml b/web/template/payment_confirmation.gohtml index a524311291..3d6837b4d7 100644 --- a/web/template/payment_confirmation.gohtml +++ b/web/template/payment_confirmation.gohtml @@ -17,10 +17,10 @@ {{ trHtml .App "paymentConfirmationContent" }} {{ if .FeeType.IsHalfFee }} - {{ trHtml .App "halfFeeNextSteps" }} + {{ tr .App "continue" }} + {{ else }} + {{ tr .App "continue" }} {{ end }} - - {{ tr .App "continue" }} {{ end }} diff --git a/web/template/what_happens_after_no_fee.gohtml b/web/template/what_happens_after_no_fee.gohtml deleted file mode 100644 index f3b0524df1..0000000000 --- a/web/template/what_happens_after_no_fee.gohtml +++ /dev/null @@ -1,17 +0,0 @@ -{{ template "page" . }} - -{{ define "pageTitle" }}{{ tr .App "whatHappensAfterNoFee" }}{{ end }} - -{{ define "main" }} -
-
-

{{ tr .App "whatHappensAfterNoFee" }}

- - {{ trHtml .App "whatHappensAfterNoFeeContent" }} - - -
-
-{{ end }}