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

Chore/back nav new #1191

Merged
merged 10 commits into from
Jun 6, 2022
Merged

Chore/back nav new #1191

merged 10 commits into from
Jun 6, 2022

Conversation

PaulDoyle-DEFRA
Copy link
Collaborator

The current solution for controlling back-navigation in the front- and back-office apps uses the same mechanism as forward-navigation: A state-machine-based workflow definition consisting of a set of permitted transitions, many with conditions based on previous navigation choices by the user. This is complex to maintain and unit test. Recent changes to form flows have exacerbated this.

This change aims to simplify the back-navigation mechanism without modifying the user experience. It does this by maintaining an ordered list of previous forms visited, adding to the list as the user progresses through the forms. When the user navigates back, they are brought to the last form in the list, which is then removed from the list.

In the event that there is an invalid entry in the list, that entry will be skipped, so the user could in theory be brought back more than one step in the flow. If no valid entry is found in the list, they will be brought back to the start form. This is assumed to be acceptable as it should only happen in rare cases, e.g. changes to form navigation impacting a transient registration that was created before the deployment of the change and continued afterwards.

Note that the bulk of the changes are for the removal of the existing hard-wired back-navigation unit tests. The key files for the new mechanism are:

@PaulDoyle-DEFRA PaulDoyle-DEFRA added the housekeeping Changes such as refactoring label Jun 1, 2022
@PaulDoyle-DEFRA PaulDoyle-DEFRA marked this pull request as ready for review June 6, 2022 08:46
@Beckyrose200
Copy link
Contributor

Can't see any issues with the tests at all, all looks good :)

@PaulDoyle-DEFRA PaulDoyle-DEFRA merged commit 7aa3d9e into main Jun 6, 2022
@PaulDoyle-DEFRA PaulDoyle-DEFRA deleted the chore/back_nav_new branch June 6, 2022 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
housekeeping Changes such as refactoring
Projects
None yet
3 participants