Site visibility settings add documentation link and copy changes (#50781)

* Add link to title, remove link from a description, minor copy changes

* Changelog

* Update link

* Update test and copies
This commit is contained in:
Ilyas Foo 2024-08-20 13:49:05 +08:00 committed by GitHub
parent deaca578cc
commit c7b7805b7e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 27 additions and 20 deletions

View File

@ -8,7 +8,7 @@ export const COMING_SOON_PAGE_EDITOR_LINK = getAdminLink(
); );
export const SITE_VISIBILITY_DOC_LINK = export const SITE_VISIBILITY_DOC_LINK =
'https://woocommerce.com/document/woocommerce-launch-your-store/'; 'https://woocommerce.com/document/configuring-woocommerce-settings/coming-soon-mode/';
export const LAUNCH_YOUR_STORE_DOC_LINK = export const LAUNCH_YOUR_STORE_DOC_LINK =
'https://woocommerce.com/document/configuring-woocommerce-settings/#site-visibility'; 'https://woocommerce.com/document/configuring-woocommerce-settings/#site-visibility';

View File

@ -132,9 +132,18 @@ const SiteVisibility = () => {
/> />
<h2>{ __( 'Site visibility', 'woocommerce' ) }</h2> <h2>{ __( 'Site visibility', 'woocommerce' ) }</h2>
<p className="site-visibility-settings-slotfill-description"> <p className="site-visibility-settings-slotfill-description">
{ __( { createInterpolateElement(
'Manage how your site appears to visitors.', __(
'woocommerce' 'Manage how your site appears to visitors. <a>Learn more</a>',
'woocommerce'
),
{
a: createElement( 'a', {
target: '_blank',
rel: 'noreferrer',
href: SITE_VISIBILITY_DOC_LINK,
} ),
}
) } ) }
</p> </p>
<div className="site-visibility-settings-slotfill-section"> <div className="site-visibility-settings-slotfill-section">
@ -162,6 +171,7 @@ const SiteVisibility = () => {
), ),
{ {
a: createElement( 'a', { a: createElement( 'a', {
target: '_blank',
href: COMING_SOON_PAGE_EDITOR_LINK, href: COMING_SOON_PAGE_EDITOR_LINK,
} ), } ),
} }
@ -183,20 +193,13 @@ const SiteVisibility = () => {
label={ label={
<> <>
{ __( { __(
'Restrict to store pages only', 'Apply to store pages only',
'woocommerce' 'woocommerce'
) } ) }
<p> <p>
{ createInterpolateElement( { __(
__( 'Display a “coming soon” message on your store pages — the rest of your site will remain visible.',
'Display a "coming soon" message on your <a>store pages</a> — the rest of your site will remain visible.', 'woocommerce'
'woocommerce'
),
{
a: createElement( 'a', {
href: SITE_VISIBILITY_DOC_LINK,
} ),
}
) } ) }
</p> </p>
</> </>

View File

@ -0,0 +1,4 @@
Significance: patch
Type: tweak
Add link to title, remove link from a description, minor copy changes to site visibility settings page

View File

@ -198,7 +198,7 @@ class ExportWCSettings implements StepExporter, HasAlias {
$option_info['woocommerce_store_pages_only'] = array( $option_info['woocommerce_store_pages_only'] = array(
'location' => 'site_visibility.general', 'location' => 'site_visibility.general',
'title' => 'Restrict to store pages only', 'title' => 'Apply to store pages only',
); );
return compact( 'options', 'pages', 'option_info' ); return compact( 'options', 'pages', 'option_info' );

View File

@ -113,7 +113,7 @@ class ComingSoonRequestHandler {
return false; return false;
} }
// Do not show coming soon on 404 pages when restrict to store pages only. // Do not show coming soon on 404 pages when applied to store pages only.
if ( $this->coming_soon_helper->is_store_coming_soon() && is_404() ) { if ( $this->coming_soon_helper->is_store_coming_soon() && is_404() ) {
return false; return false;
} }

View File

@ -132,7 +132,7 @@ test.describe(
// The store only checkbox should not be on the page. // The store only checkbox should not be on the page.
await expect( await expect(
page.getByRole( 'checkbox', { page.getByRole( 'checkbox', {
name: 'Restrict to store pages only', name: 'Apply to store pages only',
} ) } )
).toHaveCount( 0 ); ).toHaveCount( 0 );
@ -156,14 +156,14 @@ test.describe(
// The store only checkbox should be visible. // The store only checkbox should be visible.
await expect( await expect(
page.getByRole( 'checkbox', { page.getByRole( 'checkbox', {
name: 'Restrict to store pages only', name: 'Apply to store pages only',
} ) } )
).toBeVisible(); ).toBeVisible();
// The store only checkbox should not be checked. // The store only checkbox should not be checked.
await expect( await expect(
page.getByRole( 'checkbox', { page.getByRole( 'checkbox', {
name: 'Restrict to store pages only', name: 'Apply to store pages only',
} ) } )
).not.toBeChecked(); ).not.toBeChecked();