Skip to content

Commit

Permalink
updated experiment name and addressed other comments
Browse files Browse the repository at this point in the history
  • Loading branch information
surbhi-posthog committed Dec 18, 2024
1 parent d639bc6 commit 5ab27a5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 16 deletions.
2 changes: 1 addition & 1 deletion frontend/src/lib/constants.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
21 changes: 6 additions & 15 deletions frontend/src/scenes/onboarding/sdks/sdksLogic.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down Expand Up @@ -200,10 +200,10 @@ export const sdksLogic = kea<sdksLogicType>([
.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))
Expand All @@ -220,17 +220,8 @@ export const sdksLogic = kea<sdksLogicType>([
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()
Expand Down Expand Up @@ -261,7 +252,7 @@ export const sdksLogic = kea<sdksLogicType>([
'/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')
}
Expand Down

0 comments on commit 5ab27a5

Please sign in to comment.