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

chore: restore filter operator after clearing on filter dropdown #3224

Conversation

leapful
Copy link
Contributor

@leapful leapful commented Dec 14, 2022

Explain the details for making this change. What existing problem does the pull request solve?

By default, "Clear" action from Filter Dropdown is handled by Ant Design by removing filter column value out from list filter. If there is a new value on the filter column again, the mapping has no context on initial filters to restore correct operator.

By providing a map of initial filters, mapping new filters can restore operator in case previous filters is empty or no data on target filter column.

Test plan (required)

  1. Initialize example "refine-airtable-example" with initial filter on column "Title" with { field: 'title', operator: 'contains', value: '' }
  2. Perform filter on column "Title" with keyword "Hello" to see correct results of the keyword
  3. Click "Clear" button then "Filter" button to see correct results of empty filter data
  4. Filter again with keyword "Melih" to see correct results of the keyword

Closing issues

closes #1386

Self Check before Merge

Please check all items below before review.

  • Corresponding issues are created/updated or not needed
  • Docs are updated/provided or not needed
  • Examples are updated/provided or not needed
  • TypeScript definitions are updated/provided or not needed
  • Tests are updated/provided or not needed
  • Changesets are provided or not needed

@changeset-bot
Copy link

changeset-bot bot commented Dec 14, 2022

🦋 Changeset detected

Latest commit: d6bba66

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@netlify
Copy link

netlify bot commented Dec 14, 2022

Deploy Preview for refine-doc-live-previews ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit d6bba66
🔍 Latest deploy log https://app.netlify.com/sites/refine-doc-live-previews/deploys/639999abdf45c90008486345
😎 Deploy Preview https://deploy-preview-3224--refine-doc-live-previews.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

Copy link
Contributor

@IgnusG IgnusG 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 to me 👍

.changeset/fifty-chefs-drive.md Outdated Show resolved Hide resolved
@alicanerdurmaz alicanerdurmaz merged commit a47f179 into refinedev:next Dec 14, 2022
@leapful leapful deleted the bugfix/issue-1386/restore-filter-operator-after-clear-filter-dropdown branch December 19, 2022 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants