-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Ability to rename pages in site editor without title block #54648
Conversation
Size Change: +7.84 kB (0%) Total Size: 1.7 MB
ℹ️ View Unchanged
|
Flaky tests detected in 596a524. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/6255636143
|
@@ -33,15 +30,15 @@ export default function RenameMenuItem( { template, onClose } ) { | |||
const { createSuccessNotice, createErrorNotice } = | |||
useDispatch( noticesStore ); | |||
|
|||
if ( template.type === TEMPLATE_POST_TYPE && ! template.is_custom ) { | |||
if ( item.type === 'wp_template' && ! item.is_custom ) { |
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.
Why are we not using the TEMPLATE_POST_TYPE
const anymore?
isDestructive | ||
variant="secondary" | ||
> | ||
<MenuItem onClick={ () => removePage() } isDestructive> |
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.
Is this change meant to be part of this PR? I didn't see it mentioned in the description...
|
||
export default function PageActions( { postId, toggleProps, onRemove } ) { | ||
export default function PageActions( { post, toggleProps, onRemove } ) { |
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.
Is there a reason to change this prop? If possible its always better to pass simpler props as it prevents unnecessary rerenders in the component.
}; | ||
}, [] ); | ||
|
||
const { id, type, status, date, password, title, modified } = page; |
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.
nice! We just need to make sure that if page doesn't exist this doesn't throw any errors.
This is a nice PR, and adds a nice added affordance. @jameskoster we should be able to fit this into the new summary card, no? Needs a rebase, but would be good to land! 🚀 |
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. |
It proved easiest (at least for me) to create a fresh PR off trunk for this. The alternative is up in #60232 so I'll close this once for now. |
What?
Adds ability to rename pages when in site editor when no post title block exists in template. This PR also adds rename menu item to templates as well to be consistent.
Why?
#52763
How?
Updates existing rename menu item component for templates to be used for any post type.
Testing Instructions