Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions packages/edit-post/src/components/init-pattern-modal/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,10 @@ export default function InitPatternModal() {
/>
<ReusableBlocksRenameHint />
<ToggleControl
label={ _x(
'Synced',
'Option that makes an individual pattern synchronized'
) }
help={ __(
'Sync this pattern across multiple locations.'
label={ _x( 'Synced', 'pattern (singular)' ) }
help={ _x(
'Sync this pattern across multiple locations.',
'user action'
) }
checked={ ! syncType }
onChange={ () => {
Expand Down
27 changes: 15 additions & 12 deletions packages/edit-site/src/components/page-patterns/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,12 @@ const DEFAULT_VIEW = {
const SYNC_FILTERS = [
{
value: PATTERN_SYNC_TYPES.full,
label: _x( 'Synced', 'Option that shows all synchronized patterns' ),
label: _x( 'Synced', 'pattern (singular)' ),
description: __( 'Patterns that are kept in sync across the site.' ),
},
{
value: PATTERN_SYNC_TYPES.unsynced,
label: _x(
'Not synced',
'Option that shows all patterns that are not synchronized'
),
label: _x( 'Not synced', 'pattern (singular)' ),
description: __(
'Patterns that can be changed freely without affecting the site.'
),
Expand Down Expand Up @@ -298,13 +295,19 @@ export default function DataviewsPatterns() {
<span
className={ `edit-site-patterns__field-sync-status-${ item.syncStatus }` }
>
{ SYNC_FILTERS.find(
( { value } ) => value === item.syncStatus
)?.label ||
SYNC_FILTERS.find(
( { value } ) =>
value === PATTERN_SYNC_TYPES.unsynced
).label }
{
(
SYNC_FILTERS.find(
( { value } ) =>
value === item.syncStatus
) ||
SYNC_FILTERS.find(
( { value } ) =>
value ===
PATTERN_SYNC_TYPES.unsynced
)
).label
}
</span>
);
},
Expand Down
10 changes: 2 additions & 8 deletions packages/editor/src/components/post-sync-status/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,8 @@ export default function PostSyncStatus() {
<PostPanelRow label={ __( 'Sync status' ) }>
<div className="editor-post-sync-status__value">
{ syncStatus === 'unsynced'
? _x(
'Not synced',
'Text that indicates that the pattern is not synchronized'
)
: _x(
'Synced',
'Text that indicates that the pattern is synchronized'
) }
? _x( 'Not synced', 'pattern (singular)' )
: _x( 'Synced', 'pattern (singular)' ) }
</div>
</PostPanelRow>
);
Expand Down
5 changes: 1 addition & 4 deletions packages/patterns/src/components/create-pattern-modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,7 @@ export function CreatePatternModalContents( {
categoryMap={ categoryMap }
/>
<ToggleControl
label={ _x(
'Synced',
'Option that makes an individual pattern synchronized'
) }
label={ _x( 'Synced', 'pattern (singular)' ) }
help={ __(
'Sync this pattern across multiple locations.'
) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ import { BlockSettingsMenuControls } from '@wordpress/block-editor';
import ReusableBlockConvertButton from './reusable-block-convert-button';
import ReusableBlocksManageButton from './reusable-blocks-manage-button';

/*
* FIXME: CAN WE GET RID OF THIS COMPONENT? AS FAR AS I CAN SEE, IT'S EXPORTED
* BUT NEVER USED, ONLY MENTIONED IN DOCUMENTATION.
*/
export default function ReusableBlocksMenuItems( { rootClientId } ) {
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems like the whole "reusable-blocks" package can be deprecated. Might be good to do that in its own PR.

Copy link
Contributor Author

@mcsf mcsf Jun 6, 2024

Choose a reason for hiding this comment

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

It seems like the whole "reusable-blocks" package can be deprecated. Might be good to do that in its own PR.

Yeah, I added this as a separate commit to easily revert — I just didn't want to forget

return (
<BlockSettingsMenuControls>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,13 @@ export default function ReusableBlockConvertButton( {
placeholder={ __( 'My pattern' ) }
/>
<ToggleControl
label={ _x(
'Synced',
'Option that makes an individual pattern synchronized'
) }
label={ _x( 'Synced', 'pattern (singular)' ) }
/*
* FIXME: See my other FIXME for
* ReusableBlocksMenuItems. If we can get
* rid of that one, can we get rid of this
* one?
*/
help={ __(
'Sync this pattern across multiple locations.'
) }
Expand Down