-
Notifications
You must be signed in to change notification settings - Fork 23
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
[OCPADVISOR-6] Reset filters resets only filters #450
Conversation
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.
I am afraid this feature is not relevant for all of the tables. Specifically, there is a scenario for the recs list table (/recommendations):
- By default, you have two filters enabled: Clusters impacted: 1 or more, and Status: Enabled.
- Remove the first filter, and you will get more recommendations available.
- Navigate to for example page 3 and click Reset filters
- You will get a blank table. This happens because the reset will show you the subset of rules that you saw with the removed default filter, and you don't reset pagination.
Can we make an exception for this table? All other tables seems to be working fine, since resetting to the default filters will always result in showing the same or larger number of items.
src/Components/AffectedClustersTable/AffectedClustersTable.cy.js
Outdated
Show resolved
Hide resolved
src/Components/AffectedClustersTable/AffectedClustersTable.cy.js
Outdated
Show resolved
Hide resolved
1046011
to
66656e2
Compare
@gkarat this is ready for another review |
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.
@@ -110,8 +111,15 @@ const RecsListTable = ({ query }) => { | |||
filters.sortDirection, | |||
]); | |||
|
|||
useEffect(() => { | |||
setFilteredRows(buildFilteredRows(recs, filters)); | |||
useEffect(async () => { |
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.
Why we need to make this useEffect async here?
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.
I added it and forgot to test it again later. It's not needed, so I removed it.
7c5cecf
to
8d5e5a1
Compare
When you click on "Reset filters" values set for pagination and sorting get also reset. This is on every table in the app. This PR ensures that on "Reset filters" click, only filters get reset and not pagination or sorting.
8d5e5a1
to
71b7fa3
Compare
Codecov ReportBase: 87.08% // Head: 86.91% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #450 +/- ##
==========================================
- Coverage 87.08% 86.91% -0.17%
==========================================
Files 25 25
Lines 1154 1162 +8
Branches 442 445 +3
==========================================
+ Hits 1005 1010 +5
- Misses 149 152 +3
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
thanks Michael! looks good to me. and we can ignore the ci.int check: we need to update the test script in a separate PR |
## [1.8.3](v1.8.2...v1.8.3) (2022-11-21) ### Bug Fixes * **Tables:** Reset filters resets only filters ([#450](#450)) ([593664d](593664d))
🎉 This PR is included in version 1.8.3 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Fixes https://issues.redhat.com/browse/OCPADVISOR-6. When you click on "Reset filters" values set for pagination and sorting get also reset. This is on every table in the app. This PR ensures that on "Reset filters" click, only filters get reset and not pagination or sorting.
## [1.8.3](v1.8.2...v1.8.3) (2022-11-21) ### Bug Fixes * **Tables:** Reset filters resets only filters ([#450](#450)) ([593664d](593664d))
Fixes https://issues.redhat.com/browse/OCPADVISOR-6. When you click on "Reset filters" values set for pagination and sorting get also reset. This is on every table in the app. This PR ensures that on "Reset filters" click, only filters get reset and not pagination or sorting.
## [1.8.3](v1.8.2...v1.8.3) (2022-11-21) ### Bug Fixes * **Tables:** Reset filters resets only filters ([#450](#450)) ([593664d](593664d))
When you click on "Reset filters" values set for pagination and sorting get also reset. This is on every table in the app.
This PR ensures that on "Reset filters" click, only filters get reset and not pagination or sorting.