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

feat: reset filters button #3085

Merged
merged 56 commits into from
Jan 6, 2025
Merged

feat: reset filters button #3085

merged 56 commits into from
Jan 6, 2025

Conversation

mcmcgrath13
Copy link
Collaborator

@mcmcgrath13 mcmcgrath13 commented Dec 23, 2024

PULL REQUEST

Summary

Add a Reset button when the filters are not in their default states. Make sure the reset button updates both the URL and the UI.

This ended up being a tiny bit finnicky and is a "two step" process. 1. Update the URL. 2. Listen for URL updates to reset the UI. Suggestions for streamlining very welcome.

Related Issue

Fixes #2992

Acceptance Criteria

  • If any filtering is applied, a Reset button should be visible in the filter bar
  • Clicking the reset button should reset all filters currently applied to its default state.
    • Default state for date filter: Last 24 hours
    • Default state for conditions filter: All conditions should be checkmarked/shown, and
    • URL query params should reflect default state of filters after Reset button is clicked.
    • If a filter box is open when the Reset button is clicked, then the filter box should close automatically.
  • If no filtering is applied, the Reset button should NOT appear in the filter bar
  • Reset button is styled according to the Figma designs (& should include USWDS icon)
  • Unit test(s) have been added/modified to test the reset button functionality.

Additional Information

image

angelathe and others added 30 commits December 13, 2024 14:39
* refactor: moar abstraction

* tiny nits, update tests

* fix test

---------

Co-authored-by: angelathe <[email protected]>
Co-authored-by: Mary McGrath <[email protected]>
Copy link

codecov bot commented Dec 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.19%. Comparing base (6f59c59) to head (5a23521).
Report is 8 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3085      +/-   ##
==========================================
+ Coverage   86.82%   89.19%   +2.37%     
==========================================
  Files         219       82     -137     
  Lines       13612     4222    -9390     
  Branches      705      716      +11     
==========================================
- Hits        11818     3766    -8052     
+ Misses       1785      436    -1349     
- Partials        9       20      +11     
Flag Coverage Δ
ecr-viewer 90.99% <100.00%> (+0.96%) ⬆️
fhir-converter ?
ingestion ?
message-parser ?
message-refiner ?
orchestration 85.67% <ø> (ø)
record-linkage ?
trigger-code-reference ?
validation ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...iners/ecr-viewer/src/app/components/BaseFilter.tsx 90.90% <100.00%> (+0.58%) ⬆️
...ntainers/ecr-viewer/src/app/components/Filters.tsx 96.15% <100.00%> (+2.40%) ⬆️

... and 148 files with indirect coverage changes

@mcmcgrath13 mcmcgrath13 marked this pull request as ready for review December 24, 2024 00:43
@mcmcgrath13 mcmcgrath13 changed the title feat: wip - reset filters button feat: reset filters button Jan 2, 2025
Base automatically changed from mcm/feat-filter-closing to main January 3, 2025 14:20
Copy link
Collaborator

@angelathe angelathe left a comment

Choose a reason for hiding this comment

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

Looks good! 🎉 Just two small questions

containers/ecr-viewer/src/styles/utilities.scss Outdated Show resolved Hide resolved
@mcmcgrath13 mcmcgrath13 added this pull request to the merge queue Jan 6, 2025
Merged via the queue into main with commit 0d2f477 Jan 6, 2025
14 checks passed
@mcmcgrath13 mcmcgrath13 deleted the mcm/feat-filter-reset branch January 6, 2025 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add filter reset button to eCR Library
2 participants