Skip to content

Commit

Permalink
Block Toolbar: Update the 'Unlock' button label (WordPress#51083)
Browse files Browse the repository at this point in the history
* Block Toolbar: Update the 'Unlock' button label

* Update e2e test locator
  • Loading branch information
Mamaduka authored and sethrubenstein committed Jul 13, 2023
1 parent 2a9e195 commit 40ef898
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
10 changes: 2 additions & 8 deletions packages/block-editor/src/components/block-lock/toolbar.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* WordPress dependencies
*/
import { __, sprintf } from '@wordpress/i18n';
import { __ } from '@wordpress/i18n';
import { ToolbarButton, ToolbarGroup } from '@wordpress/components';
import { useReducer } from '@wordpress/element';
import { lock } from '@wordpress/icons';
Expand All @@ -11,10 +11,8 @@ import { lock } from '@wordpress/icons';
*/
import BlockLockModal from './modal';
import useBlockLock from './use-block-lock';
import useBlockDisplayInformation from '../use-block-display-information';

export default function BlockLockToolbar( { clientId } ) {
const blockInformation = useBlockDisplayInformation( clientId );
const { canEdit, canMove, canRemove, canLock } = useBlockLock( clientId );

const [ isModalOpen, toggleModal ] = useReducer(
Expand All @@ -35,11 +33,7 @@ export default function BlockLockToolbar( { clientId } ) {
<ToolbarGroup className="block-editor-block-lock-toolbar">
<ToolbarButton
icon={ lock }
label={ sprintf(
/* translators: %s: block name */
__( 'Unlock %s' ),
blockInformation.title
) }
label={ __( 'Unlock' ) }
onClick={ toggleModal }
/>
</ToolbarGroup>
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/specs/editor/various/block-locking.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ test.describe( 'Block Locking', () => {
await page.click( 'role=checkbox[name="Lock all"]' );
await page.click( 'role=button[name="Apply"]' );

await editor.clickBlockToolbarButton( 'Unlock Paragraph' );
await editor.clickBlockToolbarButton( 'Unlock' );
await page.click( 'role=checkbox[name="Lock all"]' );
await page.click( 'role=button[name="Apply"]' );

Expand Down

0 comments on commit 40ef898

Please sign in to comment.