Skip to content

Commit

Permalink
AP-3809: Bank account section content changes
Browse files Browse the repository at this point in the history
Update content in bank account section. Change
instances of "No" to "None" as shown in the
figma design for check your answers
  • Loading branch information
agoldstone93 committed Oct 16, 2023
1 parent 276cfe0 commit 1359754
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion app/helpers/capital_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def capital_amount_items(items, locale_namespace, percentage_values)

def capital_amount_text(amount, type)
if amount.nil?
"No"
t("generic.none")
elsif type == :percentage
number_to_percentage(amount, precision: 2)
else
Expand Down
2 changes: 1 addition & 1 deletion app/helpers/policy_disregards_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def policy_disregards_list(policy_disregards)
items&.compact!

items.map do |item|
item.amount_text ||= "No"
item.amount_text ||= "None"
end

{
Expand Down
17 changes: 9 additions & 8 deletions app/views/shared/check_answers/_assets.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,21 @@
<section class="print-no-break">
<%= render "shared/check_answers/vehicles", read_only:, individual: %>

<h3 class="govuk-heading-m"><%= t(".assets.bank_accounts") %></h2>
<% if @legal_aid_application.non_passported? && !@legal_aid_application.uploading_bank_statements? %>
<!-- non-passported truelayer only -->

<% if read_only %>
<h2 class="govuk-heading-m"><%= t(".assets.bank_accounts") %></h2>
<h3 class="govuk-heading-m"><%= t(".assets.client_bank_accounts") %></h2>

<%= govuk_summary_list(classes: "govuk-!-margin-bottom-9", html_attributes: { "data-test": "applicant-bank-accounts" }) do |summary_list| %>
<%= summary_list.with_row(html_attributes: { id: "app-check-your-answers__online_current_accounts" }) do |row| %>
<%= row.with_key(text: t(".assets.current_account"), classes: "govuk-!-width-one-half") %>
<%= row.with_value { online_current_accounts.present? ? gds_number_to_currency(online_current_accounts) : t("generic.none_declared") } %>
<%= row.with_value { online_current_accounts.present? ? gds_number_to_currency(online_current_accounts) : t("generic.none") } %>
<% end %>
<%= summary_list.with_row(html_attributes: { id: "app-check-your-answers__online_savings_accounts" }) do |row| %>
<%= row.with_key(text: t(".assets.savings_account"), classes: "govuk-!-width-one-half") %>
<%= row.with_value { online_savings_accounts.present? ? gds_number_to_currency(online_savings_accounts) : t("generic.none_declared") } %>
<%= row.with_value { online_savings_accounts.present? ? gds_number_to_currency(online_savings_accounts) : t("generic.none") } %>
<% end %>
<% end %>
<% end %>
Expand All @@ -34,7 +35,7 @@
"shared/check_answers/one_link_section",
name: :bank_accounts,
url: check_answer_url_for(journey_type, :offline_accounts, @legal_aid_application),
question: t(".assets.bank_accounts"),
question: t(".assets.client_bank_accounts"),
answer_hash: capital_accounts_list(
@legal_aid_application.savings_amount,
locale_namespace: "shared.forms.revealing_checkbox.attribute.#{journey_type}.bank_accounts.check_box_",
Expand Down Expand Up @@ -68,11 +69,11 @@
<%= govuk_summary_list(classes: "govuk-!-margin-bottom-9", html_attributes: { "data-test": "partner-bank-accounts" }) do |summary_list| %>
<%= summary_list.with_row(html_attributes: { id: "app-check-your-answers__partner_online_current_accounts" }) do |row| %>
<%= row.with_key(text: t(".assets.current_account"), classes: "govuk-!-width-one-half") %>
<%= row.with_value { @legal_aid_application.savings_amount.partner_offline_current_accounts.present? ? gds_number_to_currency(@legal_aid_application.savings_amount.partner_offline_current_accounts) : t("generic.none_declared") } %>
<%= row.with_value { @legal_aid_application.savings_amount.partner_offline_current_accounts.present? ? gds_number_to_currency(@legal_aid_application.savings_amount.partner_offline_current_accounts) : t("generic.none") } %>
<% end %>
<%= summary_list.with_row(html_attributes: { id: "app-check-your-answers__partner_online_savings_accounts" }) do |row| %>
<%= row.with_key(text: t(".assets.savings_account"), classes: "govuk-!-width-one-half") %>
<%= row.with_value { @legal_aid_application.savings_amount.partner_offline_savings_accounts.present? ? gds_number_to_currency(@legal_aid_application.savings_amount.partner_offline_savings_accounts) : t("generic.none_declared") } %>
<%= row.with_value { @legal_aid_application.savings_amount.partner_offline_savings_accounts.present? ? gds_number_to_currency(@legal_aid_application.savings_amount.partner_offline_savings_accounts) : t("generic.none") } %>
<% end %>
<% end %>
<% end %>
Expand All @@ -97,11 +98,11 @@
<%= govuk_summary_list(classes: "govuk-!-margin-bottom-9", html_attributes: { "data-test": "joint-bank-accounts" }) do |summary_list| %>
<%= summary_list.with_row(html_attributes: { id: "app-check-your-answers__joint_online_current_accounts" }) do |row| %>
<%= row.with_key(text: t(".assets.current_account"), classes: "govuk-!-width-one-half") %>
<%= row.with_value { @legal_aid_application.savings_amount.joint_offline_current_accounts.present? ? gds_number_to_currency(@legal_aid_application.savings_amount.joint_offline_current_accounts) : t("generic.none_declared") } %>
<%= row.with_value { @legal_aid_application.savings_amount.joint_offline_current_accounts.present? ? gds_number_to_currency(@legal_aid_application.savings_amount.joint_offline_current_accounts) : t("generic.none") } %>
<% end %>
<%= summary_list.with_row(html_attributes: { id: "app-check-your-answers__joint_online_savings_accounts" }) do |row| %>
<%= row.with_key(text: t(".assets.savings_account"), classes: "govuk-!-width-one-half") %>
<%= row.with_value { @legal_aid_application.savings_amount.joint_offline_savings_accounts.present? ? gds_number_to_currency(@legal_aid_application.savings_amount.joint_offline_savings_accounts) : t("generic.none_declared") } %>
<%= row.with_value { @legal_aid_application.savings_amount.joint_offline_savings_accounts.present? ? gds_number_to_currency(@legal_aid_application.savings_amount.joint_offline_savings_accounts) : t("generic.none") } %>
<% end %>
<% end %>
<% end %>
Expand Down
7 changes: 4 additions & 3 deletions config/locales/en/shared.yml
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,10 @@ en:
savings_and_investments_with_partner: Which savings or investments does either your client or their partner have?
savings_account: Savings account
current_account: Current account
bank_accounts: Which bank accounts does your client have?
partner_bank_accounts: Which bank accounts does the partner have?
joint_bank_accounts: Joint bank accounts
bank_accounts: Bank accounts
client_bank_accounts: Your client's accounts
partner_bank_accounts: The partner's accounts
joint_bank_accounts: Joint accounts
property:
heading_own_home: Property
heading_property_details: Your client's property
Expand Down

0 comments on commit 1359754

Please sign in to comment.