feat(antd): add onParse support to useTable and useSimpleList#7473
Open
arunkumarmeda27 wants to merge 3 commits into
Open
feat(antd): add onParse support to useTable and useSimpleList#7473arunkumarmeda27 wants to merge 3 commits into
arunkumarmeda27 wants to merge 3 commits into
Conversation
🦋 Changeset detectedLatest commit: 7f69ea2 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Checklist
Please check if your PR fulfills the following requirements:
Bugs / Features
What is the current behavior?
When using
useTableoruseSimpleListfrom@refinedev/antdwithsyncLocation: trueand an search form viaonSearch, the reverse mapping (URL / Table Filters -> Form Fields) uses a simple field-matching logic. This causes two main limitations:Select.RangePickerarrays constructed from splitting a filter intogteandlteconstraints) cannot be reconstructed.useSimpleListsearch forms had no automated synchronization with URL filters at all.What is the new behavior?
We introduced an optional
onParseparameter touseTablePropsanduseSimpleListProps:onParse?: (filters: CrudFilters) => TSearchVariables;If
onParseis provided, the hook calls it during location synchronization and sets the return value directly on the Ant Design form instance, allowing developers to customize how filters are transformed back into form values (e.g., type casting or merging filters).Also, search form location syncing was implemented for
useSimpleListusing the same logic asuseTable.Notes for reviewers
The feature has been fully covered by unit tests in both
useTable.spec.tsxanduseSimpleList.spec.ts. A changeset file (.changeset/add-onparse-to-antd.md) has been created for versioning.