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

Change name of default route/secondary skip route to "any other answer" #1762

Merged
merged 1 commit into from
Feb 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions app/presenters/route_summary_card_data_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def initialize(form:, pages:, page:, routes:)

def summary_card_data
conditional_cards = conditional_route_cards
conditional_cards + [default_route_card(conditional_cards.length + 1)]
conditional_cards + [default_route_card]
end

private
Expand Down Expand Up @@ -55,7 +55,7 @@ def conditional_route_card(routing_condition, index)
}
end

def default_route_card(index)
def default_route_card
continue_to_name = page.has_next_page? ? page_name(page.next_page) : end_page_name

actions = if FeatureService.new(group: form.group).enabled?(:branch_routing) && secondary_skip
Expand All @@ -69,7 +69,7 @@ def default_route_card(index)

{
card: {
title: I18n.t("page_route_card.route_title", index:),
title: I18n.t("page_route_card.any_other_answer"),
classes: "app-summary-card",
actions:,
},
Expand Down
3 changes: 1 addition & 2 deletions app/views/pages/secondary_skip/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
<% content_for :heading do %>
<h1 class="govuk-heading-l">
<span class="govuk-caption-l"><%= t("secondary_skip.new.caption", page_position: secondary_skip_input.page.position) %></span>
<%= t("page_titles.new_secondary_skip", route_index: 2) %>
<%# TODO: route_index is hardcoded as 2 here because we know there are only two conditions. It will need to change in the future %>
<%= t("page_titles.new_secondary_skip") %>
</h1>
<% end %>

Expand Down
7 changes: 4 additions & 3 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ en:
pages/delete_secondary_skip_input:
attributes:
confirm:
blank: Select ‘Yes’ to delete route 2
blank: Select ‘Yes’ to delete the route
pages/question_input:
attributes:
hint_text:
Expand Down Expand Up @@ -1052,6 +1052,7 @@ en:
none_of_the_above: None of the above
only_one_option: Selection from a list, one option only
page_route_card:
any_other_answer: Route for any other answer
check_your_answers: Check your answers before submitting
conditional_answer_value: "%{answer_value}"
continue_to: For any other answer, continue to
Expand Down Expand Up @@ -1104,7 +1105,7 @@ en:
contact_details: Provide contact details for support
date_settings: Are you asking for someone’s date of birth?
declaration: Add a declaration for people to agree to
delete_secondary_skip: Are you sure you want to delete route 2?
delete_secondary_skip: Are you sure you want to delete the route for any other answer?
email_code_sent: Confirmation code sent
error_prefix: 'Error: '
forbidden: You cannot view this page
Expand All @@ -1123,7 +1124,7 @@ en:
mou_signatures: Memorandum of Understanding agreements
name_settings: Ask for a person’s name
new_page: Edit question
new_secondary_skip: 'Route %{route_index}: set questions to skip'
new_secondary_skip: Set questions to skip
not_found: Page not found
payment_link: Add a link to a payment page on GOV.UK Pay
privacy_policy: Provide a link to privacy information for this form
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
it "is invalid if confirm is nil" do
delete_secondary_skip_input.confirm = nil
expect(delete_secondary_skip_input).to be_invalid
expect(delete_secondary_skip_input.errors.full_messages_for(:confirm)).to include("Confirm Select ‘Yes’ to delete route 2")
expect(delete_secondary_skip_input.errors.full_messages_for(:confirm)).to include("Confirm Select ‘Yes’ to delete the route")
end
end

Expand Down
4 changes: 2 additions & 2 deletions spec/presenters/route_summary_card_data_presenter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
expect(result[0][:rows][1][:value][:text]).to eq("2. Next Question")

# default route
expect(result[1][:card][:title]).to eq("Route 2")
expect(result[1][:card][:title]).to eq("Route for any other answer")
expect(result[1][:card][:actions][0]).to be_nil
expect(result[1][:rows][0][:value][:text]).to eq("2. Next Question")
end
Expand Down Expand Up @@ -125,7 +125,7 @@
it "returns only the default route card" do
result = service.summary_card_data
expect(result.length).to eq(1)
expect(result[0][:card][:title]).to eq("Route 1")
expect(result[0][:card][:title]).to eq("Route for any other answer")
end
end

Expand Down
Loading