diff --git a/packages/edit-site/src/components/global-styles/screen-revisions/index.js b/packages/edit-site/src/components/global-styles/screen-revisions/index.js index 84c7dae8976b05..6a20e23c916746 100644 --- a/packages/edit-site/src/components/global-styles/screen-revisions/index.js +++ b/packages/edit-site/src/components/global-styles/screen-revisions/index.js @@ -215,7 +215,7 @@ function ScreenRevisions() { } > { __( - 'Any unsaved changes will be lost when you apply this revision.' + 'Are you sure you want to apply this revision? Any unsaved changes will be lost.' ) } ) } diff --git a/packages/editor/src/components/editor-canvas/edit-template-blocks-notification.js b/packages/editor/src/components/editor-canvas/edit-template-blocks-notification.js index 48542e58a8732d..9bb4ab667e45b1 100644 --- a/packages/editor/src/components/editor-canvas/edit-template-blocks-notification.js +++ b/packages/editor/src/components/editor-canvas/edit-template-blocks-notification.js @@ -68,7 +68,7 @@ export default function EditTemplateBlocksNotification( { contentRef } ) { onCancel={ () => setIsDialogOpen( false ) } > { __( - 'You’ve tried to select a block that is part of a template, which may be used on other posts and pages.' + 'You’ve tried to select a block that is part of a template, which may be used on other posts and pages. Would you like to edit the template?.' ) } ); diff --git a/packages/editor/src/components/post-switch-to-draft-button/index.js b/packages/editor/src/components/post-switch-to-draft-button/index.js index 133f2c7d2cfd86..bfdfc93ec90afa 100644 --- a/packages/editor/src/components/post-switch-to-draft-button/index.js +++ b/packages/editor/src/components/post-switch-to-draft-button/index.js @@ -31,10 +31,13 @@ export default function PostSwitchToDraftButton() { const isDisabled = isSaving || ( ! isPublished && ! isScheduled ); let alertMessage; + let confirmButtonText; if ( isPublished ) { alertMessage = __( 'Are you sure you want to unpublish this post?' ); + confirmButtonText = __( 'Unpublish' ); } else if ( isScheduled ) { alertMessage = __( 'Are you sure you want to unschedule this post?' ); + confirmButtonText = __( 'Unschedule' ); } const handleConfirm = () => { @@ -63,6 +66,7 @@ export default function PostSwitchToDraftButton() { isOpen={ showConfirmDialog } onConfirm={ handleConfirm } onCancel={ () => setShowConfirmDialog( false ) } + confirmButtonText={ confirmButtonText } > { alertMessage } diff --git a/packages/editor/src/components/post-trash/index.js b/packages/editor/src/components/post-trash/index.js index 98fc73702974de..ebb078804da6d4 100644 --- a/packages/editor/src/components/post-trash/index.js +++ b/packages/editor/src/components/post-trash/index.js @@ -54,6 +54,7 @@ export default function PostTrash() { isOpen={ showConfirmDialog } onConfirm={ handleConfirm } onCancel={ () => setShowConfirmDialog( false ) } + confirmButtonText={ __( 'Move to trash' ) } > { __( 'Are you sure you want to move this post to the trash?' diff --git a/packages/editor/src/components/post-visibility/index.js b/packages/editor/src/components/post-visibility/index.js index a16682150350ed..0dde8905cbb36f 100644 --- a/packages/editor/src/components/post-visibility/index.js +++ b/packages/editor/src/components/post-visibility/index.js @@ -125,6 +125,7 @@ export default function PostVisibility( { onClose } ) { isOpen={ showPrivateConfirmDialog } onConfirm={ confirmPrivate } onCancel={ handleDialogCancel } + confirmButtonText={ __( 'Publish' ) } > { __( 'Would you like to privately publish this post now?' ) } diff --git a/test/e2e/specs/editor/various/change-detection.spec.js b/test/e2e/specs/editor/various/change-detection.spec.js index 9fa20ba3c0c349..8eca8b6536a8a8 100644 --- a/test/e2e/specs/editor/various/change-detection.spec.js +++ b/test/e2e/specs/editor/various/change-detection.spec.js @@ -417,7 +417,7 @@ test.describe( 'Change detection', () => { .click(); await page .getByRole( 'dialog' ) - .getByRole( 'button', { name: 'OK' } ) + .getByRole( 'button', { name: 'Move to trash' } ) .click(); await expect( diff --git a/test/e2e/specs/editor/various/post-visibility.spec.js b/test/e2e/specs/editor/various/post-visibility.spec.js index 0c367fb94ef6ea..898189085dc286 100644 --- a/test/e2e/specs/editor/various/post-visibility.spec.js +++ b/test/e2e/specs/editor/various/post-visibility.spec.js @@ -23,7 +23,7 @@ test.describe( 'Post visibility', () => { await page.click( 'role=radio[name="Private"i]' ); - await page.click( 'role=button[name="OK"i]' ); + await page.click( 'role=button[name="Publish"i]' ); const currentStatus = await page.evaluate( () => { return window.wp.data @@ -99,7 +99,7 @@ test.describe( 'Post visibility', () => { await page.click( 'role=radio[name="Private"i]' ); - await page.click( 'role=button[name="OK"i]' ); + await page.click( 'role=button[name="Publish"i]' ); const currentStatus = await page.evaluate( () => { return window.wp.data diff --git a/test/e2e/specs/editor/various/preview.spec.js b/test/e2e/specs/editor/various/preview.spec.js index 0657a45567baf5..bf2652b8325744 100644 --- a/test/e2e/specs/editor/various/preview.spec.js +++ b/test/e2e/specs/editor/various/preview.spec.js @@ -188,7 +188,7 @@ test.describe( 'Preview', () => { .getByRole( 'button', { name: 'Switch to draft' } ) .click(); // FIXME: The confirmation dialog is not named yet. - await page.click( 'role=dialog >> role=button[name="OK"i]' ); + await page.click( 'role=dialog >> role=button[name="Unpublish"i]' ); // Wait for the status change. // @see https://github.com/WordPress/gutenberg/pull/43933 diff --git a/test/e2e/specs/editor/various/switch-to-draft.spec.js b/test/e2e/specs/editor/various/switch-to-draft.spec.js index 5cfeda60a2d185..536f1cbb95c01c 100644 --- a/test/e2e/specs/editor/various/switch-to-draft.spec.js +++ b/test/e2e/specs/editor/various/switch-to-draft.spec.js @@ -65,9 +65,12 @@ test.describe( 'Clicking "Switch to draft" on a published/scheduled post/page', await switchToDraftUtils.switchToDraftButton.click(); + const confirmButtonText = + postStatus === 'publish' ? 'Unpublish' : 'Unschedule'; + await page .getByRole( 'dialog' ) - .getByRole( 'button', { name: 'OK' } ) + .getByRole( 'button', { name: confirmButtonText } ) .click(); await expect( diff --git a/test/e2e/specs/site-editor/user-global-styles-revisions.spec.js b/test/e2e/specs/site-editor/user-global-styles-revisions.spec.js index 666e80eb5eb8b5..9eb98e55005c70 100644 --- a/test/e2e/specs/site-editor/user-global-styles-revisions.spec.js +++ b/test/e2e/specs/site-editor/user-global-styles-revisions.spec.js @@ -101,7 +101,7 @@ test.describe( 'Style Revisions', () => { const confirm = page.getByRole( 'dialog' ); await expect( confirm ).toBeVisible(); await expect( confirm ).toHaveText( - /^Any unsaved changes will be lost when you apply this revision./ + /^Are you sure you want to apply this revision\? Any unsaved changes will be lost./ ); // This is to make sure there are no lingering unsaved changes.