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

Move summary partial out of external_users folder and into shared folder #7801

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from

This file was deleted.

2 changes: 1 addition & 1 deletion app/views/external_users/claims/summary.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@

.govuk-grid-row
.govuk-grid-column-full
= render partial: 'external_users/claims/summary_claims_content', locals: { claim: claim }
= render partial: 'shared/summary/summary_claims_content', locals: { claim: claim }
2 changes: 1 addition & 1 deletion app/views/shared/_claim.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,4 @@
= t('.no_defendant')

- unless claim.fixed_fee_case?
= render partial: 'external_users/claims/offence_details/summary', locals: { claim: claim }
= render partial: 'shared/summary/offence_details/summary', locals: { claim: claim }
2 changes: 1 addition & 1 deletion app/views/shared/_summary_agfs.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,4 @@
%p.govuk-body
= t('shared.summary.no_values.expenses')
- else
= render partial: 'shared/summary/expenses', locals: { claim: claim }
= render partial: 'shared/summary/expenses/summary', locals: { claim: claim }
2 changes: 1 addition & 1 deletion app/views/shared/_summary_lgfs.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
%p.govuk-body
= t('shared.summary.no_values.expenses')
- else
= render partial: 'shared/summary/expenses', locals: { claim: claim }
= render partial: 'shared/summary/expenses/summary', locals: { claim: claim }

- if claim.can_have_disbursements?
- if claim.disbursements.empty?
Expand Down
3 changes: 3 additions & 0 deletions app/views/shared/summary/_summary_claims_content.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- claim.summary_sections.each do |section, associated_step|
- if claim.accessible_step?(associated_step) && section.to_s != 'additional_information'
= render partial: "shared/summary/#{section}/summary", locals: { claim: claim, step: associated_step, section: section, editable: claim.editable_step?(associated_step) }
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
- claim_fields = %i[external_users claims case_details fields]
- cracked_trial_fields = %i[external_users claims case_details cracked_trial_fields]
- trial_detail_fields = %i[external_users claims case_details trial_detail_fields]
- retrial_detail_fields = %i[external_users claims case_details retrial_detail_fields]
- claim_fields = %i[shared summary case_details fields]
- cracked_trial_fields = %i[shared summary case_details cracked_trial_fields]
- trial_detail_fields = %i[shared summary case_details trial_detail_fields]
- retrial_detail_fields = %i[shared summary case_details retrial_detail_fields]

#case-details-section.app-summary-section
%h2.govuk-heading-l
= t('external_users.claims.case_details.summary.header')
= t('shared.summary.case_details.summary.header')

- if local_assigns[:editable]
= govuk_link_to t('common.change_html', context: t('external_users.claims.case_details.summary.header')), edit_polymorphic_path(claim, step: :case_details, referrer: :summary), class: 'link-change'
= govuk_link_to t('common.change_html', context: t('shared.summary.case_details.summary.header')), edit_polymorphic_path(claim, step: :case_details, referrer: :summary), class: 'link-change'

- if claim.mandatory_case_details?
= govuk_summary_list do
Expand Down Expand Up @@ -41,7 +41,7 @@
= govuk_summary_list_row_collection( t('case_type', scope: claim_fields) ) { claim.case_type&.name }

- if claim.requires_case_concluded_date?
= govuk_summary_list_row_collection( t('external_users.claims.case_details.case_concluded_date.case_concluded_at') ) { claim.case_concluded_at }
= govuk_summary_list_row_collection( t('shared.summary.case_details.case_concluded_date.case_concluded_at') ) { claim.case_concluded_at }

- if claim&.case_type && claim.requires_cracked_dates?
= govuk_summary_list_row_collection( t('trial_fixed_notice_at', scope: cracked_trial_fields) ) do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
= render partial: 'summary_fees', locals: misc_fees_summary_locals(claim, editable: editable, section: section)

- if claim.requires_interim_claim_info?
= render partial: 'external_users/claims/interim_claim_info/summary', locals: { claim: claim }
= render partial: 'shared/summary/interim_claim_info/summary', locals: { claim: claim }
56 changes: 54 additions & 2 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2052,7 +2052,6 @@ en:
reason_for_refusal: Choose reason for refusal
reason_for_rejection: Choose reason for rejection
claimed_by: Claimed by
reason_text: Reason text
reason_hint: These reasons will be displayed to providers
update_the_claim_status: Update the claim status
reason_text: Reason text
Expand Down Expand Up @@ -2182,13 +2181,61 @@ en:
retrial_started_at: Retrial started at
first_day_of_trial: First day of trial
actual_trial_length: *actual_trial_length
case_details:
case_concluded_date:
case_concluded_at: 'Date case concluded'
cracked_trial_fields:
trial_cracked_at: 'Case cracked on'
case_cracked: 'Case cracked in'
trial_fixed_notice_at: 'Notice of 1st fixed/warned issued'
trial_fixed_at: '1st fixed/warned trial'
trial_cracked_at_third:
default: Case cracked in
hardship: If the case cracked today, which third would it be?
fields:
case_number: "Case number"
case_stage: *case_stage
case_type: "Case type"
main_hearing_date: "Main hearing date"
summary:
header: Case Details
answer_yes: *global_yes
answer_no: *global_no
trial_detail_fields:
first_day_of_trial: 'First day of trial'
estimated_trial_length: 'Estimated trial length'
actual_trial_length: *actual_trial_length
trial_concluded_at: 'Trial concluded on'
retrial_detail_fields:
retrial_started_at: 'First day of retrial'
retrial_estimated_length: 'Estimated retrial length'
retrial_actual_length: 'Actual retrial length'
retrial_concluded_at: 'Retrial concluded on'
retrial_reduction: 'Apply reduced rate to retrial?'
defendants:
summary:
answer_no: *global_no
answer_yes: *global_yes
common:
defendant_index: Defendant %{index}
fields:
case_number: "Case Number"
trial_detail_fields:
first_day_of_trial: 'First day of trial'
retrial_detail_fields:
retrial_started_at: 'First day of retrial'
retrial_reduction: 'Apply reduced rate to retrial?'
case_concluded_date:
case_concluded_at: 'Date case concluded'
mileage_rate: Cost per mile
expense: Expense %{index}
expenses:
caption: &expenses_caption 'Expenses: A detailed list by Type including amount, distance and location where applicable'
travel_expense_additional_information: Additional information
travel_expenses: Travel expenses
travel_details: Travel details
expenses:
travel_expense_additional_information: Additional information
travel_expenses: Travel expenses
index:
calculated_distance: Calculated distance
caption: *expenses_caption
Expand Down Expand Up @@ -2231,6 +2278,9 @@ en:
net_amount: *net_amount
reason: Reason for travel
vat: *vat_amount
summary:
additional_information: Additional information
caption: 'Expenses: This section contains details of all expenses that have been claimed.'
fee: Fee
fee_index: Fee %{index}
fees:
Expand Down Expand Up @@ -2278,6 +2328,8 @@ en:
net_amount: *net_amount
vat_amount: *vat_amount
total: "Total"
summary:
caption: 'Disbursements: This section contains details of all disbursements that have been claimed.'
warrant_fee:
date_issued: "Warrant issued"
date_executed: "Warrant executed"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
end
end

RSpec.describe 'external_users/claims/case_details/summary.html.haml' do
subject(:summary) { 'external_users/claims/case_details/summary' }
RSpec.describe 'shared/summary/case_details/summary.html.haml' do
subject(:summary) { 'shared/summary/case_details/summary' }

let(:page) { Capybara::Node::Simple.new(rendered) }
let(:date_format) { '%d/%m/%Y' }
Expand Down