-
Notifications
You must be signed in to change notification settings - Fork 435
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
Conversation
This file contains 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
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
RitaDias
commented
Sep 19, 2024
@@ -31,6 +31,7 @@ const myStringType = defineArrayMember({ | |||
}) | |||
|
|||
export default defineType({ | |||
liveEdit: true, |
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.
temp (commit will be removed before merging)
No changes to documentation |
Component Testing Report Updated Sep 23, 2024 8:15 AM (UTC) ✅ All Tests Passed -- expand for details
|
bjoerge
requested changes
Sep 19, 2024
...tructure/panes/document/documentPanel/banners/__telemetry__/DraftLiveEditBanner.telemetry.ts
Outdated
Show resolved
Hide resolved
...tructure/panes/document/documentPanel/banners/__telemetry__/DraftLiveEditBanner.telemetry.ts
Outdated
Show resolved
Hide resolved
packages/sanity/src/structure/panes/document/documentPanel/banners/DraftLiveEditBanner.tsx
Outdated
Show resolved
Hide resolved
packages/sanity/src/structure/panes/document/documentPanel/banners/DraftLiveEditBanner.tsx
Outdated
Show resolved
Hide resolved
…the live edit to work
RitaDias
force-pushed
the
sdx-1623-2
branch
from
September 23, 2024 07:35
cc20270
to
3b777cd
Compare
joneidejohnsen
approved these changes
Sep 23, 2024
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.
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