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

Fix filters with complex object are not removed from the UI #9898

Merged
merged 3 commits into from
Jun 11, 2024

Conversation

hmatthieu
Copy link
Contributor

When filters with a complex object as defaultValue the "empty value" was not considered empty by the UI. This commit ensure we don't display empty filters on the UI.

Refs: #9893

When filters with a complex object as defaultValue
the "empty value" was not considered empty by the UI.
This commit ensure we don't display empty filters on the
UI.

Refs: marmelab#9893
@hmatthieu
Copy link
Contributor Author

I reviewed the logic around the reset form behavior a bit. In my opinion, it could be simplified, but I don't want to risk removing code that seems overkill. The changes I made in this PR aim to reduce breaking changes and simply address the UI issue that was originally reported.

@djhi
Copy link
Contributor

djhi commented Jun 4, 2024

Thanks for the PR! Would you mind adding a test for it?

@hmatthieu
Copy link
Contributor Author

Tests added

@adguernier adguernier self-requested a review June 5, 2024 14:57
@adguernier
Copy link
Contributor

Thanks for your work 💪 Waiting for another review

@adguernier adguernier changed the title fix: Filters visibility after user clicks "Remove filter" button Fix filters with complex object are not removed from the UI Jun 5, 2024
@hmatthieu
Copy link
Contributor Author

I'll review the failing test

@hmatthieu
Copy link
Contributor Author

I added a fix (to fix the test :x). I tested on my local setup, with a real chrome & firefox (managed by cypress). Was working properly. From my XP, those failing tests comes from CPU perfs and bad starting conditions for the test. I added a condition where we wait for an element to be present (which is safe than waiting for an element that is not present).

I also removed a .only that was forgotten there.

@@ -9,10 +9,10 @@ describe('Mobile UI', () => {
});

describe('Infinite Scroll', () => {
it.only('should load more items when scrolling to the bottom of the page', () => {
it('should load more items when scrolling to the bottom of the page', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

😱

Copy link
Contributor

@djhi djhi left a comment

Choose a reason for hiding this comment

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

Thanks!

@djhi djhi added this to the 4.16.19 milestone Jun 11, 2024
@djhi djhi merged commit c2c7dbf into marmelab:master Jun 11, 2024
11 checks passed
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.

3 participants