Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: remove ff code for where to redirect people after onboarding to pa. #20990

Merged
merged 1 commit into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading