From da0a7a7a7c19e725079ed25694933e939aa197d5 Mon Sep 17 00:00:00 2001 From: Bogdan Nikolic Date: Thu, 17 Oct 2024 18:10:48 +0200 Subject: [PATCH 1/2] Launchpad: Remove experiment code --- .../hooks/use-launchpad-decider/index.tsx | 4 +--- .../declarative-flow/site-setup-flow.ts | 21 +------------------ client/my-sites/customer-home/controller.jsx | 7 +------ 3 files changed, 3 insertions(+), 29 deletions(-) diff --git a/client/landing/stepper/declarative-flow/internals/hooks/use-launchpad-decider/index.tsx b/client/landing/stepper/declarative-flow/internals/hooks/use-launchpad-decider/index.tsx index 6f77af0257980..fe2d57361b1db 100644 --- a/client/landing/stepper/declarative-flow/internals/hooks/use-launchpad-decider/index.tsx +++ b/client/landing/stepper/declarative-flow/internals/hooks/use-launchpad-decider/index.tsx @@ -1,6 +1,5 @@ import { updateLaunchpadSettings } from '@automattic/data-stores'; import { ExperimentAssignment } from '@automattic/explat-client'; -import { useExperiment } from 'calypso/lib/explat'; export const LAUNCHPAD_EXPERIMENT_NAME = 'calypso_onboarding_launchpad_removal_test_2024_08'; @@ -21,8 +20,7 @@ interface SiteProps { } export const useLaunchpadDecider = ( { exitFlow, navigate }: Props ) => { - const [ isLoadingExperiment, experimentAssignment ] = useExperiment( LAUNCHPAD_EXPERIMENT_NAME ); - const showCustomerHome = shouldShowCustomerHome( isLoadingExperiment, experimentAssignment ); + const showCustomerHome = true; let launchpadStateOnSkip: null | 'skipped' = null; if ( showCustomerHome ) { diff --git a/client/landing/stepper/declarative-flow/site-setup-flow.ts b/client/landing/stepper/declarative-flow/site-setup-flow.ts index 315a98dc52de7..f4aad25b1590a 100644 --- a/client/landing/stepper/declarative-flow/site-setup-flow.ts +++ b/client/landing/stepper/declarative-flow/site-setup-flow.ts @@ -8,7 +8,6 @@ import { isTargetSitePlanCompatible } from 'calypso/blocks/importer/util'; import { useIsSiteAssemblerEnabled } from 'calypso/data/site-assembler'; import { useIsBigSkyEligible } from 'calypso/landing/stepper/hooks/use-is-site-big-sky-eligible'; import { useQuery } from 'calypso/landing/stepper/hooks/use-query'; -import { useExperiment } from 'calypso/lib/explat'; import { ImporterMainPlatform } from 'calypso/lib/importer/types'; import { addQueryArgs } from 'calypso/lib/route'; import { useDispatch as reduxDispatch, useSelector } from 'calypso/state'; @@ -20,11 +19,7 @@ import { useSiteData } from '../hooks/use-site-data'; import { useCanUserManageOptions } from '../hooks/use-user-can-manage-options'; import { ONBOARD_STORE, SITE_STORE, USER_STORE, STEPPER_INTERNAL_STORE } from '../stores'; import { shouldRedirectToSiteMigration } from './helpers'; -import { - useLaunchpadDecider, - getLaunchpadStateBasedOnExperiment, - LAUNCHPAD_EXPERIMENT_NAME, -} from './internals/hooks/use-launchpad-decider'; +import { useLaunchpadDecider } from './internals/hooks/use-launchpad-decider'; import { STEPS } from './internals/steps'; import { redirect } from './internals/steps-repository/import/util'; import { ProcessingResult } from './internals/steps-repository/processing-step/constants'; @@ -167,9 +162,6 @@ const siteSetupFlow: Flow = { const { setDesignOnSite } = useDispatch( SITE_STORE ); const dispatch = reduxDispatch(); - const [ isLoadingLaunchpadExperiment, launchpadExperimentAssigment ] = - useExperiment( LAUNCHPAD_EXPERIMENT_NAME ); - const getLaunchpadScreenValue = ( intent: string, shouldSkip: boolean @@ -178,17 +170,6 @@ const siteSetupFlow: Flow = { return 'off'; } - const launchpadState = getLaunchpadStateBasedOnExperiment( - isLoadingLaunchpadExperiment, - launchpadExperimentAssigment, - shouldSkip - ); - - if ( launchpadState ) { - return launchpadState; - } - - // We shouldn't get here, but match the default/existing behaviour if ( shouldSkip ) { return 'skipped'; } diff --git a/client/my-sites/customer-home/controller.jsx b/client/my-sites/customer-home/controller.jsx index 87d7bcbb959f9..0b041d567ebbf 100644 --- a/client/my-sites/customer-home/controller.jsx +++ b/client/my-sites/customer-home/controller.jsx @@ -1,7 +1,6 @@ import page from '@automattic/calypso-router'; import { fetchLaunchpad } from '@automattic/data-stores'; import { areLaunchpadTasksCompleted } from 'calypso/landing/stepper/declarative-flow/internals/steps-repository/launchpad/task-helper'; -import { loadExperimentAssignment } from 'calypso/lib/explat'; import { getQueryArgs } from 'calypso/lib/query-args'; import { fetchModuleList } from 'calypso/state/jetpack/modules/actions'; import { fetchSitePlugins } from 'calypso/state/plugins/installed/actions'; @@ -68,11 +67,7 @@ export async function maybeRedirect( context, next ) { checklist: launchpadChecklist, } = await fetchLaunchpad( slug ); - const experimentAssignment = await loadExperimentAssignment( - 'calypso_onboarding_launchpad_removal_test_2024_08' - ); - - const shouldShowLaunchpad = 'treatment' !== experimentAssignment?.variationName; + const shouldShowLaunchpad = true; if ( shouldShowLaunchpad && From 444403add1a83fe602e3bfa9728c30a4a1d8c766 Mon Sep 17 00:00:00 2001 From: Bogdan Nikolic Date: Fri, 18 Oct 2024 15:42:10 +0200 Subject: [PATCH 2/2] Fix missing flag value --- .../internals/hooks/use-launchpad-decider/index.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/landing/stepper/declarative-flow/internals/hooks/use-launchpad-decider/index.tsx b/client/landing/stepper/declarative-flow/internals/hooks/use-launchpad-decider/index.tsx index fe2d57361b1db..353a47ab33fa6 100644 --- a/client/landing/stepper/declarative-flow/internals/hooks/use-launchpad-decider/index.tsx +++ b/client/landing/stepper/declarative-flow/internals/hooks/use-launchpad-decider/index.tsx @@ -20,7 +20,8 @@ interface SiteProps { } export const useLaunchpadDecider = ( { exitFlow, navigate }: Props ) => { - const showCustomerHome = true; + // placeholder field for the experiment assignment + const showCustomerHome = false; let launchpadStateOnSkip: null | 'skipped' = null; if ( showCustomerHome ) {