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

Improve pre-publish checks naming consistency. #57019

Merged
merged 2 commits into from
Jan 8, 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 @@ -10,7 +10,7 @@ import { toggleMoreMenu } from './toggle-more-menu';
export async function disablePrePublishChecks() {
await togglePreferencesOption(
'General',
'Enable pre-publish flow',
'Enable pre-publish checks',
false
);
await toggleMoreMenu( 'close' );
Expand Down
6 changes: 5 additions & 1 deletion packages/e2e-test-utils/src/enable-pre-publish-checks.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ import { toggleMoreMenu } from './toggle-more-menu';
* Enables Pre-publish checks.
*/
export async function enablePrePublishChecks() {
await togglePreferencesOption( 'General', 'Enable pre-publish flow', true );
await togglePreferencesOption(
'General',
'Enable pre-publish checks',
true
);
await toggleMoreMenu( 'close' );
}
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export default function EditPostPreferencesModal() {
help={ __(
'Review settings, such as visibility and tags.'
) }
label={ __( 'Enable pre-publish flow' ) }
label={ __( 'Enable pre-publish checks' ) }
/>
</PreferencesModalSection>
) }
Expand Down
8 changes: 4 additions & 4 deletions packages/edit-post/src/hooks/commands/use-common-commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,16 +192,16 @@ export default function useCommonCommands() {
useCommand( {
name: 'core/toggle-publish-sidebar',
label: isPublishSidebarEnabled
? __( 'Disable pre-publish checklist' )
: __( 'Enable pre-publish checklist' ),
? __( 'Disable pre-publish checks' )
: __( 'Enable pre-publish checks' ),
icon: formatListBullets,
callback: ( { close } ) => {
close();
toggle( 'core/edit-post', 'isPublishSidebarEnabled' );
createInfoNotice(
isPublishSidebarEnabled
? __( 'Pre-publish checklist off.' )
: __( 'Pre-publish checklist on.' ),
? __( 'Pre-publish checks disabled.' )
: __( 'Pre-publish checks enabled.' ),
{
id: 'core/edit-post/publish-sidebar/notice',
type: 'snackbar',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function MyEditorPreferencesModal() {
'Review settings, such as visibility and tags.'
) }
label={ __(
'Enable pre-publish flow'
'Enable pre-publish checks'
) }
/>
</PreferencesModalSection>
Expand Down
8 changes: 4 additions & 4 deletions test/e2e/specs/editor/various/pref-modal.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ test.describe( 'Preferences modal', () => {
} );

test.describe( 'Preferences modal adaps to viewport', () => {
test( 'Enable pre-publish flow is visible on desktop ', async ( {
test( 'Enable pre-publish checks is visible on desktop ', async ( {
page,
} ) => {
await page.click(
Expand All @@ -18,14 +18,14 @@ test.describe( 'Preferences modal', () => {
await page.click( 'role=menuitem[name="Preferences"i]' );

const prePublishToggle = page.locator(
'role=checkbox[name="Enable pre-publish flow"i]'
'role=checkbox[name="Enable pre-publish checks"i]'
);

await expect( prePublishToggle ).toBeVisible();
} );
} );
test.describe( 'Preferences modal adaps to viewport', () => {
test( 'Enable pre-publish flow is not visible on mobile ', async ( {
test( 'Enable pre-publish checks is not visible on mobile ', async ( {
page,
} ) => {
await page.setViewportSize( { width: 500, height: 800 } );
Expand All @@ -44,7 +44,7 @@ test.describe( 'Preferences modal', () => {
);

const prePublishToggle = page.locator(
'role=checkbox[name="Enable pre-publish flow"i]'
'role=checkbox[name="Enable pre-publish checks"i]'
);

await expect( generalButton ).toBeVisible();
Expand Down
Loading