-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add clawback index page and separate show page route and view
- Loading branch information
Showing
28 changed files
with
1,672 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
app/controllers/claims/support/claims/clawbacks_controller.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,52 @@ | ||
class Claims::Support::Claims::ClawbacksController < Claims::Support::ApplicationController | ||
before_action :skip_authorization | ||
before_action :set_filtered_claims, only: %i[index] | ||
before_action :set_claim, only: %i[show] | ||
helper_method :filter_form | ||
|
||
def index | ||
@pagy, @claims = pagy( | ||
@filtered_claims.where(status: %i[clawback_requested clawback_in_progress sampling_not_approved]), | ||
) | ||
end | ||
|
||
def show; end | ||
|
||
private | ||
|
||
def set_filtered_claims | ||
@filtered_claims = Claims::ClaimsQuery.call(params: filter_form.query_params) | ||
end | ||
|
||
def filter_form | ||
Claims::Support::Claims::FilterForm.new(filter_params) | ||
end | ||
|
||
def set_claim | ||
@claim = Claims::Claim.find(params.require(:id)) | ||
end | ||
|
||
def filter_params | ||
params.fetch(:claims_support_claims_filter_form, {}).permit( | ||
:search, | ||
:search_school, | ||
:search_provider, | ||
"submitted_after(1i)", | ||
"submitted_after(2i)", | ||
"submitted_after(3i)", | ||
"submitted_before(1i)", | ||
"submitted_before(2i)", | ||
"submitted_before(3i)", | ||
:submitted_after, | ||
:submitted_before, | ||
provider_ids: [], | ||
school_ids: [], | ||
statuses: [], | ||
academic_year_ids: [], | ||
).with_defaults(index_path:) | ||
end | ||
|
||
def index_path | ||
claims_support_claims_clawbacks_path | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<%= render "claims/support/primary_navigation", current: :claims %> | ||
<% content_for(:page_title) { sanitize t(".page_title", school_name: @claim.school.name, reference: @claim.reference) } %> | ||
|
||
<% content_for(:before_content) do %> | ||
<%= govuk_back_link href: claims_support_claims_path %> | ||
<% end %> | ||
|
||
<div class="govuk-width-container"> | ||
<div class="govuk-grid-row"> | ||
<div class="govuk-grid-column-two-thirds"> | ||
<p class="govuk-caption-l"><%= t(".page_caption", reference: @claim.reference) %></p> | ||
<h1 class="govuk-heading-l"><%= @claim.school.name %> <%= render Claim::StatusTagComponent.new(claim: @claim) %></h1> | ||
|
||
<% if @claim.submitted? %> | ||
<p class="govuk-body"><%= t(".submitted_by", name: @claim.submitted_by.full_name, date: l(@claim.submitted_on, format: :long)) %></p> | ||
<% end %> | ||
|
||
<%= render "claims/support/claims/details", claim: @claim %> | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ en: | |
claim: | ||
card_component: | ||
claim_title: "%{reference} - %{school_name}" | ||
clawback_amount: Clawback amount |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.