Skip to content

Commit

Permalink
Simplify description and option names in the Lock modal dialog (#67437)
Browse files Browse the repository at this point in the history
* Refactor Lock modal dialog for improved clarity and simplicity

* Fix: modify the e2e test cases

* Fix: shorten the text & make it feel more specific

Co-authored-by: sarthaknagoshe2002 <[email protected]>
Co-authored-by: t-hamano <[email protected]>
Co-authored-by: afercia <[email protected]>
Co-authored-by: mtias <[email protected]>
  • Loading branch information
5 people authored Dec 7, 2024
1 parent 96ceed1 commit 959bb6b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
10 changes: 4 additions & 6 deletions packages/block-editor/src/components/block-lock/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,7 @@ export default function BlockLockModal( { clientId, onClose } ) {
>
<fieldset className="block-editor-block-lock-modal__options">
<legend>
{ __(
'Choose specific attributes to restrict or lock all available options.'
) }
{ __( 'Select the features you want to lock' ) }
</legend>
{ /*
* Disable reason: The `list` ARIA role is redundant but
Expand Down Expand Up @@ -137,7 +135,7 @@ export default function BlockLockModal( { clientId, onClose } ) {
<li className="block-editor-block-lock-modal__checklist-item">
<CheckboxControl
__nextHasNoMarginBottom
label={ __( 'Restrict editing' ) }
label={ __( 'Lock editing' ) }
checked={ !! lock.edit }
onChange={ ( edit ) =>
setLock( ( prevLock ) => ( {
Expand All @@ -159,7 +157,7 @@ export default function BlockLockModal( { clientId, onClose } ) {
<li className="block-editor-block-lock-modal__checklist-item">
<CheckboxControl
__nextHasNoMarginBottom
label={ __( 'Disable movement' ) }
label={ __( 'Lock movement' ) }
checked={ lock.move }
onChange={ ( move ) =>
setLock( ( prevLock ) => ( {
Expand All @@ -178,7 +176,7 @@ export default function BlockLockModal( { clientId, onClose } ) {
<li className="block-editor-block-lock-modal__checklist-item">
<CheckboxControl
__nextHasNoMarginBottom
label={ __( 'Prevent removal' ) }
label={ __( 'Lock removal' ) }
checked={ lock.remove }
onChange={ ( remove ) =>
setLock( ( prevLock ) => ( {
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/specs/editor/blocks/columns.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ test.describe( 'Columns', () => {
);
await editor.clickBlockToolbarButton( 'Options' );
await page.click( 'role=menuitem[name="Lock"i]' );
await page.locator( 'role=checkbox[name="Prevent removal"i]' ).check();
await page.locator( 'role=checkbox[name="Lock removal"i]' ).check();
await page.click( 'role=button[name="Apply"i]' );

// Select columns block
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/specs/editor/various/block-locking.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ test.describe( 'Block Locking', () => {

await editor.clickBlockOptionsMenuItem( 'Lock' );

await page.click( 'role=checkbox[name="Prevent removal"]' );
await page.click( 'role=checkbox[name="Lock removal"]' );
await page.click( 'role=button[name="Apply"]' );

await expect(
Expand All @@ -35,7 +35,7 @@ test.describe( 'Block Locking', () => {

await editor.clickBlockOptionsMenuItem( 'Lock' );

await page.click( 'role=checkbox[name="Disable movement"]' );
await page.click( 'role=checkbox[name="Lock movement"]' );
await page.click( 'role=button[name="Apply"]' );

// Hide options.
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/specs/editor/various/block-switcher.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ test.describe( 'Block Switcher', () => {
await expect( button ).toBeEnabled();

await editor.clickBlockOptionsMenuItem( 'Lock' );
await page.click( 'role=checkbox[name="Prevent removal"]' );
await page.click( 'role=checkbox[name="Lock removal"]' );
await page.click( 'role=button[name="Apply"]' );

// Verify the block switcher isn't enabled.
Expand Down

0 comments on commit 959bb6b

Please sign in to comment.