Skip to content

Commit

Permalink
Claim Summary for FE
Browse files Browse the repository at this point in the history
  • Loading branch information
alkesh committed Sep 5, 2024
1 parent ac8e470 commit 3056a32
Show file tree
Hide file tree
Showing 33 changed files with 255 additions and 46 deletions.
1 change: 1 addition & 0 deletions app/controllers/admin/amendments_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ class Admin::AmendmentsController < Admin::BaseAdminController
before_action :load_claim
before_action :ensure_service_operator
before_action :ensure_claim_is_amendable
before_action :set_claim_summary_view, only: [:index]

def index
end
Expand Down
5 changes: 5 additions & 0 deletions app/controllers/admin/base_admin_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,10 @@ def clear_session
session.delete(:role_codes)
session.delete(:claims_backlink_path)
end

def set_claim_summary_view
policy_append = @claim.policy.to_s.underscore if @claim.policy.is_a?(Policies::FurtherEducationPayments)
@claim_summary_view = ["claim_summary", policy_append].compact.join("_")
end
end
end
1 change: 1 addition & 0 deletions app/controllers/admin/claims_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ def hold
redirect_to admin_claim_notes_path(@claim)
else
@note = Note.new
set_claim_summary_view
render "admin/notes/index"
end
end
Expand Down
1 change: 1 addition & 0 deletions app/controllers/admin/decisions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ class Admin::DecisionsController < Admin::BaseAdminController
before_action :reject_decided_claims, unless: -> { qa_decision_task? }
before_action :reject_missing_payroll_gender, only: [:create]
before_action :reject_if_claims_preventing_payment, only: [:create]
before_action :set_claim_summary_view

def new
@decision = Decision.new
Expand Down
1 change: 1 addition & 0 deletions app/controllers/admin/notes_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ module Admin
class NotesController < BaseAdminController
before_action :ensure_service_operator
before_action :load_claim
before_action :set_claim_summary_view

def index
@note = Note.new
Expand Down
1 change: 1 addition & 0 deletions app/controllers/admin/payments_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ class PaymentsController < BaseAdminController
before_action :ensure_service_operator
before_action :find_payroll_run, except: [:index]
before_action :find_payment, except: [:index]
before_action :set_claim_summary_view, only: [:index]

def index
@claim = Claim.find(params[:claim_id])
Expand Down
1 change: 1 addition & 0 deletions app/controllers/admin/support_tickets_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ module Admin
class SupportTicketsController < BaseAdminController
before_action :ensure_service_operator
before_action :load_claim
before_action :set_claim_summary_view

def create
@support_ticket = @claim.build_support_ticket(support_ticket_params)
Expand Down
1 change: 1 addition & 0 deletions app/controllers/admin/tasks_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ class Admin::TasksController < Admin::BaseAdminController
before_action :load_claim
before_action :ensure_task_has_not_already_been_completed, only: [:create]
before_action :load_matching_claims, only: [:show], if: -> { params[:name] == "matching_details" }
before_action :set_claim_summary_view

def index
@claim_checking_tasks = ClaimCheckingTasks.new(@claim)
Expand Down
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
Loading

0 comments on commit 3056a32

Please sign in to comment.