Skip to content

Commit 788e121

Browse files
authored
Add HC in logged out page for easier testing (#108000)
1 parent f4d8eed commit 788e121

File tree

5 files changed

+31
-5
lines changed

5 files changed

+31
-5
lines changed

client/layout/logged-out.jsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,15 @@ const LayoutLoggedOut = ( {
114114
! isWooOAuth2Client( oauth2Client );
115115

116116
const loadHelpCenter =
117-
isLoggedIn &&
118-
// we want to show only the Help center in my home and the help section (but not the FAB)
119-
( [ 'home', 'help' ].includes( sectionName ) ||
120-
currentRoute?.startsWith( '/start/do-it-for-me/' ) ) &&
121-
userAllowedToHelpCenter;
117+
// Load for all logged out users only on the devdocs page.
118+
( isLoggedIn === false &&
119+
isEnabled( 'help-center/logged-out' ) &&
120+
'devdocs' === sectionName ) ||
121+
( isLoggedIn &&
122+
// we want to show only the Help center in my home and the help section (but not the FAB)
123+
( [ 'home', 'help' ].includes( sectionName ) ||
124+
currentRoute?.startsWith( '/start/do-it-for-me/' ) ) &&
125+
userAllowedToHelpCenter );
122126

123127
const classes = {
124128
[ 'is-group-' + sectionGroup ]: sectionGroup,

client/layout/masterbar/logged-out.jsx

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { isEnabled } from '@automattic/calypso-config';
12
import { WordPressWordmark, WordPressLogo } from '@automattic/components';
23
import {
34
isDefaultLocale,
@@ -114,6 +115,23 @@ class MasterbarLoggedOut extends Component {
114115
);
115116
}
116117

118+
renderHelpCenter() {
119+
if ( ! isEnabled( 'help-center/logged-out' ) ) {
120+
return null;
121+
}
122+
123+
const { siteId, translate } = this.props;
124+
125+
return (
126+
<AsyncLoad
127+
require="./masterbar-help-center"
128+
siteId={ siteId }
129+
tooltip={ translate( 'Help' ) }
130+
placeholder={ null }
131+
/>
132+
);
133+
}
134+
117135
renderSignupItem() {
118136
const { currentQuery, currentRoute, locale, sectionName, translate } = this.props;
119137

@@ -243,6 +261,7 @@ class MasterbarLoggedOut extends Component {
243261
) }
244262
{ sectionName !== 'reader' && (
245263
<div className="masterbar__login-links">
264+
{ this.renderHelpCenter() }
246265
{ this.renderLoginItem() }
247266
{ this.renderSignupItem() }
248267
</div>

config/development.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@
7373
"google-my-business": true,
7474
"help": true,
7575
"help/gpt-response": true,
76+
"help-center/logged-out": true,
7677
"home/layout-dev": true,
7778
"hosting-server-settings-enhancements": true,
7879
"hosting/datacenter-picker": true,

config/stage.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
"google-my-business": true,
4848
"help": true,
4949
"help/gpt-response": true,
50+
"help-center/logged-out": true,
5051
"hosting-server-settings-enhancements": true,
5152
"summer-special-2025": true,
5253
"summer-special-2025-banner": false,

config/wpcalypso.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
"checkout/ebanx-pix": true,
3232
"checkout/google-pay": true,
3333
"checkout/checkout-version": true,
34+
"help-center/logged-out": true,
3435
"ciab/allow-domain-features": true,
3536
"checkout/razorpay": true,
3637
"checkout/vgs-ebanx": true,

0 commit comments

Comments
 (0)