Skip to content
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

feat: Rename Reusable blocks to Patterns #51704

Merged
merged 3 commits into from
Jun 29, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ function ReusableBlocksTab( { onSelect, rootClientId, listProps } ) {

return (
<BlockTypesList
name="ReusableBlocks"
name="SyncedPatterns"
sections={ sections }
onSelect={ onSelect }
listProps={ listProps }
label={ __( 'Reusable blocks' ) }
label={ __( 'Synced patterns' ) }
/>
);
}
Expand Down
6 changes: 5 additions & 1 deletion packages/block-editor/src/components/inserter/tabs.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,11 @@ InserterTabs.Control = TabsControl;

InserterTabs.getTabs = () => [
{ name: 'blocks', title: __( 'Blocks' ), component: BlockTypesTab },
{ name: 'reusable', title: __( 'Reusable' ), component: ReusableBlocksTab },
{
name: 'reusable',
title: __( 'Synced patterns' ),
component: ReusableBlocksTab,
},
];

export default InserterTabs;
4 changes: 2 additions & 2 deletions packages/block-library/src/block/edit.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,14 +148,14 @@ export default function ReusableBlockEdit( {
? sprintf(
/* translators: %s: name of the host app (e.g. WordPress) */
__(
'Editing reusable blocks is not yet supported on %s for Android'
'Editing synced patterns is not yet supported on %s for Android'
),
hostAppNamespace
)
: sprintf(
/* translators: %s: name of the host app (e.g. WordPress) */
__(
'Editing reusable blocks is not yet supported on %s for iOS'
'Editing synced patterns is not yet supported on %s for iOS'
),
hostAppNamespace
);
Expand Down
8 changes: 4 additions & 4 deletions packages/block-library/src/block/test/edit.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ afterAll( () => {
} );
} );

describe( 'Reusable block', () => {
it( 'inserts a reusable block', async () => {
describe( 'Synced patterns', () => {
it( 'inserts a synced pattern', async () => {
// We have to use different ids because entities are cached in memory.
const reusableBlockMock1 = getMockedReusableBlock( 1 );
const reusableBlockMock2 = getMockedReusableBlock( 2 );
Expand Down Expand Up @@ -86,7 +86,7 @@ describe( 'Reusable block', () => {
fireEvent.press( await screen.findByLabelText( 'Add block' ) );

// Navigate to reusable tab.
const reusableSegment = await screen.findByText( 'Reusable' );
const reusableSegment = await screen.findByText( 'Synced patterns' );
// onLayout event is required by Segment component.
fireEvent( reusableSegment, 'layout', {
nativeEvent: {
Expand All @@ -98,7 +98,7 @@ describe( 'Reusable block', () => {
fireEvent.press( reusableSegment );

const reusableBlockList = screen.getByTestId(
'InserterUI-ReusableBlocks'
'InserterUI-SyncedPatterns'
);
// onScroll event used to force the FlatList to render all items.
fireEvent.scroll( reusableBlockList, {
Expand Down
1 change: 1 addition & 0 deletions packages/react-native-editor/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ For each user feature we should also add a importance categorization label to i
-->

## Unreleased
- [*] Rename "Reusable blocks" to "Synced patterns", aligning with the web editor. [#51704]

## 1.98.0
- [*] Image block - Fix issue where in some cases the image doesn't display the right aspect ratio [#51463]
Expand Down