Skip to content
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 4 commits into from
Apr 8, 2024
Merged

Update Support Claims page #451

merged 4 commits into from
Apr 8, 2024

Conversation

Nitemaeric
Copy link
Contributor

@Nitemaeric Nitemaeric commented Apr 5, 2024

Context

We want to allow Support Users to see the list of all submitted Claims.

Changes proposed in this pull request

  • Refactored shared/_search_form.html.erb to become a generic UI component. (Could possibly be further refactored into a View Component)
  • Updated Money.default_backend to :i18n.
  • Update the Claims::StatusTagComponent to use govuk_tag instead of content_tag(:p).
  • Add a Claim::CardComponent and use it on the support claims page.
  • Use the updated shared/_search_form partial to render the search bar for claims with a smaller label.

Guidance to review

  • By updating the search_form partial, I've had to make some adjustments to the School Placements code. cc: @DFE-Digital/school-placements

  • RubyMoney provides 2 modern default localisation strategies, currency and i18n. I've opted to using i18n since our users should all be British, but it shouldn't make a difference in our use-case.

    • currency uses the currency's defaults to format a money value.

      USD — $1,234,567.89
      BAD — $1,234,567.89
      GBP — £1,234,567.89
      EUR — €1.234.567,89

    • i18n uses the locale to determine formatting.

      en-GB - £1,234,567.89
      en-GB - €1,234,567.89

  • Use the govuk_tag component in the Claim::StatusTagComponent. As the fundamental UI component is based on the govuk tag, it should keep things more consistent.

  • Check if the CSS for the Claims::CardComponent could be cleaner?

Screenshots

Before After
CleanShot 2024-04-05 at 16 45 45 CleanShot 2024-04-05 at 16 51 37

@Nitemaeric Nitemaeric added the deploy A Review App will be created for PRs with this label label Apr 5, 2024
@Nitemaeric Nitemaeric self-assigned this Apr 5, 2024
@Nitemaeric Nitemaeric changed the title Add Support Claims page [WIP] Add Support Claims page Apr 5, 2024
Copy link

github-actions bot commented Apr 5, 2024

Use `name` for the search field name, as standard form field helpers use.

Use `value` for the search field input value, as standard form field helpers use. Also default to `params[name]`.

The `label` argument now accepts a hash with `text` and `size`. This is to allow the customisation of the label font size.
This defaults money formatting to use commas for thousands separators with the default `en` locale.
@Nitemaeric Nitemaeric force-pushed the dd/style-support-claims-list branch from 503f887 to 43f89a0 Compare April 8, 2024 09:40
@Nitemaeric Nitemaeric force-pushed the dd/style-support-claims-list branch from 43f89a0 to 603bac9 Compare April 8, 2024 09:48
@Nitemaeric Nitemaeric marked this pull request as ready for review April 8, 2024 10:03
@Nitemaeric Nitemaeric requested review from a team as code owners April 8, 2024 10:03
@Nitemaeric Nitemaeric changed the title [WIP] Add Support Claims page Add Support Claims page Apr 8, 2024
@Nitemaeric Nitemaeric changed the title Add Support Claims page Update Support Claims page Apr 8, 2024
Copy link
Contributor

@CatalinVoineag CatalinVoineag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall this looks very good to me, nice 👍🏻

@@ -0,0 +1,9 @@
class Claim::CardComponent < ApplicationComponent
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

@Nitemaeric Nitemaeric force-pushed the dd/style-support-claims-list branch from 603bac9 to 45218c7 Compare April 8, 2024 13:53
- Add Claim::CardComponent
- Add pagination count to Support Claims page heading and title
- Add search bar to filter claims by reference number
@Nitemaeric Nitemaeric merged commit 9b105c8 into main Apr 8, 2024
7 checks passed
@Nitemaeric Nitemaeric deleted the dd/style-support-claims-list branch April 8, 2024 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deploy A Review App will be created for PRs with this label
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants