-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Add header to the quick edit when bulk editing #67390
base: trunk
Are you sure you want to change the base?
Conversation
Size Change: +371 B (+0.02%) Total Size: 1.83 MB
ℹ️ View Unchanged
|
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. |
@jameskoster here is the initial header for bulk editing without the ellipsis action menu. Let me know if you have any styling suggestions. |
className="edit-site-post-edit-header__title" | ||
weight={ 500 } | ||
as="h2" | ||
lineHeight="20px" |
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.
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.
Sounds good, I updated that as part of: f35707b
I did have to update the mixins though, as they were relying on a line height variable that didn't exist, let me know if I updated it correctly: https://github.com/WordPress/gutenberg/pull/67390/files#diff-96351000444fb28f5c80a41909d185066c8202d23cdb19c69fc21f79f76960e8L18-R64
Also I did mimic the above from the PostCardPanel
component
lineHeight="20px" |
heading-medium()
as well?
} | ||
|
||
.edit-site-post-edit-header__title { | ||
padding: 2px 0; |
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 to align the icon and title? I think we can do that by adjusting the align
property on the HStack
, then remove this style.
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.
Yeah, and thanks for calling out the use of align
. Align center
allows me to remove the above :)
This is working well :) I left a couple of small comments. We might consider using |
); | ||
|
||
return { | ||
icon: unlock( select( editorStore ) ).getPostIcon( postType, { |
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.
Weird place for such a selector (nothing related to this PR just an observation :P)
const _record = getEditedEntityRecord( | ||
'postType', | ||
postType, | ||
ids[ 0 ] |
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.
Looks like this only depends on the first id, so we might not need the useMemo for ids at all
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.
Hmm we do still make use of the ids
further down, both to decide if to show the single header or to show the count of records being edited.
Or do you mean not passing the entire ids
list into the useSelect
dependency array?
Btw I am happy to remove useMemo
use, as split
is a low effort task. I followed what was done in the PostEditForm
component ( line ).
I could also pass in the list of ids
into the Header
component.
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.
This is nice, and looking good for me.
We might want to reuse some of the SASS mixins like jay mentioned.
@@ -0,0 +1,84 @@ | |||
/** |
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.
Nit: I wonder if this deserves its own folder or if it could be just a header.js
file within the post-edit
.
Personally and given the CSS is smallish, I could have kept it in the same folder.
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.
Yeah I was toying with that in my head as well. I did move it to the post-edit
folder: b4297a7
cc7ccb7
to
b4297a7
Compare
Thanks for the reviews @jameskoster and @youknowriad, I have addressed the suggestions and this should be ready for re-review.
@jameskoster how do I actually get these badges to show? I wasn't able to display them on |
What?
This partially addresses #67344, by adding a header to the quick edit panel when we are quick editing multiple pages.
Follow ups
PostActions
( link ) do we change this to add bulk support?DataView
bulk actions ( link )Why?
In line with the header we show for editing a single page, we should also show one for editing multiple pages.
How?
I created a
PostEditHeader
component that handles both the header for a single post/page or multiple.Incase of a single it renders the existing
PostCardPanel
.Testing Instructions
Changes will be applied to all selected pages.
descriptionTesting Instructions for Keyboard
Screenshots or screencast
quick-bulk-editing-header.mp4