-
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 Claim::CardComponent - Add pagination count to Support Claims page heading and title - Add search bar to filter claims by reference number
- Loading branch information
1 parent
5fa9ae8
commit 9b105c8
Showing
12 changed files
with
172 additions
and
31 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
@import "claim/card"; | ||
@import "autocomplete"; | ||
@import "content_header"; | ||
@import "header"; | ||
|
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,46 @@ | ||
.claim-card { | ||
display: flex; | ||
flex-direction: column; | ||
gap: govuk-spacing(1); | ||
border-bottom: 1px solid $govuk-border-colour; | ||
padding: govuk-spacing(2) 0; | ||
margin-bottom: govuk-spacing(1); | ||
|
||
.claim-card__header { | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: flex-start; | ||
flex-wrap: wrap; | ||
|
||
.claim-card__header__name { | ||
display: flex; | ||
gap: govuk-spacing(1); | ||
|
||
&.govuk-heading-s { | ||
margin-bottom: govuk-spacing(1); | ||
} | ||
} | ||
} | ||
|
||
.claim-card__body { | ||
display: flex; | ||
justify-content: space-between; | ||
gap: govuk-spacing(2); | ||
|
||
.claim-card__body__provider { | ||
flex-grow: 1; | ||
max-width: 66%; | ||
} | ||
|
||
.claim-card__body__right { | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: space-between; | ||
align-items: flex-end; | ||
} | ||
|
||
.govuk-body-s { | ||
margin-bottom: govuk-spacing(1); | ||
} | ||
} | ||
} |
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,20 @@ | ||
<div class="claim-card"> | ||
<div class="claim-card__header"> | ||
<div class="claim-card__header__name govuk-heading-s"> | ||
<%= govuk_link_to claim.school.name, claims_support_claim_path(claim), no_visited_state: true %> | ||
<span class="govuk-caption-m"><%= claim.reference %></span> | ||
</div> | ||
<div><%= render Claim::StatusTagComponent.new(claim:, classes: %w[govuk-body-s]) %></div> | ||
</div> | ||
|
||
<div class="claim-card__body"> | ||
<div class="claim-card__body__provider"> | ||
<div class="govuk-body-s"><%= claim.provider.name %></div> | ||
</div> | ||
|
||
<div class="claim-card__body__right"> | ||
<div class="govuk-body-s"><%= l(claim.created_at.to_date, format: :short) %></div> | ||
<div class="govuk-body-s"><%= humanized_money_with_symbol(claim.amount) %></div> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
class Claim::CardComponent < ApplicationComponent | ||
attr_reader :claim | ||
|
||
def initialize(claim:, classes: [], html_attributes: {}) | ||
super(classes:, html_attributes:) | ||
|
||
@claim = claim | ||
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
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,27 @@ | ||
require "rails_helper" | ||
|
||
RSpec.describe Claim::CardComponent, type: :component do | ||
include Rails.application.routes.url_helpers | ||
|
||
subject(:component) { described_class.new(claim:) } | ||
|
||
let(:claim) do | ||
create(:claim, :submitted, created_at: "2024/04/08", school:) do |claim| | ||
claim.mentor_trainings << create(:mentor_training, hours_completed: 20) | ||
end | ||
end | ||
|
||
let(:school) { create(:claims_school, region: regions(:inner_london)) } | ||
|
||
it "renders a card with claim details" do | ||
render_inline(component) | ||
|
||
expect(page).to have_link(claim.school.name, href: claims_support_claim_path(claim)) | ||
expect(page).to have_content(claim.reference) | ||
expect(page).to have_content("Submitted") | ||
|
||
expect(page).to have_content(claim.provider.name) | ||
expect(page).to have_content("08/04/2024") | ||
expect(page).to have_content("£1,072") | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
class Claim::CardComponentPreview < ApplicationComponentPreview | ||
def default | ||
render Claim::CardComponent.new(claim:) | ||
end | ||
|
||
private | ||
|
||
def claim | ||
Claims::Claim.submitted.first | ||
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