department-of-veterans-affairs / va.gov-team

Public resources for building on and in support of VA.gov. Visit complete Knowledge Hub:
https://depo-platform-documentation.scrollhelp.site/index.html
283 stars 204 forks source link

When user hits "back" to the rep-selection page, resurface their original query (same session only) #93054

Closed oddball-lindsay closed 1 month ago

oddball-lindsay commented 1 month ago

Background

What happens when a user hits "Back" on contact-representative?

The team discussed and decided...

If the user hits "Back" in the same session:

  1. The selected representative is null-ed out
  2. The user can see the query they just entered
    1. We'll cache the user's rep query on the frontend to support this
  3. The user will need to select a rep (same or a new one) to move back to contact-representative
    1. If the user tries to "Continue" we will throw the validation error

If an authenticated user leaves the form experience and revisits the representative-selection page later via the "Back" button, they will see the default flow:

  1. The selected representative is nullified
  2. The user will need to reenter their query (we will be unable to preserve because this is a new session)
  3. The user will need to select a rep (same or a new one) to move back to contact-representative
    1. If the user tries to "Continue" we will throw the validation error

Tasks

Acceptance Criteria

cosu419 commented 1 month ago

This is ready for review @mtri

mtri commented 1 month ago

QA ticket: https://github.com/department-of-veterans-affairs/va.gov-team/issues/93957