Skip to content

Commit

Permalink
Update status colour tags according to latest designs
Browse files Browse the repository at this point in the history
  • Loading branch information
dp-daly authored and Kizr committed Jan 17, 2025
1 parent 9d4b8cc commit 6204520
Show file tree
Hide file tree
Showing 13 changed files with 53 additions and 53 deletions.
24 changes: 12 additions & 12 deletions app/components/claim/status_tag_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,19 @@ def colour
def status_colours
{
internal_draft: "grey",
draft: "grey",
submitted: "blue",
payment_in_progress: "turquoise",
payment_information_requested: "light-blue",
draft: "yellow",
submitted: "turquoise",
payment_in_progress: "yellow",
payment_information_requested: "turquoise",
payment_information_sent: "yellow",
paid: "green",
payment_not_approved: "red",
sampling_in_progress: "purple",
sampling_provider_not_approved: "pink",
sampling_not_approved: "pink",
clawback_requested: "orange",
clawback_in_progress: "orange",
clawback_complete: "red",
paid: "blue",
payment_not_approved: "orange",
sampling_in_progress: "yellow",
sampling_provider_not_approved: "turquoise",
sampling_not_approved: "turquoise",
clawback_requested: "turquoise",
clawback_in_progress: "yellow",
clawback_complete: "blue",
}.with_indifferent_access
end
end
48 changes: 24 additions & 24 deletions spec/components/claim/status_tag_component_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,32 +18,32 @@
context "when the claim's status is 'draft'" do
let(:claim) { build(:claim, status: :draft) }

it "renders a grey tag" do
expect(page).to have_css(".govuk-tag--grey", text: "Draft")
it "renders a yellow tag" do
expect(page).to have_css(".govuk-tag--yellow", text: "Draft")
end
end

context "when the claim's status is 'submitted'" do
let(:claim) { build(:claim, status: :submitted) }

it "renders a blue tag" do
expect(page).to have_css(".govuk-tag--blue", text: "Submitted")
it "renders a turquoise tag" do
expect(page).to have_css(".govuk-tag--turquoise", text: "Submitted")
end
end

context "when the claim's status is 'payment_in_progress'" do
let(:claim) { build(:claim, status: :payment_in_progress) }

it "renders a turquoise tag" do
expect(page).to have_css(".govuk-tag--turquoise", text: "Payment in progress")
it "renders a yellow tag" do
expect(page).to have_css(".govuk-tag--yellow", text: "Payment in progress")
end
end

context "when the claim's status is 'payment_information_requested'" do
let(:claim) { build(:claim, status: :payment_information_requested) }

it "renders a light blue tag" do
expect(page).to have_css(".govuk-tag--light-blue", text: "Information requested")
it "renders a turquoise tag" do
expect(page).to have_css(".govuk-tag--turquoise", text: "Information requested")
end
end

Expand All @@ -58,64 +58,64 @@
context "when the claim's status is 'paid'" do
let(:claim) { build(:claim, status: :paid) }

it "renders a green tag" do
expect(page).to have_css(".govuk-tag--green", text: "Paid")
it "renders a blue tag" do
expect(page).to have_css(".govuk-tag--blue", text: "Paid")
end
end

context "when the claim's status is 'payment_not_approved'" do
let(:claim) { build(:claim, status: :payment_not_approved) }

it "renders a red tag" do
expect(page).to have_css(".govuk-tag--red", text: "Payment not approved")
it "renders a orange tag" do
expect(page).to have_css(".govuk-tag--orange", text: "Payment not approved")
end
end

context "when the claim's status is 'sampling_in_progress'" do
let(:claim) { build(:claim, status: :sampling_in_progress) }

it "renders a purple tag" do
expect(page).to have_css(".govuk-tag--purple", text: "Sampling in progress")
it "renders a yellow tag" do
expect(page).to have_css(".govuk-tag--yellow", text: "Sampling in progress")
end
end

context "when the claim's status is 'sampling_provider_not_approved'" do
let(:claim) { build(:claim, status: :sampling_provider_not_approved) }

it "renders a pink tag" do
expect(page).to have_css(".govuk-tag--pink", text: "Provider not approved")
it "renders a turquoise tag" do
expect(page).to have_css(".govuk-tag--turquoise", text: "Provider not approved")
end
end

context "when the claim's status is 'sampling_not_approved'" do
let(:claim) { build(:claim, status: :sampling_not_approved) }

it "renders a pink tag" do
expect(page).to have_css(".govuk-tag--pink", text: "Claim not approved")
it "renders a turquoise tag" do
expect(page).to have_css(".govuk-tag--turquoise", text: "Claim not approved")
end
end

context "when the claim's status is 'clawback_requested'" do
let(:claim) { build(:claim, status: :clawback_requested) }

it "renders a orange tag" do
expect(page).to have_css(".govuk-tag--orange", text: "Clawback requested")
it "renders a turquoise tag" do
expect(page).to have_css(".govuk-tag--turquoise", text: "Clawback requested")
end
end

context "when the claim's status is 'clawback_in_progress'" do
let(:claim) { build(:claim, status: :clawback_in_progress) }

it "renders a orange tag" do
expect(page).to have_css(".govuk-tag--orange", text: "Clawback in progress")
it "renders a yellow tag" do
expect(page).to have_css(".govuk-tag--yellow", text: "Clawback in progress")
end
end

context "when the claim's status is 'clawback_complete'" do
let(:claim) { build(:claim, status: :clawback_complete) }

it "renders a red tag" do
expect(page).to have_css(".govuk-tag--red", text: "Clawback complete")
it "renders a blue tag" do
expect(page).to have_css(".govuk-tag--blue", text: "Clawback complete")
end
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def then_i_see_the_show_page_for_claim_one
expect(primary_navigation).to have_current_item("Claims")
expect(page).to have_element(:span, text: "Clawbacks - Claim 11111111", class: "govuk-caption-l")
expect(page).to have_h1(@claim_one.school_name)
expect(page).to have_element(:strong, text: "Claim not approved", class: "govuk-tag govuk-tag--pink")
expect(page).to have_element(:strong, text: "Claim not approved", class: "govuk-tag govuk-tag--turquoise")
expect(page).to have_link("Request clawback", href: "/support/claims/clawbacks/claims/new/#{@claim_one.id}")
expect(page).to have_summary_list_row("School", @claim_one.school_name)
expect(page).to have_summary_list_row("Academic year", @claim_one.academic_year_name)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,6 @@ def then_i_see_the_details_of_the_clawback_requested_claim
)
expect(page).to have_element(:span, text: "Clawbacks - Claim #{@clawback_requested_claim.reference}", class: "govuk-caption-l")
expect(page).to have_h1(@clawback_requested_claim.school.name)
expect(page).to have_element(:strong, text: "Clawback requested", class: "govuk-tag govuk-tag--orange")
expect(page).to have_element(:strong, text: "Clawback requested", class: "govuk-tag govuk-tag--turquoise")
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def then_i_see_the_details_of_the_claim
)
expect(page).to have_element(:p, text: "Sampling - Claim #{@claim.reference}", class: "govuk-caption-l")
expect(page).to have_h1(@claim.school.name)
expect(page).to have_element(:strong, text: "Sampling in progress", class: "govuk-tag govuk-tag--purple")
expect(page).to have_element(:strong, text: "Sampling in progress", class: "govuk-tag govuk-tag--yellow")
end

def when_i_click_on_confirm_provider_rejected_claim
Expand All @@ -108,7 +108,7 @@ def then_i_see_that_the_claim_has_been_updated_to_provider_not_approved
)
expect(page).to have_h1(@claim.school.name)

expect(page).to have_element(:strong, text: "Provider not approved", class: "govuk-tag govuk-tag--pink")
expect(page).to have_element(:strong, text: "Provider not approved", class: "govuk-tag govuk-tag--turquoise")
expect(page).to have_success_banner("Claim updated")
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def then_i_see_the_details_of_the_claim
)
expect(page).to have_element(:p, text: "Sampling - Claim #{@claim.reference}", class: "govuk-caption-l")
expect(page).to have_h1(@claim.school.name)
expect(page).to have_element(:strong, text: "Sampling in progress", class: "govuk-tag govuk-tag--purple")
expect(page).to have_element(:strong, text: "Sampling in progress", class: "govuk-tag govuk-tag--yellow")
end

def when_i_click_on_confirm_provider_rejected_claim
Expand All @@ -103,7 +103,7 @@ def then_i_see_that_the_claim_has_been_updated_to_provider_not_approved
)
expect(page).to have_h1(@claim.school.name)

expect(page).to have_element(:strong, text: "Provider not approved", class: "govuk-tag govuk-tag--pink")
expect(page).to have_element(:strong, text: "Provider not approved", class: "govuk-tag govuk-tag--turquoise")
expect(page).to have_success_banner("Claim updated")
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def then_i_see_the_details_of_the_claim
)
expect(page).to have_element(:p, text: "Sampling - Claim #{@claim.reference}", class: "govuk-caption-l")
expect(page).to have_h1(@claim.school.name)
expect(page).to have_element(:strong, text: "Sampling in progress", class: "govuk-tag govuk-tag--purple")
expect(page).to have_element(:strong, text: "Sampling in progress", class: "govuk-tag govuk-tag--yellow")
end

def when_i_click_on_confirm_provider_rejected_claim
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def then_i_see_the_details_of_the_claim
)
expect(page).to have_element(:p, text: "Sampling - Claim #{@claim.reference}", class: "govuk-caption-l")
expect(page).to have_h1(@claim.school.name)
expect(page).to have_element(:strong, text: "Sampling in progress", class: "govuk-tag govuk-tag--purple")
expect(page).to have_element(:strong, text: "Sampling in progress", class: "govuk-tag govuk-tag--yellow")
end

def when_i_click_on_confirm_provider_rejected_claim
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def then_i_see_the_details_of_the_claim
)
expect(page).to have_element(:p, text: "Sampling - Claim #{@claim.reference}", class: "govuk-caption-l")
expect(page).to have_h1(@claim.school.name)
expect(page).to have_element(:strong, text: "Sampling in progress", class: "govuk-tag govuk-tag--purple")
expect(page).to have_element(:strong, text: "Sampling in progress", class: "govuk-tag govuk-tag--yellow")
end

def when_i_click_on_confirm_provider_rejected_claim
Expand All @@ -152,7 +152,7 @@ def then_i_see_that_the_claim_has_been_updated_to_provider_not_approved
)
expect(page).to have_h1(@claim.school.name)

expect(page).to have_element(:strong, text: "Provider not approved", class: "govuk-tag govuk-tag--pink")
expect(page).to have_element(:strong, text: "Provider not approved", class: "govuk-tag govuk-tag--turquoise")
expect(page).to have_success_banner("Claim updated")
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def then_i_see_the_details_of_the_claim
)
expect(page).to have_element(:p, text: "Sampling - Claim #{@claim.reference}", class: "govuk-caption-l")
expect(page).to have_h1(@claim.school.name)
expect(page).to have_element(:strong, text: "Provider not approved", class: "govuk-tag govuk-tag--pink")
expect(page).to have_element(:strong, text: "Provider not approved", class: "govuk-tag govuk-tag--turquoise")
end

def when_i_click_on_reject_claim
Expand All @@ -102,7 +102,7 @@ def then_i_see_that_the_claim_has_been_updated_to_not_approved
)
expect(page).to have_h1(@claim.school.name)

expect(page).to have_element(:strong, text: "Claim not approved", class: "govuk-tag govuk-tag--pink")
expect(page).to have_element(:strong, text: "Claim not approved", class: "govuk-tag govuk-tag--turquoise")
expect(page).to have_success_banner("Claim updated")
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def then_i_see_the_details_of_the_claim
)
expect(page).to have_element(:p, text: "Sampling - Claim #{@claim.reference}", class: "govuk-caption-l")
expect(page).to have_h1(@claim.school.name)
expect(page).to have_element(:strong, text: "Provider not approved", class: "govuk-tag govuk-tag--pink")
expect(page).to have_element(:strong, text: "Provider not approved", class: "govuk-tag govuk-tag--turquoise")
end

def when_i_click_on_reject_claim
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def then_i_see_the_details_of_the_claim
)
expect(page).to have_element(:p, text: "Sampling - Claim #{@claim.reference}", class: "govuk-caption-l")
expect(page).to have_h1(@claim.school.name)
expect(page).to have_element(:strong, text: "Provider not approved", class: "govuk-tag govuk-tag--pink")
expect(page).to have_element(:strong, text: "Provider not approved", class: "govuk-tag govuk-tag--turquoise")
end

def when_i_click_on_reject_claim
Expand All @@ -160,7 +160,7 @@ def then_i_see_that_the_claim_has_been_updated_to_not_approved
)
expect(page).to have_h1(@claim.school.name)

expect(page).to have_element(:strong, text: "Claim not approved", class: "govuk-tag govuk-tag--pink")
expect(page).to have_element(:strong, text: "Claim not approved", class: "govuk-tag govuk-tag--turquoise")
expect(page).to have_success_banner("Claim updated")
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def then_i_see_the_details_of_the_sampling_claim
)
expect(page).to have_element(:p, text: "Sampling - Claim #{@sampling_claim.reference}", class: "govuk-caption-l")
expect(page).to have_h1(@sampling_claim.school.name)
expect(page).to have_element(:strong, text: "Sampling in progress", class: "govuk-tag govuk-tag--purple")
expect(page).to have_element(:strong, text: "Sampling in progress", class: "govuk-tag govuk-tag--yellow")
end

def when_i_click_on_back
Expand Down Expand Up @@ -151,6 +151,6 @@ def then_i_see_there_are_two_paid_claims
expect(page).to have_h2("Claims (2)")
expect(page).to have_link("#{@sampling_claim.reference} - #{@sampling_claim.school.name}", href: "/support/claims/#{@sampling_claim.id}")
expect(page).to have_link("#{@paid_claim.reference} - #{@paid_claim.school.name}", href: "/support/claims/#{@paid_claim.id}")
expect(page).to have_element(:strong, text: "Paid", class: "govuk-tag govuk-tag--green", count: 2)
expect(page).to have_element(:strong, text: "Paid", class: "govuk-tag govuk-tag--blue", count: 2)
end
end

0 comments on commit 6204520

Please sign in to comment.