Skip to content

Move exit pages to condition - #3006

Merged
thomasiles merged 12 commits into
mainfrom
move-exit-pages-to-condition
Aug 6, 2026
Merged

Move exit pages to condition#3006
thomasiles merged 12 commits into
mainfrom
move-exit-pages-to-condition

Conversation

@thomasiles

@thomasiles thomasiles commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Move the existing exit page controllers and input objects out the way

Trello card: https://trello.com/c/gecvdskV/3173-change-add-edit-delete-exit-page-to-work-with-multiple-branches

We are changing how exit pages are created, updated and deleted for the multiple branch feature.

We can't delete the existing exit pages code because they are still being used in production until we switch to multiple branch routing.

To add the new exit page routes for multiple branches we need to move the existing code out of the way. We are moving it instead of adapting it because there are differences in the new implementation, such as not depending on conditions.

When the new routes for exit pages have been added and the multiple branches feature is released, we will be able to remove the exit page code under conditions.

This PR shouldn't create any difference in how the product behaves. It's a code refactor to make implementing exit pages for multiple branches easier.

Details

This is split into commits. The main changes are moving the controller under Condition, instead of Page and moving input objects.

The URLs for exit pages don't change but the path helpers have. We go through the code and tests to update them to the new values.

To move the input objects, we need to change the locales to match and check the controllers expect the correct params. Both depend on the name of the input object.

Whilst this PR is big, most of the changes are just altering the names of things.

Things to consider when reviewing

  • Ensure that you consider the wider context.
  • Does it work when run on your machine?
  • Is it clear what the code is doing?
  • Do the commit messages explain why the changes were made?
  • Are there all the unit tests needed?
  • Do the end to end tests need updating before these changes will pass?
  • Has all relevant documentation been updated?

We still want to use the name exit page for new code using the new
ExitPage mode. The existing routes won't be used, as they are tied to
conditions and the condition id.

In the new model, exit pages rely on page id instead.

To allow us to create the new routes, controller and views, we moved the
existing exit page controller to be under the Condition namespace.

We could have left in under page and used a different name. I think it
would get confusing though, so we move it.
Also change path helpers to match the new route structure.
@thomasiles
thomasiles marked this pull request as ready for review August 5, 2026 15:06
lfdebrux
lfdebrux previously approved these changes Aug 6, 2026

@lfdebrux lfdebrux left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Changes makes sense to me, and work on my machine

@lfdebrux
lfdebrux dismissed their stale review August 6, 2026 11:06

Just spotted a missing translation

Comment thread app/views/conditions/exit_page/edit.html.erb Outdated
Comment thread app/views/conditions/exit_page/new.html.erb Outdated
Ensure the correct translations are being called from views.

Co-authored-by: Laurence de Bruxelles <laurence.debruxelles@digital.cabinet-office.gov.uk>

@lfdebrux lfdebrux left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Another hidden issue, sorry

Comment thread app/views/pages/conditions/confirm_delete_exit_page.html.erb Outdated
Comment thread app/controllers/pages/conditions_controller.rb Outdated
Comment thread spec/requests/pages/conditions_controller_spec.rb Outdated
thomasiles and others added 2 commits August 6, 2026 12:59
Co-authored-by: Laurence de Bruxelles <laurence.debruxelles@digital.cabinet-office.gov.uk>
When changing a condition from an exit_page we need to use the correct path.

Co-authored-by: Laurence de Bruxelles <laurence.debruxelles@digital.cabinet-office.gov.uk>
@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown

🎉 A review copy of this PR has been deployed! You can reach it at: https://pr-3006.admin.review.forms.service.gov.uk/

It may take 5 minutes or so for the application to be fully deployed and working. If it still isn't ready
after 5 minutes, there may be something wrong with the ECS task. You will need to go to the integration AWS account
to debug, or otherwise ask an infrastructure person.

For the sign in details and more information, see the review apps wiki page.

@thomasiles
thomasiles added this pull request to the merge queue Aug 6, 2026
Merged via the queue into main with commit 9b2feda Aug 6, 2026
3 checks passed
@thomasiles
thomasiles deleted the move-exit-pages-to-condition branch August 6, 2026 13:09
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