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: wip - reset filters button #3085

Open
wants to merge 3 commits into
base: mcm/feat-filter-closing
Choose a base branch
from

Conversation

mcmcgrath13
Copy link
Collaborator

@mcmcgrath13 mcmcgrath13 commented Dec 23, 2024

PULL REQUEST

Summary

(Note this is into PR #3084)

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

Copy link

codecov bot commented Dec 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.49%. Comparing base (f535b28) to head (ba80d63).

Additional details and impacted files
@@                     Coverage Diff                     @@
##           mcm/feat-filter-closing    #3085      +/-   ##
===========================================================
+ Coverage                    88.41%   88.49%   +0.08%     
===========================================================
  Files                           80       80              
  Lines                         4126     4139      +13     
  Branches                       696      686      -10     
===========================================================
+ Hits                          3648     3663      +15     
- Misses                         456      467      +11     
+ Partials                        22        9      -13     
Flag Coverage Δ
ecr-viewer 89.98% <100.00%> (+0.12%) ⬆️
orchestration 85.67% <ø> (ø)

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.11% <100.00%> (+2.49%) ⬆️

... and 5 files with indirect coverage changes

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.

1 participant