Skip to content

Commit

Permalink
AP-5608: Update next_action_buttons
Browse files Browse the repository at this point in the history
Update next_action_buttons helper method to allow custom container
class, so the moj-interruption-card__actions can be added.
  • Loading branch information
agoldstone93 committed Jan 9, 2025
1 parent 9824632 commit d36e6f6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
8 changes: 6 additions & 2 deletions app/helpers/flow_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ def next_action_buttons_with_form(
show_draft: false,
inverse_continue: false,
continue_button_text: t("generic.save_and_continue"),
draft_button_text: t("generic.save_and_come_back_later")
draft_button_text: t("generic.save_and_come_back_later"),
container_class: nil
)
form_with(url:, method:, local: true) do |form|
next_action_buttons(
Expand All @@ -16,6 +17,7 @@ def next_action_buttons_with_form(
form:,
continue_button_text:,
draft_button_text:,
container_class:,
)
end
end
Expand All @@ -27,7 +29,8 @@ def next_action_buttons(
show_draft: false,
inverse_continue: false,
continue_button_text: t("generic.save_and_continue"),
draft_button_text: t("generic.save_and_come_back_later")
draft_button_text: t("generic.save_and_come_back_later"),
container_class: nil
)
render(
"shared/forms/next_action_buttons",
Expand All @@ -38,6 +41,7 @@ def next_action_buttons(
inverse_continue:,
continue_button_text:,
draft_button_text:,
container_class: ["govuk-button-group", container_class].compact.join(" "),
)
end

Expand Down
1 change: 1 addition & 0 deletions app/views/providers/check_benefits/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
show_draft: true,
inverse_continue: true,
continue_button_text: t("generic.continue"),
container_class: "moj-interruption-card__actions",
) %>
<% end %>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/views/shared/forms/_next_action_buttons.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class='govuk-button-group'>
<div class="<%= container_class %>">
<% if show_continue %>
<%= form.govuk_submit(
continue_button_text,
Expand Down

0 comments on commit d36e6f6

Please sign in to comment.