-
Notifications
You must be signed in to change notification settings - Fork 1
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
Update Support Claims page #451
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
047e05c
Update the search_form partial to be more generic
Nitemaeric 1072a0a
Default money localisation to current locale
Nitemaeric 093fc87
Update Claim::StatusTagComponent to use the govuk_tag helper
Nitemaeric 264517a
Update Support Claims page
Nitemaeric File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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 |
---|---|---|
|
@@ -22,5 +22,5 @@ | |
} | ||
end | ||
|
||
Money.locale_backend = nil | ||
Money.locale_backend = :i18n | ||
Money.rounding_mode = BigDecimal::ROUND_HALF_UP |
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 |
---|---|---|
@@ -1,6 +1,5 @@ | ||
en: | ||
shared: | ||
search_form: | ||
search-header: Search by organisation name or postcode | ||
search: Search | ||
clear_search: Clear search | ||
submit: Search | ||
clear: Clear search |
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this need a spec and a preview?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yes, I'll add that. Nice catch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a relatively basic spec for the component, along with a preview.