Skip to content

Display multiple branches on add/edit page#2744

Open
SamJamCul wants to merge 1 commit intomainfrom
multiple-branches-questions-page
Open

Display multiple branches on add/edit page#2744
SamJamCul wants to merge 1 commit intomainfrom
multiple-branches-questions-page

Conversation

@SamJamCul
Copy link
Copy Markdown
Contributor

This is based on the Group's multiple_branches_enabled feature flag - so if this is toggled off, then it will use the original add and edit page view.

When the flag is turned on for the group, the display logic assumes that the form has been created using the new Routes process, and will not be particularly compatible with forms that have been created using the old routing pages (although it might work if the routing is relatively simple).

There is no validation displayed for these changes, as we're not ready to start deciding how to validate the new multiple-branch routes.

I've removed the edit links for now, we'll need to add them in once we've got the questions listed out on the routes page, as they should be anchored links.

What problem does this pull request solve?

https://trello.com/c/IgUz33Ml/3070-make-edit-questions-list-display-with-new-routes

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?

@SamJamCul SamJamCul force-pushed the multiple-branches-questions-page branch 2 times, most recently from ab7d922 to b8da23b Compare April 30, 2026 14:31
This is based on the Group's multiple_branches_enabled feature flag - so
if this is toggled off, then it will use the original add and edit page
view.

When the flag is turned on for the group, the display logic assumes that
the form has been created using the new Routes process, and will not be
particularly compatible with forms that have been created using the old
routing pages (although it might work if the routing is relatively
simple).

There is no validation displayed for these changes, as we're not ready
to start deciding how to validate the new multiple-branch routes.
@SamJamCul SamJamCul force-pushed the multiple-branches-questions-page branch from b8da23b to 1562c70 Compare April 30, 2026 15:34
@github-actions
Copy link
Copy Markdown

🎉 A review copy of this PR has been deployed! You can reach it at: https://pr-2744.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.

<% condition_page = self.condition_page(condition) %>
<% condition_page_position = self.condition_page_position(condition) %>
<div id="<%= PageListComponent::ErrorSummary::View.error_id(condition.id) %>" class="govuk-summary-list__row app-page-list__row <%= class_names( "govuk-form-group--error": condition.has_routing_errors?) %>">
<% if @form.group.multiple_branches_enabled? && page.routing_conditions.present? %>
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.

I'd suggest using the feature service to check whether the feature is enabled, rather than looking at the form record directly.

Suggested change
<% if @form.group.multiple_branches_enabled? && page.routing_conditions.present? %>
<% if FeatureService.new(@form.group).enabled?(:multiple_branches) && page.routing_conditions.present? %>

Then in the tests whether the flag is enabled or not can be changed by mocking the feature service with the helpers in spec/support/features.rb, removing the need to add a group to the form in each test.

<div id="<%= PageListComponent::ErrorSummary::View.error_id(condition.id) %>" class="govuk-summary-list__row app-page-list__row <%= class_names( "govuk-form-group--error": condition.has_routing_errors?) %>">
<% if @form.group.multiple_branches_enabled? && page.routing_conditions.present? %>
<div class="govuk-summary-list__row">
<dt class="govuk-summary-list__key govuk-summary-list__key app-page-list__key">
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.

Suggested change
<dt class="govuk-summary-list__key govuk-summary-list__key app-page-list__key">
<dt class="govuk-summary-list__key app-page-list__key">

end
end

def branch_condition_description(condition)
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.

What about calling this condition_description2 or something like that? branch_condition_description sounds to me like it's only for branch conditions.

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