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

AP-5608: Use moj design system interrupt #7553

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions app/assets/stylesheets/application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ $govuk-assets-path: "/";
@import "@ministryofjustice/frontend/moj/components/sub-navigation/sub-navigation";
@import "@ministryofjustice/frontend/moj/components/sortable-table/sortable-table";
@import "@ministryofjustice/frontend/moj/components/primary-navigation/primary-navigation";
@import "@ministryofjustice/frontend/moj/components/interruption-card/interruption-card";

// Project specific

Expand All @@ -21,7 +22,6 @@ $govuk-assets-path: "/";
@import "check-your-answers";
@import "govuk-mods";
@import "helpers";
@import "interruption-panel";
@import "language-switcher";
@import "layout";
@import "long-email-truncation";
Expand All @@ -42,4 +42,4 @@ $govuk-assets-path: "/";
@import "dropzone/src/dropzone";
@import "dropzone/src/basic";
@import "providers/summary_list_action_width";
@import "primary_navigation";
@import "primary_navigation";
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing blank line at end?

63 changes: 0 additions & 63 deletions app/assets/stylesheets/interruption-panel.scss

This file was deleted.

4 changes: 2 additions & 2 deletions app/helpers/page_template_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ def page_template(
)
end

def page_heading(heading: :h1, size: :xl, margin_bottom: nil)
def page_heading(heading: :h1, size: :xl, margin_bottom: nil, classes: nil)
return unless page_title

classes = ["govuk-heading-#{size}"]
classes = ["govuk-heading-#{size} #{classes}"]
classes << "govuk-!-margin-bottom-#{margin_bottom}" if margin_bottom
content_tag heading, page_title, class: classes.join(" ")
end
Expand Down
12 changes: 7 additions & 5 deletions app/views/citizens/contact_providers/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<div class="interruption-panel">
<%= page_template(template: :basic) do %>
<h1 class="govuk-heading-l"><%= t(".title") %></h1>
<p><%= t(".they_will_check") %></p>
<% end %>
<div class="moj-interruption-card">
<div class="moj-interruption-card__content">
<%= page_template(template: :basic) do %>
<h1 class="govuk-heading-l moj-interruption-card__heading"><%= t(".title") %></h1>
<p class="govuk-body moj-interruption-card__body"><%= t(".they_will_check") %></p>
<% end %>
</div>
</div>
10 changes: 8 additions & 2 deletions app/views/providers/capital_assessment_results/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,14 @@
column_width: :full,
) do %>

<div class="interruption-panel">
<%= render @result_partial %>
<div class="moj-interruption-card">
<div class="moj-interruption-card__content">
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<%= render @result_partial %>
</div>
</div>
</div>
</div>

<%= render "result_details" %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,14 @@
column_width: :full,
) do %>

<div class="interruption-panel">
<%= render @result_partial %>
<div class="moj-interruption-card">
<div class="moj-interruption-card__content">
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<%= render @result_partial %>
</div>
</div>
</div>
</div>

<%= render "result_details" %>
Expand Down
22 changes: 11 additions & 11 deletions app/views/providers/change_of_names_interrupts/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<div class="interruption-panel">
<%= page_template(page_title: t(".title_html"), column_width: "full", template: :basic) do %>
<%= page_heading(size: "l") %>
<div class="moj-interruption-card">
<div class="moj-interruption-card__content">
<%= page_template(page_title: t(".title_html"), template: :basic) do %>
<%= page_heading(size: "l", classes: "moj-interruption-card__heading") %>

<div class="maximize-text-width">
<p class="govuk-body"><%= t(".paragraph") %></p>
</div>
<p class="govuk-body moj-interruption-card__body"><%= t(".paragraph") %></p>

<div class='govuk-button-group'>
<%= govuk_button_link_to t(".change"), providers_legal_aid_application_change_of_names_path, inverse: true, role: "button" %>
<%= govuk_button_link_to t(".applications"), in_progress_providers_legal_aid_applications_path, inverse: true, role: "button" %>
</div>
<% end %>
<div class='govuk-button-group'>
<%= govuk_button_link_to t(".change"), providers_legal_aid_application_change_of_names_path, inverse: true, role: "button" %>
<%= govuk_button_link_to t(".applications"), in_progress_providers_legal_aid_applications_path, inverse: true, role: "button" %>
</div>
<% end %>
</div>
</div>
27 changes: 14 additions & 13 deletions app/views/providers/check_benefits/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
<% result_namespace = @legal_aid_application.applicant_receives_benefit? ? ".positive_result" : ".negative_result" %>

<div class="interruption-panel">
<%= page_template(page_title: t("#{result_namespace}.tab_title"), column_width: :full, template: :basic) do %>
<h1 class="govuk-heading-l">
<%= t("#{result_namespace}.title") %>
</h1>
<%= next_action_buttons_with_form(
url: providers_legal_aid_application_check_benefit_path,
method: :patch,
show_draft: true,
inverse_continue: true,
continue_button_text: t("generic.continue"),
) %>
<% end %>
<div class="moj-interruption-card">
<div class="moj-interruption-card__content">
<%= page_template(page_title: t("#{result_namespace}.tab_title"), template: :basic) do %>
<h1 class="govuk-heading-l moj-interruption-card__heading"><%= t("#{result_namespace}.title") %></h1>

<%= next_action_buttons_with_form(
url: providers_legal_aid_application_check_benefit_path,
method: :patch,
show_draft: true,
inverse_continue: true,
continue_button_text: t("generic.continue"),
) %>
<% end %>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,37 @@
form:,
) do %>

<div class="interruption-panel govuk-!-margin-bottom-6">
<h1 class="govuk-heading-l"><%= t(".title_html") %></h1>
<div class="moj-interruption-card govuk-!-margin-bottom-6">
<div class="moj-interruption-card__content">
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<h1 class="govuk-heading-l moj-interruption-card__heading"><%= t(".title_html") %></h1>
</div>
</div>
</div>
</div>

<%= form.govuk_radio_buttons_fieldset(:confirm_dwp_result,
legend: { size: "l", tag: "h2", text: t(".is_this_correct") },
classes: "govuk-!-margin-bottom-6") do %>
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">

<% if display_hmrc_text? %>
<p class="govuk-body"><%= t(".hmrc_text") %></p>
<% end %>
<%= form.govuk_radio_buttons_fieldset(:confirm_dwp_result,
legend: { size: "l", tag: "h2", text: t(".is_this_correct") },
classes: "govuk-!-margin-bottom-6") do %>

<%= form.govuk_radio_button :confirm_dwp_result, "dwp_correct", link_errors: true, label: { text: t("generic.yes") } %>
<%= form.govuk_radio_button :confirm_dwp_result, "joint_with_partner_false", label: { text: t(".option_no") } %>
<% if @legal_aid_application.applicant.has_partner? %>
<%= form.govuk_radio_button :confirm_dwp_result, "joint_with_partner_true", label: { text: t(".option_partner") } %>
<% end %>
<% if display_hmrc_text? %>
<p class="govuk-body"><%= t(".hmrc_text") %></p>
<% end %>

<% end %>
<%= form.govuk_radio_button :confirm_dwp_result, "dwp_correct", link_errors: true, label: { text: t("generic.yes") } %>
<%= form.govuk_radio_button :confirm_dwp_result, "joint_with_partner_false", label: { text: t(".option_no") } %>
<% if @legal_aid_application.applicant.has_partner? %>
<%= form.govuk_radio_button :confirm_dwp_result, "joint_with_partner_true", label: { text: t(".option_partner") } %>
<% end %>

<%= next_action_buttons(show_draft: true, form:) %>
<% end %>

<%= next_action_buttons(show_draft: true, form:) %>
</div>
</div>
<% end %>
<% end %>
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
<div class="interruption-panel">
<%= page_template(page_title: t(".tab_title"), column_width: :full, template: :basic) do %>
<h1 class="govuk-heading-m govuk-!-padding-bottom-4">
<% if @legal_aid_application.special_children_act_proceedings? %>
<%= t(".title.sca_proceeding") %>
<% elsif @legal_aid_application.used_delegated_functions? %>
<%= t(".title.under_18_when_delegated_functions_used") %>
<% else %>
<%= t(".title.under_18_now") %>
<% end %>
</h1>
<div class="moj-interruption-card">
<div class="moj-interruption-card__content">
<%= page_template(page_title: t(".tab_title"), template: :basic) do %>
<h1 class="govuk-heading-l moj-interruption-card__heading">
<% if @legal_aid_application.special_children_act_proceedings? %>
<%= t(".title.sca_proceeding") %>
<% elsif @legal_aid_application.used_delegated_functions? %>
<%= t(".title.under_18_when_delegated_functions_used") %>
<% else %>
<%= t(".title.under_18_now") %>
<% end %>
</h1>

<%= next_action_buttons_with_form(
url: providers_legal_aid_application_confirm_non_means_tested_applications_path,
method: :patch,
show_draft: true,
inverse_continue: true,
continue_button_text: t("generic.continue"),
) %>
<% end %>
<%= next_action_buttons_with_form(
url: providers_legal_aid_application_confirm_non_means_tested_applications_path,
method: :patch,
show_draft: true,
inverse_continue: true,
continue_button_text: t("generic.continue"),
) %>
<% end %>
</div>
</div>
29 changes: 13 additions & 16 deletions app/views/providers/interrupt/blocks/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
<div class="interruption-panel">
<%= page_template(page_title: t(".title_html"), column_width: "full", template: :basic) do %>
<%= page_heading(size: "l") %>
<div class="moj-interruption-card">
<div class="moj-interruption-card__content">
<%= page_template(page_title: t(".title_html"), template: :basic) do %>
<%= page_heading(size: "l", classes: "moj-interruption-card__heading") %>

<div class="maximize-text-width">
<p class="govuk-body"><%= t(".body_text") %></p>
<p class="govuk-body"><%= t(".options") %></p>
<ul class="govuk-list govuk-list--bullet">
<% t(".option_bullets").each do |bullet| %>
<li><%= bullet %></li>
<% end %>
</ul>
</div>
<p class="govuk-body moj-interruption-card__body"><%= t(".body_text") %></p>
<p class="govuk-body moj-interruption-card__body"><%= t(".options") %></p>

<div class='govuk-button-group'>
<%= govuk_button_link_to t(".applications"), submitted_providers_legal_aid_applications_path, inverse: true, role: "button" %>
</div>
<% end %>
<%= govuk_list t(".option_bullets"), type: :bullet, classes: "moj-interruption-card__body" %>

<div class='govuk-button-group'>
<%= govuk_button_link_to t(".applications"), submitted_providers_legal_aid_applications_path, inverse: true, role: "button" %>
</div>
<% end %>
</div>
</div>
28 changes: 15 additions & 13 deletions app/views/providers/no_national_insurance_numbers/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
<div class="interruption-panel">
<%= page_template(page_title: t(".tab_title"), column_width: :full, template: :basic) do %>
<h1 class="govuk-heading-m govuk-!-padding-bottom-4">
<%= t(".title") %>
</h1>
<div class="moj-interruption-card">
<div class="moj-interruption-card__content">
<%= page_template(page_title: t(".tab_title"), template: :basic) do %>
<h1 class="govuk-heading-l moj-interruption-card__heading"><%= t(".title") %></h1>

<%= next_action_buttons_with_form(
url: providers_legal_aid_application_no_national_insurance_number_path,
method: :patch,
show_draft: true,
inverse_continue: true,
continue_button_text: t("generic.continue"),
) %>
<% end %>
<p class="govuk-body moj-interruption-card__body"><%= t(".body") %></p>
Copy link
Contributor

Choose a reason for hiding this comment

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

I assume you checked this split with design?


<%= next_action_buttons_with_form(
url: providers_legal_aid_application_no_national_insurance_number_path,
method: :patch,
show_draft: true,
inverse_continue: true,
continue_button_text: t("generic.continue"),
) %>
<% end %>
</div>
</div>
24 changes: 12 additions & 12 deletions app/views/providers/proceedings_sca/interrupts/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<div class="interruption-panel">
<%= page_template(page_title: t(".#{@type}.title_html"), column_width: "full", template: :basic) do %>
<%= page_heading(size: "l") %>
<div class="moj-interruption-card">
<div class="moj-interruption-card__content">
<%= page_template(page_title: t(".#{@type}.title_html"), template: :basic) do %>
<%= page_heading(size: "l", classes: "moj-interruption-card__heading") %>

<div class="maximize-text-width">
<% if I18n.exists?("providers.proceedings_sca.interrupts.show.#{@type}.paragraph") %>
<p class="govuk-body"><%= t(".#{@type}.paragraph") %></p>
<p class="govuk-body moj-interruption-card__body"><%= t(".#{@type}.paragraph") %></p>
<% end %>
<p class="govuk-body"><%= t(".#{@type}.options") %></p>
<%= govuk_list t(".#{@type}.option_bullets_html"), type: :bullet %>
</div>
<p class="govuk-body moj-interruption-card__body"><%= t(".#{@type}.options") %></p>
<%= govuk_list t(".#{@type}.option_bullets_html"), type: :bullet, classes: "moj-interruption-card__body" %>

<div class='govuk-button-group'>
<%= govuk_button_link_to t(".#{@type}.proceedings"), providers_legal_aid_application_sca_interrupt_path(@legal_aid_application, @type), method: :delete, inverse: true, role: "button" %>
</div>
<% end %>
<div class='govuk-button-group'>
<%= govuk_button_link_to t(".#{@type}.proceedings"), providers_legal_aid_application_sca_interrupt_path(@legal_aid_application, @type), method: :delete, inverse: true, role: "button" %>
</div>
<% end %>
</div>
</div>
Loading
Loading