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(structure): live edit on draft documents #7526

Merged
merged 11 commits into from
Sep 23, 2024
Merged

fix(structure): live edit on draft documents #7526

merged 11 commits into from
Sep 23, 2024

Conversation

RitaDias
Copy link
Contributor

Description

When editing a live document that had a draft version of it, the users were being unable to edit the document.
Worst, when using the PTE they would be able to edit and add text, the would get a notification that the document was saved but when refreshing the data would be lost.

The current fix makes the document readOnly when the document is liveEdit AND a draft is being displayed.
The solution is for the user to publish the draft (that shouldn't exist).

It also allows to publish or discard the open draft

Before

liveEdit.pretty.bad.mov

After

Screen.Recording.2024-09-19.at.13.35.29.mov

What to review

The code and if the UI makes sense. I considered adding a drop down menu like we have for the extended actions in the footer but decided that it doesn't make sense to obscure the choices in this case

Testing

You can manually test it by going to some older documents of the type SImpleBlock (which will be dropped before merging)
There is also an e2e test set up

Notes for release

Fixes issue with drafts on live edit schema

@RitaDias RitaDias requested a review from a team as a code owner September 19, 2024 11:37
@RitaDias RitaDias requested review from rexxars and removed request for a team September 19, 2024 11:37
Copy link

vercel bot commented Sep 19, 2024

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

Name Status Preview Comments Updated (UTC)
page-building-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 23, 2024 8:11am
performance-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 23, 2024 8:11am
test-compiled-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 23, 2024 8:11am
test-next-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 23, 2024 8:11am
test-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 23, 2024 8:11am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
studio-workshop ⬜️ Ignored (Inspect) Visit Preview Sep 23, 2024 8:11am

@@ -31,6 +31,7 @@ const myStringType = defineArrayMember({
})

export default defineType({
liveEdit: true,
Copy link
Contributor Author

@RitaDias RitaDias Sep 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

temp (commit will be removed before merging)

Copy link
Contributor

No changes to documentation

Copy link
Contributor

github-actions bot commented Sep 19, 2024

Component Testing Report Updated Sep 23, 2024 8:15 AM (UTC)

✅ All Tests Passed -- expand for details
File Status Duration Passed Skipped Failed
comments/CommentInput.spec.tsx ✅ Passed (Inspect) 45s 15 0 0
formBuilder/ArrayInput.spec.tsx ✅ Passed (Inspect) 9s 3 0 0
formBuilder/inputs/PortableText/Annotations.spec.tsx ✅ Passed (Inspect) 30s 6 0 0
formBuilder/inputs/PortableText/copyPaste/CopyPaste.spec.tsx ✅ Passed (Inspect) 37s 11 7 0
formBuilder/inputs/PortableText/copyPaste/CopyPasteFields.spec.tsx ✅ Passed (Inspect) 0s 0 12 0
formBuilder/inputs/PortableText/Decorators.spec.tsx ✅ Passed (Inspect) 17s 6 0 0
formBuilder/inputs/PortableText/DisableFocusAndUnset.spec.tsx ✅ Passed (Inspect) 10s 3 0 0
formBuilder/inputs/PortableText/DragAndDrop.spec.tsx ✅ Passed (Inspect) 3m 0s 0 0 0
formBuilder/inputs/PortableText/FocusTracking.spec.tsx ✅ Passed (Inspect) 45s 15 0 0
formBuilder/inputs/PortableText/Input.spec.tsx ✅ Passed (Inspect) 1m 47s 21 0 0
formBuilder/inputs/PortableText/ObjectBlock.spec.tsx ✅ Passed (Inspect) 1m 17s 18 0 0
formBuilder/inputs/PortableText/PresenceCursors.spec.tsx ✅ Passed (Inspect) 9s 3 9 0
formBuilder/inputs/PortableText/RangeDecoration.spec.tsx ✅ Passed (Inspect) 26s 9 0 0
formBuilder/inputs/PortableText/Styles.spec.tsx ✅ Passed (Inspect) 19s 6 0 0
formBuilder/inputs/PortableText/Toolbar.spec.tsx ✅ Passed (Inspect) 36s 12 0 0
formBuilder/tree-editing/TreeEditing.spec.tsx ✅ Passed (Inspect) 0s 0 3 0
formBuilder/tree-editing/TreeEditingNestedObjects.spec.tsx ✅ Passed (Inspect) 0s 0 3 0

@RitaDias RitaDias added this pull request to the merge queue Sep 23, 2024
Merged via the queue into next with commit 7bf9995 Sep 23, 2024
42 checks passed
@RitaDias RitaDias deleted the sdx-1623-2 branch September 23, 2024 10:02
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.

3 participants