-
Notifications
You must be signed in to change notification settings - Fork 450
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(tasks): close the form only after the task is created #6450
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
No changes to documentation |
Component Testing Report Updated Apr 30, 2024 2:08 PM (UTC)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Would prefer if we could re-use useDocumentOperationEvent
here. That will give us a more solid way to handle the create lifecycle here. You can see an example of this within the DocumentOperationResults
component.
packages/sanity/src/core/tasks/components/form/tasksFormBuilder/FormCreate.tsx
Show resolved
Hide resolved
packages/sanity/src/core/tasks/components/form/tasksFormBuilder/FormCreate.tsx
Outdated
Show resolved
Hide resolved
packages/sanity/src/core/tasks/components/form/tasksFormBuilder/FormCreate.tsx
Outdated
Show resolved
Hide resolved
packages/sanity/src/core/tasks/components/form/tasksFormBuilder/FormCreate.tsx
Show resolved
Hide resolved
packages/sanity/src/core/tasks/components/form/tasksFormBuilder/FormCreate.tsx
Outdated
Show resolved
Hide resolved
@sjelfull dismissing the review given the Pr has been approved and I want to have this merged for tomorrows release, happy to revert later or address the suggestions if you have any, but I think they have been answered and covered with the last changes. |
@sjelfull dismissing the review given the Pr has been approved and I want to have this merged for tomorrows release, happy to revert later or address the suggestions if you have any, but I think they have been answered and covered with the last changes.
Description
Fixes an issue in which tasks are kept in draft mode after clicking on the "create" button.
The on change action triggered by the form doesn't provides a way to validate that the transaction ended, so in this case we will persist the form in
creating
state until the task store is updated with the correct values.The task store fetches the latest task values when a task is updated, so if the value has been updated in the store it means the transaction has ended.
What to review
Is there a better way to do this?
Is there any way to access the transaction from the form onChange or from any form action?
Testing
Notes for release
fixes an issue in tasks in which the UI showed that they were created but the transaction was didn't ended.