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

feat(sanity): use actions API when deleting documents #6115

Merged
merged 2 commits into from Apr 8, 2024

Conversation

bjoerge
Copy link
Member

@bjoerge bjoerge commented Mar 22, 2024

This should be good to go now

Copy link

vercel bot commented Mar 22, 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 8, 2024 1:18pm
test-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 8, 2024 1:18pm
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
studio-workshop ⬜️ Ignored (Inspect) Visit Preview Apr 8, 2024 1:18pm

Copy link
Contributor

No changes to documentation

Copy link
Contributor

github-actions bot commented Mar 22, 2024

Component Testing Report Updated Apr 8, 2024 1:20 PM (UTC)

File Status Duration Passed Skipped Failed
comments/CommentInput.spec.tsx ✅ Passed (Inspect) 30s 15 0 0
formBuilder/ArrayInput.spec.tsx ✅ Passed (Inspect) 6s 3 0 0
formBuilder/inputs/PortableText/Annotations.spec.tsx ✅ Passed (Inspect) 25s 6 0 0
formBuilder/inputs/PortableText/copyPaste/CopyPaste.spec.tsx ✅ Passed (Inspect) 12s 4 2 0
formBuilder/inputs/PortableText/Decorators.spec.tsx ✅ Passed (Inspect) 12s 6 0 0
formBuilder/inputs/PortableText/FocusTracking.spec.tsx ✅ Passed (Inspect) 32s 15 0 0
formBuilder/inputs/PortableText/Input.spec.tsx ✅ Passed (Inspect) 1m 0s 15 0 0
formBuilder/inputs/PortableText/ObjectBlock.spec.tsx ✅ Passed (Inspect) 59s 18 0 0
formBuilder/inputs/PortableText/RangeDecoration.spec.tsx ✅ Passed (Inspect) 11s 6 0 0
formBuilder/inputs/PortableText/Styles.spec.tsx ✅ Passed (Inspect) 13s 6 0 0
formBuilder/inputs/PortableText/Toolbar.spec.tsx ✅ Passed (Inspect) 20s 9 0 0

Note: still work in progress, pending backend support for `skipCrossDatasetReferenceValidation`

if (isLiveEditEnabled(schema, typeName)) {
Copy link
Member

@cngonzalez cngonzalez Apr 8, 2024

Choose a reason for hiding this comment

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

I notice that the delete action includes the drafts.live-edited-document-id when we execute a delete on a live-edited document.

The backend doesn't seem particularly bothered by this -- it includes a "mutations" array in its response payload that has just the live edited document ID, but is it something we should avoid sending?

Copy link
Member Author

@bjoerge bjoerge Apr 8, 2024

Choose a reason for hiding this comment

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

Good catch! I think it doesn't matter that much, and might even be preferable.

There's actually also a slight benefit - if you go from "liveEdit: false" to "liveEdit: true" while having a draft, the existing draft will still be floating around, which can cause trouble later on. Now that delete will also include deleting the draft, there's now actually a workaround (although veeery sketchy) in that you can hit delete on the document and then restore it later on.

Copy link
Member

Choose a reason for hiding this comment

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

interesting, TIL! also interesting to consider as this API develops and we use it for other purposes.

with that in mind, IMO this is good to go :)

@bjoerge bjoerge changed the base branch from next to feat/sdx-1162-server-actions April 8, 2024 14:31
@bjoerge bjoerge merged commit eeafe54 into feat/sdx-1162-server-actions Apr 8, 2024
36 checks passed
@bjoerge bjoerge deleted the feat/sdx-1163/delete-api branch April 8, 2024 14:31
juice49 pushed a commit that referenced this pull request Apr 8, 2024
* feat(sanity): use actions API when deleting documents
* fix(sanity): add skipCrossDatasetReferenceValidation to delete action
juice49 pushed a commit that referenced this pull request Apr 8, 2024
* feat(sanity): use actions API when deleting documents
* fix(sanity): add skipCrossDatasetReferenceValidation to delete action
juice49 pushed a commit that referenced this pull request Apr 9, 2024
* feat(sanity): use actions API when deleting documents
* fix(sanity): add skipCrossDatasetReferenceValidation to delete action
juice49 pushed a commit that referenced this pull request Apr 9, 2024
* feat(sanity): use actions API when deleting documents
* fix(sanity): add skipCrossDatasetReferenceValidation to delete action
juice49 pushed a commit that referenced this pull request Apr 9, 2024
* feat(sanity): use actions API when deleting documents
* fix(sanity): add skipCrossDatasetReferenceValidation to delete action
juice49 pushed a commit that referenced this pull request Apr 9, 2024
* feat(sanity): use actions API when deleting documents
* fix(sanity): add skipCrossDatasetReferenceValidation to delete action
bjoerge added a commit that referenced this pull request Apr 9, 2024
* feat(sanity): use actions API when deleting documents
* fix(sanity): add skipCrossDatasetReferenceValidation to delete action
bjoerge added a commit that referenced this pull request Apr 9, 2024
* feat(sanity): use actions API when deleting documents
* fix(sanity): add skipCrossDatasetReferenceValidation to delete action
github-merge-queue bot pushed a commit that referenced this pull request Apr 9, 2024
* test(structure): add document title test id

* test(structure): document panel displays correct title for published document

* feat(sanity): use actions API when publishing documents

* feat(sanity): use Actions API when unpublishing documents (#6094)

* feat(sanity): use Actions API when unpublishing documents

* feat(core): set `skipCrossDatasetReferenceValidation` parameter when unpublishing documents

* feat(sanity): use actions API when deleting documents (#6115)

* feat(sanity): use actions API when deleting documents
* fix(sanity): add skipCrossDatasetReferenceValidation to delete action

---------

Co-authored-by: Bjørge Næss <bjoerge@gmail.com>
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

2 participants