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(tasks): close the form only after the task is created #6450

Merged
merged 2 commits into from May 6, 2024

Conversation

pedrobonamin
Copy link
Contributor

@pedrobonamin pedrobonamin commented Apr 23, 2024

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.

@pedrobonamin pedrobonamin requested a review from a team as a code owner April 23, 2024 06:44
@pedrobonamin pedrobonamin requested review from sjelfull and removed request for a team April 23, 2024 06:44
Copy link

vercel bot commented Apr 23, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
performance-studio ✅ Ready (Inspect) Visit Preview Apr 30, 2024 2:04pm
test-next-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 30, 2024 2:04pm
test-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 30, 2024 2:04pm
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
studio-workshop ⬜️ Ignored (Inspect) Visit Preview Apr 30, 2024 2:04pm

Copy link
Contributor

No changes to documentation

Copy link
Contributor

github-actions bot commented Apr 23, 2024

Component Testing Report Updated Apr 30, 2024 2:08 PM (UTC)

File Status Duration Passed Skipped Failed
comments/CommentInput.spec.tsx ✅ Passed (Inspect) 35s 15 0 0
formBuilder/ArrayInput.spec.tsx ✅ Passed (Inspect) 6s 3 0 0
formBuilder/inputs/PortableText/Annotations.spec.tsx ✅ Passed (Inspect) 27s 6 0 0
formBuilder/inputs/PortableText/copyPaste/CopyPaste.spec.tsx ✅ Passed (Inspect) 20s 6 3 0
formBuilder/inputs/PortableText/Decorators.spec.tsx ✅ Passed (Inspect) 14s 6 0 0
formBuilder/inputs/PortableText/FocusTracking.spec.tsx ✅ Passed (Inspect) 35s 15 0 0
formBuilder/inputs/PortableText/Input.spec.tsx ✅ Passed (Inspect) 1m 3s 15 0 0
formBuilder/inputs/PortableText/ObjectBlock.spec.tsx ✅ Passed (Inspect) 1m 5s 18 0 0
formBuilder/inputs/PortableText/RangeDecoration.spec.tsx ✅ Passed (Inspect) 20s 9 0 0
formBuilder/inputs/PortableText/Styles.spec.tsx ✅ Passed (Inspect) 14s 6 0 0
formBuilder/inputs/PortableText/Toolbar.spec.tsx ✅ Passed (Inspect) 22s 9 0 0

Copy link
Member

@sjelfull sjelfull left a 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.

@pedrobonamin
Copy link
Contributor Author

@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.

@pedrobonamin pedrobonamin dismissed sjelfull’s stale review May 6, 2024 15:38

@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.

@pedrobonamin pedrobonamin added this pull request to the merge queue May 6, 2024
Merged via the queue into next with commit e089eb7 May 6, 2024
39 checks passed
@pedrobonamin pedrobonamin deleted the edx-1259 branch May 6, 2024 15:38
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.

None yet

3 participants