Skip to content

Commit

Permalink
feat: remove ff code for where to redirect people after onboarding to…
Browse files Browse the repository at this point in the history
… pa. (#20990)

remove ff code
  • Loading branch information
xrdt authored Mar 19, 2024
1 parent 3973f21 commit fefc8d2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
18 changes: 7 additions & 11 deletions frontend/src/scenes/onboarding/onboardingLogic.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { actions, connect, kea, listeners, path, props, reducers, selectors } from 'kea'
import { actionToUrl, combineUrl, router, urlToAction } from 'kea-router'
import { FEATURE_FLAGS } from 'lib/constants'
import { featureFlagLogic, FeatureFlagsSet } from 'lib/logic/featureFlagLogic'
import { actionToUrl, router, urlToAction } from 'kea-router'
import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
import { eventUsageLogic } from 'lib/utils/eventUsageLogic'
import { billingLogic } from 'scenes/billing/billingLogic'
import { preflightLogic } from 'scenes/PreflightCheck/preflightLogic'
Expand Down Expand Up @@ -62,13 +61,10 @@ export const stepKeyToTitle = (stepKey?: OnboardingStepKey): undefined | string
export type AllOnboardingSteps = OnboardingStep[]
export type OnboardingStep = JSX.Element

export const getProductUri = (productKey: ProductKey, featureFlags?: FeatureFlagsSet): string => {
export const getProductUri = (productKey: ProductKey): string => {
switch (productKey) {
case ProductKey.PRODUCT_ANALYTICS:
return featureFlags &&
featureFlags[FEATURE_FLAGS.REDIRECT_INSIGHT_CREATION_PRODUCT_ANALYTICS_ONBOARDING] === 'test'
? urls.insightNew()
: combineUrl(urls.insights(), {}, { panel: 'activation' }).url
return urls.insightNew()
case ProductKey.SESSION_REPLAY:
return urls.replay()
case ProductKey.FEATURE_FLAGS:
Expand Down Expand Up @@ -168,9 +164,9 @@ export const onboardingLogic = kea<onboardingLogicType>([
},
],
onCompleteOnboardingRedirectUrl: [
(s) => [s.featureFlags, s.productKey],
(featureFlags: FeatureFlagsSet, productKey: string | null) => {
return productKey ? getProductUri(productKey as ProductKey, featureFlags) : urls.default()
(s) => [s.productKey],
(productKey: string | null) => {
return productKey ? getProductUri(productKey as ProductKey) : urls.default()
},
],
totalOnboardingSteps: [
Expand Down
4 changes: 1 addition & 3 deletions frontend/src/scenes/products/Products.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { useActions, useValues } from 'kea'
import { router } from 'kea-router'
import { LemonCard } from 'lib/lemon-ui/LemonCard/LemonCard'
import { Spinner } from 'lib/lemon-ui/Spinner'
import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
import { eventUsageLogic } from 'lib/utils/eventUsageLogic'
import { billingLogic } from 'scenes/billing/billingLogic'
import { getProductUri, onboardingLogic } from 'scenes/onboarding/onboardingLogic'
Expand Down Expand Up @@ -44,7 +43,6 @@ export function ProductCard({
className?: string
}): JSX.Element {
const { currentTeam } = useValues(teamLogic)
const { featureFlags } = useValues(featureFlagLogic)
const { setIncludeIntro } = useActions(onboardingLogic)
const { user } = useValues(userLogic)
const { reportOnboardingProductSelected } = useActions(eventUsageLogic)
Expand Down Expand Up @@ -77,7 +75,7 @@ export function ProductCard({
className="relative"
onClick={(e) => {
e.stopPropagation()
router.actions.push(getProductUri(product.type as ProductKey, featureFlags))
router.actions.push(getProductUri(product.type as ProductKey))
}}
>
<Icons.IconCheckCircle className="absolute top-0 right-0" color="green" />
Expand Down

0 comments on commit fefc8d2

Please sign in to comment.