refinedev / refine

A React Framework for building internal tools, admin panels, dashboards & B2B apps with unmatched flexibility.
https://refine.dev
MIT License
27.75k stars 2.15k forks source link

fix(antd): handle date range filter conversion issue in audit log when page refreshed #5961

Closed rohitlohar45 closed 4 months ago

rohitlohar45 commented 4 months ago

PR Checklist

Please check if your PR fulfills the following requirements:

Bugs / Features

What is the current behavior?

The current behavior is that the date range table filter in Ant Design is broken, causing errors upon page reload and subsequent crashes. This is due to incorrect formatting of date filters for GraphQL compatibility.

What is the new behavior?

The new behavior fixes the issue by ensuring that date filters are correctly formatted for GraphQL compatibility, resolving the error upon page reload and preventing subsequent crashes.

Notes for reviewers

Please review the changes made to ensure that the date filters are now formatted correctly and that the issue described is resolved.

fixes #5933

changeset-bot[bot] commented 4 months ago

πŸ¦‹ Changeset detected

Latest commit: 2657b9c5749a52a063cac9bdeae4077bbecac826

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

This PR includes changesets to release 3 packages | Name | Type | | ------------------------ | ----- | | @refinedev/antd | Major | | @refinedev/inferencer | Major | | @refinedev/live-previews | Patch |

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[bot] commented 4 months ago

Deploy Preview for refine-video-club ready!

Name Link
Latest commit 2657b9c5749a52a063cac9bdeae4077bbecac826
Latest deploy log https://app.netlify.com/sites/refine-video-club/deploys/66489dad1da23b00082fde4a
Deploy Preview https://deploy-preview-5961--refine-video-club.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 configuration.

alicanerdurmaz commented 4 months ago

@rohitlohar45 Thanks for the detailed explanation.

It can solve this problem, but we must solve it in other UI Packages. It is not sustainable to solve it separately in all UI packages. Therefore, we need to solve this problem in useTable core and actually snycWithLocation operation is already done in the core.

I think it is very likely that the problem is in the @refinedev/react-router-v6 package. there is a problem when converting dayjs object to URL

I was wrong that's why I strikethrough the text.

I pair with @aliemir and we found there is a bug on <FilterDropdown />. Refine's data-provider expects string but ant design works with dayjs. So, we decided the responsibility for handling this situation lies with <FilterDropdown />. Somehow we should send dayjs to Ant Design, but we should keep it as a string in Refine's state. We have a couple of ideas to handle this, I will keep you informed

rohitlohar45 commented 4 months ago

@alicanerdurmaz any ideas I can know that I can work on, like even if some information can help me navigate better

alicanerdurmaz commented 4 months ago

@rohitlohar1 We have resolved this issue and would appreciate your review #5980.

Thank you for contributing to Refine. Unfortunately, I will close your PR because, in this instance, it was more straightforward to write and demonstrate the code than to explain the solution, as the problem was deeply embedded in Refine.

I hope the solution works well πŸš€. Please feel free to reach out if you have any questions πŸ™Œ.