Skip to content

Commit

Permalink
AP-5434: Update disregards info to use summary cards
Browse files Browse the repository at this point in the history
  • Loading branch information
agoldstone93 committed Nov 18, 2024
1 parent 43e7cf0 commit 85667de
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 60 deletions.
4 changes: 2 additions & 2 deletions app/views/providers/check_passported_answers/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@

<%= render "shared/check_answers/assets", individual: %>

<h2 class="govuk-heading-m"><%= t(".chances_of_success_h2") %></h2>
<h3 class="govuk-heading-m"><%= t(".what_happens_next") %></h2>

<p class="govuk-body"><%= t(".chances_of_success_body") %></p>
<p class="govuk-body"><%= t(".what_happens_next_body") %></p>

<%= next_action_buttons_with_form(
url: continue_providers_legal_aid_application_check_passported_answers_path(@legal_aid_application),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<h2 class="govuk-heading-m"><%= t(".heading") %></h2>
<%= govuk_summary_list(
card: { title: t(".heading") },
actions: false,
classes: "govuk-!-margin-bottom-9",
html_attributes: { id: "capital-disregards-questions" },
) do |summary_list| %>

Expand Down
24 changes: 11 additions & 13 deletions app/views/shared/check_answers/_assets.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -152,19 +152,17 @@
<% end %>

<%# savings and investments %>
<div class="govuk-!-padding-bottom-9">
<%= render(
"shared/check_answers/one_link_section",
name: :savings_and_investments,
url: check_answer_url_for(journey_type, :savings_and_investments, @legal_aid_application),
question: t(".assets.savings_and_investments#{individual}"),
answer_hash: capital_assets_list(
@legal_aid_application,
locale_namespace: "shared.forms.revealing_checkbox.attribute.#{journey_type}.savings_and_investments.check_box_",
),
read_only:,
) %>
</div>
<%= render(
"shared/check_answers/one_link_section",
name: :savings_and_investments,
url: check_answer_url_for(journey_type, :savings_and_investments, @legal_aid_application),
question: t(".assets.savings_and_investments#{individual}"),
answer_hash: capital_assets_list(
@legal_aid_application,
locale_namespace: "shared.forms.revealing_checkbox.attribute.#{journey_type}.savings_and_investments.check_box_",
),
read_only:,
) %>

<%# other assets %>
<%= render(
Expand Down
18 changes: 6 additions & 12 deletions app/views/shared/check_answers/_capital_disregard_details.html.erb
Original file line number Diff line number Diff line change
@@ -1,22 +1,16 @@
<% capital_disregard_type = capital_disregard.mandatory? ? "mandatory" : "discretionary" %>
<% capital_disregard_name = t("providers.means.capital_disregards.#{capital_disregard_type}.#{capital_disregard.name}") %>

<% action_link = govuk_link_to(t("generic.change"),
providers_legal_aid_application_means_capital_disregards_add_detail_path(@legal_aid_application, capital_disregard),
visually_hidden_suffix: capital_disregard_name,
id: "app-check-your-answers__capital_disregard_#{index}_change_link") %>
<%= govuk_summary_list(
actions: !read_only,
classes: "govuk-!-margin-bottom-9",
card: { title: t(".#{capital_disregard_type}.heading", count: index + 1), actions: read_only ? [] : [action_link] },
actions: false,
html_attributes: { id: "#{capital_disregard_type}-capital-disregard-questions_#{index}" },
) do |summary_list| %>

<%= summary_list.with_row(html_attributes: { id: "app-check-your-answers__capital_disregard_#{index}_change_link" }) do |row| %>
<%= row.with_key(text: t(".#{capital_disregard_type}.heading", count: index + 1), classes: "govuk-!-width-one-half govuk-heading-m") %>
<%= row.with_value(text: nil) %>
<%= row.with_action(
text: t("generic.change"),
href: providers_legal_aid_application_means_capital_disregards_add_detail_path(@legal_aid_application, capital_disregard),
visually_hidden_text: capital_disregard_name,
) %>
<% end %>

<%= summary_list.with_row(html_attributes: { id: "app-check-your-answers__payment_type" }) do |row| %>
<%= row.with_key(text: t(".questions.payment_type"), classes: "govuk-!-width-one-half") %>
<%= row.with_value { capital_disregard_name } %>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<h2 class="govuk-heading-m"><%= t(".heading#{individual}") %></h2>
<%= govuk_summary_list(
card: { title: t(".heading#{individual}") },
actions: !read_only,
classes: "govuk-!-margin-bottom-9",
html_attributes: { id: "capital-disregards-questions" },
) do |summary_list| %>

Expand Down
4 changes: 2 additions & 2 deletions config/locales/en/providers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -326,8 +326,8 @@ en:
show:
h1-heading: Check your answers
h2-heading: Your client's capital
chances_of_success_body: We'll use your answers to calculate your client's financial eligibility for legal aid.
chances_of_success_h2: What happens next
what_happens_next: What happens next
what_happens_next_body: We'll use your answers to calculate your client's financial eligibility for legal aid.
check_provider_answers:
standard:
title: Check your answers
Expand Down
33 changes: 13 additions & 20 deletions features/providers/mtr_accelerated/check_capital_answers.feature
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ Feature: Check capital income answers
| h3 | Property |
| h3 | Your client's property |
| h3 | Vehicles |
| dt | Vehicle 1 |
| h2 | Vehicle 1 |
| h2 | Bank accounts |
| h3 | Your client's accounts |
| h2 | Your client's accounts |
| h2 | Which savings or investments does your client have? |
| h2 | Which assets does your client have? |
| h2 | Restrictions on your client's assets |
| h2 | One-off payments your client received |
| dt | Disregarded payment 1 |
| dt | Payment to be reviewed 1 |
| h2 | Disregarded payment 1 |
| h2 | Payment to be reviewed 1 |
| h3 | What happens next |

Then the following sections should not exist:
Expand All @@ -36,20 +36,18 @@ Feature: Check capital income answers
| h3 | Student finance |
| h2 | Your client's outgoings |
| h3 | Payments your client makes |
| h3 | "Payments your client receives in cash" |
| h3 | "Payments your client makes in cash" |
| h3 | Payments your client receives in cash |
| h3 | Payments your client makes in cash |
| h2 | Payments from scheme or charities |

And the Disregarded payment 1 questions and answers should match:
| question | answer |
| Disregarded payment 1 | |
| Payment type | Budgeting Advances |
| Amount and date received | £1,001 on 8 August 2024 |
| Bank account | Halifax |

And the Payment to be reviewed 1 questions and answers should match:
| question | answer |
| Payment to be reviewed 1 | |
| Payment type | Compensation, damages or ex-gratia payments for personal harm |
| What the payment is for | life changing injuries |
| Amount and date received | £1,002 on 8 August 2024 |
Expand All @@ -68,15 +66,15 @@ Feature: Check capital income answers
| h3 | Property |
| h3 | Your client's property |
| h3 | Vehicles |
| dt | Vehicle 1 |
| h2 | Vehicle 1 |
| h2 | Bank accounts |
| h3 | Your client's accounts |
| h2 | Which savings or investments does your client have? |
| h2 | Which assets does your client have? |
| h2 | Restrictions on your client's assets |
| h2 | One-off payments your client received |
| dt | Disregarded payment 1 |
| dt | Payment to be reviewed 1 |
| h2 | Disregarded payment 1 |
| h2 | Payment to be reviewed 1 |
| h3 | What happens next |

Then the following sections should not exist:
Expand All @@ -93,14 +91,12 @@ Feature: Check capital income answers

And the Disregarded payment 1 questions and answers should match:
| question | answer |
| Disregarded payment 1 | |
| Payment type | Budgeting Advances |
| Amount and date received | £1,001 on 8 August 2024 |
| Bank account | Halifax |

And the Payment to be reviewed 1 questions and answers should match:
| question | answer |
| Payment to be reviewed 1 | |
| Payment type | Compensation, damages or ex-gratia payments for personal harm |
| What the payment is for | life changing injuries |
| Amount and date received | £1,002 on 8 August 2024 |
Expand All @@ -119,16 +115,16 @@ Feature: Check capital income answers
| h3 | Property |
| h3 | Your client's property |
| h3 | Vehicles |
| dt | Vehicle 1 |
| h2 | Vehicle 1 |
| h2 | Bank accounts |
| h3 | Your client's accounts |
| h2 | Which savings or investments does your client have? |
| h2 | Which assets does your client have? |
| h2 | Restrictions on your client's assets |
| h2 | One-off payments your client received |
| dt | Disregarded payment 1 |
| dt | Payment to be reviewed 1 |
| h2 | What happens next |
| h2 | Disregarded payment 1 |
| h2 | Payment to be reviewed 1 |
| h3 | What happens next |

Then the following sections should not exist:
| tag | section |
Expand All @@ -144,16 +140,13 @@ Feature: Check capital income answers

And the Disregarded payment 1 questions and answers should match:
| question | answer |
| Disregarded payment 1 | |
| Payment type | Budgeting Advances |
| Amount and date received | £1,001 on 8 August 2024 |
| Bank account | Halifax |

And the Payment to be reviewed 1 questions and answers should match:
| question | answer |
| Payment to be reviewed 1 | |
| Payment type | Compensation, damages or ex-gratia payments for personal harm |
| What the payment is for | life changing injuries |
| Amount and date received | £1,002 on 8 August 2024 |
| Bank account | Halifax |

16 changes: 7 additions & 9 deletions features/providers/mtr_accelerated/means_report.feature
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ Feature: Means report
| Client income from property or lodger | £0 |
| Client student loan or grant | £0 |
| Client pension | £0 |
| Total income | |

And I should see "Total income"
And the 'Client' employment notes questions should exist:
| Do you need to tell us anything else about your client's employment? |
| Details for client |
Expand All @@ -96,8 +96,7 @@ Feature: Means report
| Client childcare payments | £0 |
| Client maintenance payments to a former partner | £0 |
| Client payments towards legal aid in a criminal case | £100 |

And I should see "Total outgoings"
| Total outgoings | £225 |

And the Deductions questions should exist:
| question |
Expand Down Expand Up @@ -215,7 +214,7 @@ Feature: Means report
| h2 | Which assets does your client have? |
| h2 | Restrictions on your client's assets |
| h2 | Capital disregards |
| h3 | Client's bank accounts |
| h2 | Client's bank accounts |

Then the following sections should not exist:
| tag | section |
Expand Down Expand Up @@ -266,8 +265,8 @@ Feature: Means report
| Client income from property or lodger | £0 |
| Client student loan or grant | £0 |
| Client pension | £0 |
| Total income | |

And I should see "Total income"
And the 'Client' employment notes questions should exist:
| Do you need to tell us anything else about your client's employment? |
| Details for client |
Expand All @@ -278,8 +277,7 @@ Feature: Means report
| Client childcare payments | £0 |
| Client maintenance payments to a former partner | £0 |
| Client payments towards legal aid in a criminal case | £100 |

And I should see "Total outgoings"
| Total outgoings | £225 |

And the Deductions questions should exist:
| question |
Expand Down Expand Up @@ -338,8 +336,8 @@ Feature: Means report

And the "Bank accounts", for open banking accounts, questions and answers table should exist:
| question | answer |
| Account Name, 12345678, 000000 | 75.57 |
| Second Account, 87654321, 999999 | 57.57 |
| Account Name, 12345678, 000000 | £75.57 |
| Second Account, 87654321, 999999 | £57.57 |

And the "Your client's accounts" questions should exist:
| question |
Expand Down

0 comments on commit 85667de

Please sign in to comment.