-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Real-time collaboration: Allow post-locked-modal to be overridden when collaborative-editing is enabled
#72326
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
base: trunk
Are you sure you want to change the base?
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @pkevan! In case you missed it, we'd love to have you join us in our Slack community. If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information. |
Co-authored-by: Chris Zarate <chris@zarate.org>
| } = select( editorStore ); | ||
| const { getPostType } = select( coreStore ); | ||
| const { getPostType, getEntityConfig } = select( coreStore ); | ||
| const entityName = getEditedPostAttribute( 'type' ); |
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.
I think we should use getCurrentPostType or something like that, that feels more straightforward
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.
switched to getCurrentPostType in df239d1
|
The modal should already be overridable after #70586. |
It is, but the rest of the functionality around the lock is lost, and with the sync component we want to continue to keep this for now. |
|
Thanks for the explanation, @pkevan! |
collaborative-editing is enabledcollaborative-editing is enabled
What?
Pulled from: #72040, this allows the post lock to be configured based on the sync enabled entity.
Why?
In order to maintain the post lock functionality, we need to return when sync config is enabled during a real-time collaboration session where it is enabled for a post type.
How?
Checks that the post type has
collaborative-editingenabled viapost_type_supportsand disabled the lock modal based on it.Testing Instructions
postandpagepost types have this enabled when the__experimentalEnableSyncflag is set.postwith more than 1 user present and note there is no pock lock modal for either user.remove_post_type_support( 'page', 'collaborative-editing' );in code to disable the functionality.pagewith more than 1 user present and note that the second user to visit is presented with the post lock modal.