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

Remove "blocks" from copy and delete labels #57769

Merged
merged 1 commit into from
Jan 12, 2024
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 @@ -41,9 +41,7 @@ const POPOVER_PROPS = {

function CopyMenuItem( { blocks, onCopy, label } ) {
const ref = useCopyToClipboard( () => serialize( blocks ), onCopy );
const copyMenuItemBlocksLabel =
blocks.length > 1 ? __( 'Copy blocks' ) : __( 'Copy' );
const copyMenuItemLabel = label ? label : copyMenuItemBlocksLabel;
const copyMenuItemLabel = label ? label : __( 'Copy' );
return <MenuItem ref={ ref }>{ copyMenuItemLabel }</MenuItem>;
}

Expand Down Expand Up @@ -202,9 +200,6 @@ export function BlockSettingsDropdown( {
getSelectedBlockClientIds,
] );

const removeBlockLabel =
count === 1 ? __( 'Delete' ) : __( 'Delete blocks' );

// This can occur when the selected block (the parent)
// displays child blocks within a List View.
const parentBlockIsSelected =
Expand Down Expand Up @@ -411,7 +406,7 @@ export function BlockSettingsDropdown( {
) }
shortcut={ shortcuts.remove }
>
{ removeBlockLabel }
{ __( 'Delete' ) }
</MenuItem>
</MenuGroup>
) }
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/specs/editor/various/list-view.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,7 @@ test.describe( 'List View', () => {
.click();
await page
.getByRole( 'menu', { name: 'Options for Heading' } )
.getByRole( 'menuitem', { name: 'Delete blocks' } )
.getByRole( 'menuitem', { name: 'Delete' } )
.click();
await expect
.poll(
Expand Down
Loading