-
Notifications
You must be signed in to change notification settings - Fork 32
LPD-68453 Clear filters button doesn't fully clear all filters #166833
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
Conversation
When a filter is active on initial load due to `preloadedData`, clicking the "Clear Filters" button fails to clear the filter from the UI if the user has not interacted with it first. The `deactivateFilter` utility function was directly mutating the filter object, which prevented React from detecting a state change and re-rendering the UI. The function is now updated to return a new, immutable object, ensuring React sees the change and updates the UI correctly.
In the filter resume dropdown, if you unchecked all the selections and then clicked "Delete Filter", the filter resume label would still show for example: "Color:". This is because `setFilter` needs to be able to also set `active: false` but `activateFilter` was always setting `active: true`
When clearing a filter, the history wouldn't be pushed properly and would lead to issues like - The back history button getting stuck on the same state - Unable to move back or forward to a state where a filter was removed
✔️ ci:test:sf - 1 out of 1 jobs passed in 4 minutesRan com.liferay.source.formatter at released version 1.0.1545. Click here for more details.Base Branch:Branch Name: master Sender Branch:Branch Name: LPD-68453_FixFilterClear 1 Successful Jobs:For more details click here. |
|
To conserve resources, the PR Tester does not automatically run for forwarded pull requests. |
✔️ ci:test:stable - 11 out of 11 jobs passed❌ ci:test:relevant - 14 out of 16 jobs passed in 1 hour 3 minutesClick here for more details.Base Branch:Branch Name: master Upstream Comparison:Branch GIT ID: 2018e7596b60007f382316cc000ce88d1994c6fa ci:test:stable - 11 out of 11 jobs PASSED11 Successful Jobs:ci:test:relevant - 14 out of 16 jobs PASSED2 Failed Jobs:
14 Successful Jobs:For more details click here.Failures unique to this pull:For upstream results, click here.Test bundle downloads: |
|
Merged. Thank you. |
Forwarded from: liferay-frontend#5127 (Took 1
ci:forwardattempt in 45 seconds)Console
@thektan
@liferay-frontend
Original pull request comment:
Bug Ticket: https://liferay.atlassian.net/browse/LPD-68453
This fixes the clear filter buttons (in the active filters bar/empty state) to clear the pre-loaded filter. This was previously mutating the object so the component wasn't re-rendering so now it returns a new object. This was also how the logic worked before.
Previously the dispatch looked like: