[LYS] Tweak site visibility settings page (#46365)

This commit is contained in:
Chi-Hsuan Huang 2024-04-10 18:56:03 +08:00 committed by GitHub
parent 255a45911c
commit 0387404d7f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 42 additions and 7 deletions

View File

@ -188,9 +188,9 @@ const SiteVisibility = () => {
} }
/>
</div>
{ privateLink === 'yes' && (
{ comingSoon === 'yes' && privateLink === 'yes' && (
<div className="site-visibility-settings-slotfill-private-link">
{ getPrivateLink() }
<input value={ getPrivateLink() } readOnly />
<Button
ref={ copyClipboardRef }
variant="link"

View File

@ -13,6 +13,7 @@
}
.site-visibility-settings-slotfill-private-link {
margin-top: 12px;
margin-left: 73px;
padding: 8px 16px;
border-radius: 4px;
@ -20,8 +21,29 @@
background: #fff;
display: flex;
justify-content: space-between;
height: 40px;
box-sizing: border-box;
input {
width: 100%;
outline: none;
border: 0;
background: #fff;
font-size: 13px;
font-style: normal;
font-weight: 400;
line-height: 20px;
color: $gray-900;
}
button {
text-decoration: none;
white-space: nowrap;
font-size: 13px;
font-style: normal;
font-weight: 400;
line-height: 20px;
&:focus {
outline: none !important;
box-shadow: none;
@ -74,17 +96,25 @@
}
.site-visibility-settings-slotfill-section {
max-width: 620px;
max-width: 650px;
&:last-child {
margin-top: 16px;
}
.site-visibility-settings-slotfill-section-content {
gap: 16px;
display: flex;
flex-direction: column;
margin: 16px 0 0 30px;
&.is-hidden {
display: none;
}
margin: 16px 0 0 30px;
.components-toggle-control {
margin: 0;
.components-h-stack {
align-items: baseline;
}
@ -93,6 +123,7 @@
.components-base-control__field {
p {
margin-top: 6px;
margin-bottom: 0;
}
}
}

View File

@ -0,0 +1,4 @@
Significance: patch
Type: tweak
Tweaks Site visibility settings page'

View File

@ -323,7 +323,7 @@ final class WooCommerce {
$coming_soon = $is_new_install ? 'yes' : 'no';
$store_pages_only = WCAdminHelper::is_site_fresh() ? 'no' : 'yes';
$private_link = 'yes';
$private_link = 'no';
$share_key = wp_generate_password( 32, false );
if ( false === get_option( 'woocommerce_coming_soon', false ) ) {

View File

@ -51,7 +51,7 @@ class WooCommerce_Test extends \WC_Unit_Test_Case {
$this->assertEquals( 'yes', get_option( 'woocommerce_coming_soon' ) );
$this->assertEquals( 'no', get_option( 'woocommerce_store_pages_only' ) );
$this->assertEquals( 'yes', get_option( 'woocommerce_private_link' ) );
$this->assertEquals( 'no', get_option( 'woocommerce_private_link' ) );
$this->assertNotEmpty( get_option( 'woocommerce_share_key' ) );
$this->assertMatchesRegularExpression( '/^[a-zA-Z0-9]{32}$/', get_option( 'woocommerce_share_key' ) );
}
@ -67,7 +67,7 @@ class WooCommerce_Test extends \WC_Unit_Test_Case {
$this->assertEquals( 'no', get_option( 'woocommerce_coming_soon' ) );
$this->assertEquals( 'yes', get_option( 'woocommerce_store_pages_only' ) );
$this->assertEquals( 'yes', get_option( 'woocommerce_private_link' ) );
$this->assertEquals( 'no', get_option( 'woocommerce_private_link' ) );
$this->assertNotEmpty( get_option( 'woocommerce_share_key' ) );
$this->assertMatchesRegularExpression( '/^[a-zA-Z0-9]{32}$/', get_option( 'woocommerce_share_key' ) );
}