From 5ab27a5de93a461229804f9fc17a8ab2c2d765d0 Mon Sep 17 00:00:00 2001 From: Surbhi Date: Wed, 18 Dec 2024 17:56:10 -0500 Subject: [PATCH] updated experiment name and addressed other comments --- frontend/src/lib/constants.tsx | 2 +- .../src/scenes/onboarding/sdks/sdksLogic.tsx | 21 ++++++------------- 2 files changed, 7 insertions(+), 16 deletions(-) diff --git a/frontend/src/lib/constants.tsx b/frontend/src/lib/constants.tsx index 3a0cf8a516bd9..fd0d0805137c5 100644 --- a/frontend/src/lib/constants.tsx +++ b/frontend/src/lib/constants.tsx @@ -156,7 +156,7 @@ export const FEATURE_FLAGS = { FF_DASHBOARD_TEMPLATES: 'ff-dashboard-templates', // owner: @EDsCODE ARTIFICIAL_HOG: 'artificial-hog', // owner: @Twixes CS_DASHBOARDS: 'cs-dashboards', // owner: @pauldambra - PRODUCT_ANALYTICS_ONBOARDING: 'product-analytics-onboarding', // owner: @surbhi + PRODUCT_ANALYTICS_MODIFIED_SDK_LIST: 'product-analytics-modified-sdk-list', // owner: @surbhi PRODUCT_SPECIFIC_ONBOARDING: 'product-specific-onboarding', // owner: @raquelmsmith REDIRECT_SIGNUPS_TO_INSTANCE: 'redirect-signups-to-instance', // owner: @raquelmsmith APPS_AND_EXPORTS_UI: 'apps-and-exports-ui', // owner: @benjackwhite diff --git a/frontend/src/scenes/onboarding/sdks/sdksLogic.tsx b/frontend/src/scenes/onboarding/sdks/sdksLogic.tsx index 64120bb8572c8..0ab2ef2fbffff 100644 --- a/frontend/src/scenes/onboarding/sdks/sdksLogic.tsx +++ b/frontend/src/scenes/onboarding/sdks/sdksLogic.tsx @@ -41,7 +41,7 @@ Products that will often be installed in multiple places, eg. web and mobile */ export const multiInstallProducts = [ProductKey.PRODUCT_ANALYTICS, ProductKey.FEATURE_FLAGS] -const getOrderedSDKs = (sdks: SDK[]): SDK[] => { +const getProductAnalyticsOrderedSDKs = (sdks: SDK[]): SDK[] => { return [ ...sdks.filter((sdk) => sdk.key === 'html'), ...sdks.filter((sdk) => sdk.key === 'javascript-web'), @@ -200,10 +200,10 @@ export const sdksLogic = kea([ .filter((sdk) => Object.keys(values.availableSDKInstructionsMap).includes(sdk.key)) if ( - values.featureFlags[FEATURE_FLAGS.PRODUCT_ANALYTICS_ONBOARDING] && + values.featureFlags[FEATURE_FLAGS.PRODUCT_ANALYTICS_MODIFIED_SDK_LIST] === 'test' && values.productKey === ProductKey.PRODUCT_ANALYTICS ) { - filteredSDks = getOrderedSDKs(filteredSDks) + filteredSDks = getProductAnalyticsOrderedSDKs(filteredSDks) } actions.setSDKs(filteredSDks) actions.setSourceOptions(getSourceOptions(values.availableSDKInstructionsMap)) @@ -220,17 +220,8 @@ export const sdksLogic = kea([ actions.setSelectedSDK(null) actions.filterSDKs() }, - [onboardingLogic.actionTypes.setProductKey]: ({ productKey }) => { - // Set default source filter for Product Analytics - if ( - productKey === ProductKey.PRODUCT_ANALYTICS && - values.featureFlags[FEATURE_FLAGS.PRODUCT_ANALYTICS_ONBOARDING] - ) { - actions.setSourceFilter('Recommended') - } else { - actions.setSourceFilter(null) - } - actions.resetSDKs() + [onboardingLogic.actionTypes.setProductKey]: () => { + // TODO: This doesn't seem to run when the setProductKey action is called in onboardingLogic... }, resetSDKs: () => { actions.filterSDKs() @@ -261,7 +252,7 @@ export const sdksLogic = kea([ '/onboarding/:productKey': (_product_key, { sdk }) => { if ( values.productKey === ProductKey.PRODUCT_ANALYTICS && - values.featureFlags[FEATURE_FLAGS.PRODUCT_ANALYTICS_ONBOARDING] + values.featureFlags[FEATURE_FLAGS.PRODUCT_ANALYTICS_MODIFIED_SDK_LIST] === 'test' ) { actions.setSourceFilter('Recommended') }