Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CN-754: Fix issue with Contact Form back links #1221

Merged
merged 1 commit into from
Nov 22, 2023

Conversation

gtvj
Copy link
Contributor

@gtvj gtvj commented Nov 15, 2023

What?

Fixes Contact Forms "Back" links issues that have emerged since the Triage Page was introduced.

Why (and how)?

The changes to make "Back" links work are quite involved (much less straightforward than I'd anticipated), so I've tried to set out all the relevant context. Let me know if you'd like me to talk you through it - I'd be very happy to.

How the Triage Page works has complicated "Back" links

The programme introducing a Triage Page that sits outside the di-authentication-frontend repository has introduced some complexity for determining the correct destination for "Back" links presented to users presented to users in the Contact Forms. Significant contributors to this are that:

  1. there are Triage Pages for most, but not all, our environments
  2. the Triage Page includes a single link to the Contact Forms that does include a fromURL parameter and may include a theme=id_check_app parameter.

Where the theme=id_check_app parameter exists, we route the user to Contact Form options specific to the ID Check App. The logic to achieve the necessary redirect is in a new contactUsGetFromTriagePage controller method.

The new prepareBackLink() function

A new prepareBackLink() function has been created to:

  1. return an appropriate "Back" link based on the value of req.path (logic described below)
  2. append the fromURL and theme parameter, where applicable.

Because prepareBackLink() inspects req.path and changes the destination of "Back" links, it has been necessary to update existing tests to accommodate this.

Back link on /contact-us

The "Back" link on /contact-us goes to the destination returned by getSupportLinkUrl() which returns the url_for_support_links environment variable (set to the corresponding Triage Page in all environments)

Dynamic back link on /contact-us-further-information

Because users visiting /contact-us-further-information may have come direct from the Triage Page, the "Back" link on /contact-us-further-information needs to be dynamic, taking users to:

  1. the Triage Page if we can infer the user bypassed /contact-us (which we can do by checking for the existence of both a fromURL and a theme=id_check_app parameter)
  2. /contact-us in all other cases

Back link on /contact-us-questions

The "Back link on /contact-us-questions goes to /contact-us-further-information

Other cases

If none of the conditions are met, prepareBackLink() defaults to returning /contact-us

Change have been demonstrated

Changes to the user interface or content should be demonstrated to Content Design and Interaction Design before being merged. This is to ensure they can make any necessary changes to Figma.

  • Changes to the user interface have been demonstrated

Note: while this PR does not change the UI, it does have potential to impact user journeys, so it has been shown to UCD colleagues.

Performance Analysis have been informed of the change

  • Performance Analysis have been informed of the change

Related PRs

Please include links to PRs in other repositories relevant to this PR.
Delete this section if not needed.

@gtvj gtvj requested review from a team as code owners November 15, 2023 18:24
@gtvj gtvj force-pushed the CN-754/fix-issue-with-back-links branch 3 times, most recently from d02c87b to aef9455 Compare November 16, 2023 12:10
@gtvj gtvj force-pushed the CN-754/fix-issue-with-back-links branch from aef9455 to 1b2ef87 Compare November 16, 2023 12:14
Copy link
Contributor

@BeckaL BeckaL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks sensible to me

@gtvj gtvj merged commit c6d3e6c into main Nov 22, 2023
3 checks passed
@gtvj gtvj deleted the CN-754/fix-issue-with-back-links branch November 22, 2023 11:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants