@@ -2,8 +2,9 @@ import config from '@automattic/calypso-config';
2
2
import { useHasEnTranslation } from '@automattic/i18n-utils' ;
3
3
import { SiteExcerptData } from '@automattic/sites' ;
4
4
import { useI18n } from '@wordpress/react-i18n' ;
5
- import React , { useMemo , useEffect } from 'react' ;
5
+ import React , { useMemo , useEffect , useState } from 'react' ;
6
6
import ItemView from 'calypso/layout/hosting-dashboard/item-view' ;
7
+ import { loadExperimentAssignment } from 'calypso/lib/explat' ;
7
8
import HostingFeaturesIcon from 'calypso/sites/hosting-features/components/hosting-features-icon' ;
8
9
import { areHostingFeaturesSupported } from 'calypso/sites/hosting-features/features' ;
9
10
import { useStagingSite } from 'calypso/sites/tools/staging-site/hooks/use-staging-site' ;
@@ -81,6 +82,18 @@ const DotcomPreviewPane = ( {
81
82
const isPlanExpired = ! ! site . plan ?. expired ;
82
83
const isMigrationPending = getMigrationStatus ( site ) === 'pending' ;
83
84
85
+ const [ isDuplicateViewsExperiment , setIsDuplicateViewsExperiment ] = useState ( false ) ;
86
+ useEffect ( ( ) => {
87
+ const experimentName = 'calypso_post_onboarding_holdout_160125' ;
88
+ ( async ( ) => {
89
+ const duplicateViewsExperimentAssignment = await loadExperimentAssignment ( experimentName ) ;
90
+ if ( duplicateViewsExperimentAssignment . variationName === 'treatment' ) {
91
+ console . log ( 'You are in the duplicate views experiment' ) ;
92
+ setIsDuplicateViewsExperiment ( true ) ;
93
+ }
94
+ } ) ( ) ;
95
+ } , [ ] ) ;
96
+
84
97
const features : FeaturePreviewInterface [ ] = useMemo ( ( ) => {
85
98
const isActiveAtomicSite = isAtomicSite && ! isPlanExpired ;
86
99
const siteFeatures = [
@@ -168,8 +181,8 @@ const DotcomPreviewPane = ( {
168
181
featureIds : [ TOOLS ] ,
169
182
} ,
170
183
{
171
- label : __ ( 'Settings' ) ,
172
- enabled : config . isEnabled ( 'untangling/hosting-menu' ) ,
184
+ label : __ ( 'Site Settings' ) ,
185
+ enabled : config . isEnabled ( 'untangling/hosting-menu' ) || isDuplicateViewsExperiment ,
173
186
featureIds : [
174
187
SETTINGS_SITE ,
175
188
SETTINGS_ADMINISTRATION ,
@@ -178,13 +191,17 @@ const DotcomPreviewPane = ( {
178
191
SETTINGS_ADMINISTRATION_DELETE_SITE ,
179
192
SETTINGS_CACHING ,
180
193
SETTINGS_WEB_SERVER ,
194
+ ...[ isDuplicateViewsExperiment ? DOTCOM_HOSTING_CONFIG : null ] ,
181
195
] ,
182
196
} ,
183
197
{
184
198
label : hasEnTranslation ( 'Server Settings' )
185
199
? __ ( 'Server Settings' )
186
200
: __ ( 'Server Config' ) ,
187
- enabled : isActiveAtomicSite && ! config . isEnabled ( 'untangling/hosting-menu' ) ,
201
+ enabled :
202
+ ! isDuplicateViewsExperiment &&
203
+ isActiveAtomicSite &&
204
+ ! config . isEnabled ( 'untangling/hosting-menu' ) ,
188
205
featureIds : [ DOTCOM_HOSTING_CONFIG ] ,
189
206
} ,
190
207
] ;
0 commit comments