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

[LUPEYALPHA-964] Claim Summary for FE #3150

Merged
merged 3 commits into from
Sep 10, 2024
Merged
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
8 changes: 8 additions & 0 deletions app/helpers/admin/claim_summary_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module Admin
module ClaimSummaryHelper
def claim_summary_view
policy_name_to_append = @claim.policy.to_s.underscore if @claim.policy.is_a?(Policies::FurtherEducationPayments)
["claim_summary", policy_name_to_append].compact.join("_")
end
end
end
2 changes: 1 addition & 1 deletion app/views/admin/amendments/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<%= link_to "Back", claims_backlink_path, class: "govuk-back-link" %>

<div class="govuk-grid-row">
<%= render "admin/tasks/claim_summary", claim: @claim, heading: @claim.reference %>
<%= render "admin/tasks/#{claim_summary_view}", claim: @claim, heading: @claim.reference %>
</div>

<div class="govuk-grid-row">
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/decisions/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div class="govuk-grid-row">
<%= render("shared/error_summary", instance: @decision, errored_field_id_overrides: { "result": "decision_result_approved" }) if @decision.errors.any? %>

<%= render "admin/tasks/claim_summary", claim: @claim, heading: "Claim decision" %>
<%= render "admin/tasks/#{claim_summary_view}", claim: @claim, heading: "Claim decision" %>

<div class="govuk-grid-column-two-thirds">
<%= render("incomplete_tasks", claim: @claim, incomplete_task_names: @claim_checking_tasks.incomplete_task_names) if @claim_checking_tasks.incomplete_task_names.any? %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/notes/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<%= render("shared/error_summary", instance: @hold_note, errored_field_id_overrides: {body: "hold_body"}) if @hold_note.errors.any? %>

<div class="govuk-grid-row">
<%= render "admin/tasks/claim_summary", claim: @claim, heading: @claim.reference %>
<%= render "admin/tasks/#{claim_summary_view}", claim: @claim, heading: @claim.reference %>
</div>

<div class="govuk-grid-row">
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/payments/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<%# render("shared/error_summary", instance: @hold_note, errored_field_id_overrides: {body: "hold_body"}) if @hold_note.errors.any? %>

<div class="govuk-grid-row">
<%= render "admin/tasks/claim_summary", claim: @claim, heading: @claim.reference %>
<%= render "admin/tasks/#{claim_summary_view}", claim: @claim, heading: @claim.reference %>
</div>

<div class="govuk-grid-row">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
<div class="govuk-grid-column-full">
<span class="govuk-caption-xl"><%= claim.policy.short_name %> (<%= claim.academic_year %>)</span>
<h1 class="govuk-heading-xl govuk-heading--navigation">
<span id="claim-heading">
<%= claim_summary_heading(claim) %>
</span>
<span class="govuk-body-m">
<%= link_to "View full claim", admin_claim_path(claim), class: "govuk-link" %>
<%= link_to "Amend claim", new_admin_claim_amendment_path(claim), class: "govuk-link" if claim.amendable? %>
<%= link_to "Top up claim", new_admin_claim_topup_path(@claim), class: "govuk-link" if @claim.topupable? %>
</span>
</h1>
</div>

<div class="govuk-grid-column-full">
<%= render("admin/claims/banner", important_notes: @claim.important_notes) if @claim.important_notes.any? %>
</div>

<%= render "shared/assignment_banner", claim: @claim %>

<div class="govuk-grid-column-one-half">
<dl class="govuk-summary-list govuk-!-margin-bottom-9">
<div class="govuk-summary-list__row">
<dt class="govuk-summary-list__key">
<abbr title="Teacher Reference Number">TRN</abbr>
</dt>
<dd class="govuk-summary-list__value">
<%= claim.eligibility.teacher_reference_number.present? ? claim.eligibility.teacher_reference_number : "Not provided" %>
</dd>
</div>
<div class="govuk-summary-list__row">
<dt class="govuk-summary-list__key">
NI number
</dt>

<dd class="govuk-summary-list__value">
<%= claim.personal_data_removed? ? personal_data_removed_text : claim.national_insurance_number %>
</dd>
</div>
<div class="govuk-summary-list__row">
<dt class="govuk-summary-list__key">
Full name
</dt>

<dd class="govuk-summary-list__value">
<%= claim.personal_data_removed? ? personal_data_removed_text : claim.full_name %>
</dd>
</div>
<div class="govuk-summary-list__row">
<dt class="govuk-summary-list__key">
Date of birth
</dt>

<dd class="govuk-summary-list__value">
<%= claim.personal_data_removed? ? personal_data_removed_text : l(claim.date_of_birth, format: :day_month_year) %>
</dd>
</div>
<div class="govuk-summary-list__row">
<dt class="govuk-summary-list__key">
Email address
</dt>

<dd class="govuk-summary-list__value">
<%= claim.email_address %>
</dd>
</div>
<div class="govuk-summary-list__row">
<dt class="govuk-summary-list__key">
Mobile number
</dt>

<dd class="govuk-summary-list__value">
<%= claim.mobile_number %>
</dd>
</div>
<div class="govuk-summary-list__row">
<dt class="govuk-summary-list__key">
Reference
</dt>

<dd class="govuk-summary-list__value">
<%= claim.reference %>
</dd>
</div>
</dl>
</div>
<div class="govuk-grid-column-one-half">
<dl class="govuk-summary-list govuk-!-margin-bottom-9">
<div class="govuk-summary-list__row">
<dt class="govuk-summary-list__key">
Submitted
</dt>

<dd class="govuk-summary-list__value">
<%= l(claim.submitted_at) %>
</dd>
</div>
<div class="govuk-summary-list__row">
<dt class="govuk-summary-list__key">
Decision due
</dt>

<dd class="govuk-summary-list__value">
<%= l(claim.decision_deadline_date) %>
<%= decision_deadline_warning(claim, {na_text: ""}) %>
</dd>
</div>

<div class="govuk-summary-list__row">
<dt class="govuk-summary-list__key">
Status
</dt>

<dd class="govuk-summary-list__value">
<%= status(claim) %>
</dd>
</div>

<div class="govuk-summary-list__row">
<dt class="govuk-summary-list__key">
Claim amount
</dt>

<dd class="govuk-summary-list__value">
<%= number_to_currency(claim.award_amount_with_topups) %>
</dd>
</div>

<div class="govuk-summary-list__row">
<dt class="govuk-summary-list__key">
Provider Name
</dt>

<dd class="govuk-summary-list__value">
<%= @claim.school.name %>
</dd>
</div>

<div class="govuk-summary-list__row">
<dt class="govuk-summary-list__key">
UK Provider Reference Number (UKPRN)
</dt>

<dd class="govuk-summary-list__value">
<%= claim.school.ukprn %>
</dd>
</div>
</dl>
</div>
2 changes: 1 addition & 1 deletion app/views/admin/tasks/arrival_date.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<%= render "shared/error_summary", instance: @task, errored_field_id_overrides: { "passed": "task_passed_true" } if @task.errors.any? %>

<div class="govuk-grid-row">
<%= render "claim_summary", claim: @claim, heading: "Arrival date" %>
<%= render claim_summary_view, claim: @claim, heading: "Arrival date" %>

<div class="govuk-grid-column-two-thirds">
<h2 class="govuk-heading-l"><%= @current_task_name.humanize %></h2>
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/tasks/census_subjects_taught.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<div class="govuk-grid-row">

<%= render "claim_summary", claim: @claim, heading: "School workforce census subjects taught" %>
<%= render claim_summary_view, claim: @claim, heading: "School workforce census subjects taught" %>

<div class="govuk-grid-column-two-thirds">
<h2 class="govuk-heading-l"><%= @current_task_name.humanize %></h2>
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/tasks/employment.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<div class="govuk-grid-row">

<%= render "claim_summary", claim: @claim, heading: "Employment" %>
<%= render claim_summary_view, claim: @claim, heading: "Employment" %>

<div class="govuk-grid-column-two-thirds">
<h2 class="govuk-heading-l"><%= @current_task_name.humanize %></h2>
Expand Down
4 changes: 1 addition & 3 deletions app/views/admin/tasks/employment_contract.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<%= render "shared/error_summary", instance: @task, errored_field_id_overrides: { "passed": "task_passed_true" } if @task.errors.any? %>

<div class="govuk-grid-row">
<%= render "claim_summary", claim: @claim, heading: "Employment contract check" %>
<%= render claim_summary_view, claim: @claim, heading: "Employment contract check" %>

<div class="govuk-grid-column-two-thirds">
<h2 class="govuk-heading-l"><%= @current_task_name.humanize %></h2>
Expand All @@ -23,5 +23,3 @@
<%= render partial: "admin/task_pagination" %>
</div>
</div>


2 changes: 1 addition & 1 deletion app/views/admin/tasks/employment_start.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<%= render "shared/error_summary", instance: @task, errored_field_id_overrides: { "passed": "task_passed_true" } if @task.errors.any? %>

<div class="govuk-grid-row">
<%= render "claim_summary", claim: @claim, heading: "Employment start date check" %>
<%= render claim_summary_view, claim: @claim, heading: "Employment start date check" %>

<div class="govuk-grid-column-two-thirds">
<h2 class="govuk-heading-l"><%= @current_task_name.humanize %></h2>
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/tasks/identity_confirmation.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<div class="govuk-grid-row">

<%= render "claim_summary", claim: @claim, heading: "Identity confirmation" %>
<%= render claim_summary_view, claim: @claim, heading: "Identity confirmation" %>

<div class="govuk-grid-column-two-thirds">
<h2 class="govuk-heading-l"><%= @current_task_name.humanize %></h2>
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/tasks/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<% end %>

<div class="govuk-grid-row">
<%= render "claim_summary", claim: @claim %>
<%= render claim_summary_view, claim: @claim %>
</div>

<div class="govuk-grid-row">
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/tasks/induction_confirmation.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<div class="govuk-grid-row">

<%= render "claim_summary", claim: @claim, heading: "Induction confirmation" %>
<%= render claim_summary_view, claim: @claim, heading: "Induction confirmation" %>

<div class="govuk-grid-column-two-thirds">
<h2 class="govuk-heading-l"><%= @current_task_name.humanize %></h2>
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/tasks/matching_details.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<div class="govuk-grid-row">

<%= render "claim_summary", claim: @claim, heading: "Claims with matching details" %>
<%= render claim_summary_view, claim: @claim, heading: "Claims with matching details" %>

<div class="govuk-grid-column-two-thirds">
<h2 class="govuk-heading-l"><%= @current_task_name.humanize %></h2>
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/tasks/payroll_details.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<%= render "shared/error_summary", instance: @task, errored_field_id_overrides: { "passed": "task_passed_true" } if @task.errors.any? %>

<div class="govuk-grid-row">
<%= render "claim_summary", claim: @claim, heading: "Payroll details" %>
<%= render claim_summary_view, claim: @claim, heading: "Payroll details" %>

<div class="govuk-grid-column-two-thirds">
<h2 class="govuk-heading-l"><%= @current_task_name.humanize %></h2>
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/tasks/payroll_gender.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<div class="govuk-grid-row">

<%= render "claim_summary", claim: @claim, heading: "Payroll gender" %>
<%= render claim_summary_view, claim: @claim, heading: "Payroll gender" %>

<div class="govuk-grid-column-two-thirds">
<h2 class="govuk-heading-l"><%= @current_task_name.humanize %></h2>
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/tasks/qualifications.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<div class="govuk-grid-row">

<%= render "claim_summary", claim: @claim, heading: "Qualifications" %>
<%= render claim_summary_view, claim: @claim, heading: "Qualifications" %>

<div class="govuk-grid-column-two-thirds">
<h2 class="govuk-heading-l"><%= @current_task_name.humanize %></h2>
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/tasks/student_loan_amount.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<div class="govuk-grid-row">

<%= render "claim_summary", claim: @claim, heading: "Student loan amount" %>
<%= render claim_summary_view, claim: @claim, heading: "Student loan amount" %>

<div class="govuk-grid-column-two-thirds">
<h2 class="govuk-heading-l"><%= @current_task_name.humanize %></h2>
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/tasks/student_loan_plan.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<div class="govuk-grid-row">

<%= render "claim_summary", claim: @claim, heading: "Student loan plan type" %>
<%= render claim_summary_view, claim: @claim, heading: "Student loan plan type" %>

<div class="govuk-grid-column-two-thirds">
<h2 class="govuk-heading-l"><%= @current_task_name.humanize %></h2>
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/tasks/subject.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<%= render "shared/error_summary", instance: @task, errored_field_id_overrides: { "passed": "task_passed_true" } if @task.errors.any? %>

<div class="govuk-grid-row">
<%= render "claim_summary", claim: @claim, heading: "Subject check" %>
<%= render claim_summary_view, claim: @claim, heading: "Subject check" %>

<div class="govuk-grid-column-two-thirds">
<h2 class="govuk-heading-l"><%= @current_task_name.humanize %></h2>
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/tasks/teaching_hours.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<%= render "shared/error_summary", instance: @task, errored_field_id_overrides: { "passed": "task_passed_true" } if @task.errors.any? %>

<div class="govuk-grid-row">
<%= render "claim_summary", claim: @claim, heading: "Subject check" %>
<%= render claim_summary_view, claim: @claim, heading: "Subject check" %>

<div class="govuk-grid-column-two-thirds">
<h2 class="govuk-heading-l"><%= @current_task_name.humanize %></h2>
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/tasks/visa.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<%= render "shared/error_summary", instance: @task, errored_field_id_overrides: { "passed": "task_passed_true" } if @task.errors.any? %>

<div class="govuk-grid-row">
<%= render "claim_summary", claim: @claim, heading: "Visa check" %>
<%= render claim_summary_view, claim: @claim, heading: "Visa check" %>

<div class="govuk-grid-column-two-thirds">
<h2 class="govuk-heading-l"><%= @current_task_name.humanize %></h2>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,5 +122,9 @@
}
end
end

trait :with_trn do
teacher_reference_number { generate(:teacher_reference_number) }
end
end
end
Loading
Loading