-
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
Editor: Multi-Entity Saving UI Improvements #35933
Changes from 12 commits
3712484
e3b730d
3e0e9cd
034eace
ef6f357
d6b8679
88adb53
4ef8ac1
f754848
496d43f
7af0817
f033bfe
84759fe
2d024a5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -68,9 +68,21 @@ export default function EntitiesSavedStates( { close } ) { | |
} = useDispatch( coreStore ); | ||
|
||
// To group entities by type. | ||
const partitionedSavables = Object.values( | ||
groupBy( dirtyEntityRecords, 'name' ) | ||
); | ||
const partitionedSavables = groupBy( dirtyEntityRecords, 'name' ); | ||
|
||
// Sort entity groups. | ||
const { | ||
site: siteSavables, | ||
wp_template: templateSavables, | ||
wp_template_part: templatePartSavables, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you think that order can be defined as a "priority" somehow in the entities config? Or maybe this is sufficient for now? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it'd make the code quite a bit more complex, and I don't think it's worth it right now, since this is the only place so far where we're needing that priority order. |
||
...contentSavables | ||
} = partitionedSavables; | ||
const sortedPartitionedSavables = [ | ||
siteSavables, | ||
templateSavables, | ||
templatePartSavables, | ||
...Object.values( contentSavables ), | ||
].filter( Array.isArray ); | ||
ockham marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
// Unchecked entities to be ignored by save function. | ||
const [ unselectedEntities, _setUnselectedEntities ] = useState( [] ); | ||
|
@@ -160,15 +172,15 @@ export default function EntitiesSavedStates( { close } ) { | |
</div> | ||
|
||
<div className="entities-saved-states__text-prompt"> | ||
<strong>{ __( 'Select the changes you want to save' ) }</strong> | ||
<strong>{ __( 'Are you ready to save?' ) }</strong> | ||
<p> | ||
{ __( | ||
'Some changes may affect other areas of your site.' | ||
'The following changes have been made to your site, templates, and content.' | ||
) } | ||
</p> | ||
</div> | ||
|
||
{ partitionedSavables.map( ( list ) => { | ||
{ sortedPartitionedSavables.map( ( list ) => { | ||
return ( | ||
<EntityTypeList | ||
key={ list[ 0 ].name } | ||
|
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 guess this can become a bit overwhelming with many changes 😄
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.
That was partly by mistake -- there shouldn't be any description for Template Part. Fix in 717d7041ba.
I don't mind removing the "The following content has been modified." description altogether, if it's still too overwhelming.
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 personally like it for the page edits. Not sure for reusable blocks though, but not a blocker.
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.
Ah, I'd somehow missed the reusable blocks. Good point, I'll do some final tweaking...