From 92fa5395f37d4ba6ce30b3c546b53f220cf602a4 Mon Sep 17 00:00:00 2001 From: Raquel Smith Date: Thu, 14 Mar 2024 08:28:32 -0700 Subject: [PATCH] fix: don't show billing step on self-hosted (#20931) don't show billing step on self-hosted --- frontend/src/scenes/onboarding/onboardingLogic.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/frontend/src/scenes/onboarding/onboardingLogic.tsx b/frontend/src/scenes/onboarding/onboardingLogic.tsx index bb1c625f78a38..f6b597b74414a 100644 --- a/frontend/src/scenes/onboarding/onboardingLogic.tsx +++ b/frontend/src/scenes/onboarding/onboardingLogic.tsx @@ -4,6 +4,7 @@ import { FEATURE_FLAGS } from 'lib/constants' import { featureFlagLogic, FeatureFlagsSet } from 'lib/logic/featureFlagLogic' import { eventUsageLogic } from 'lib/utils/eventUsageLogic' import { billingLogic } from 'scenes/billing/billingLogic' +import { preflightLogic } from 'scenes/PreflightCheck/preflightLogic' import { Scene } from 'scenes/sceneTypes' import { teamLogic } from 'scenes/teamLogic' import { urls } from 'scenes/urls' @@ -92,6 +93,8 @@ export const onboardingLogic = kea([ ['featureFlags'], userLogic, ['user'], + preflightLogic, + ['isCloudOrDev'], ], actions: [billingLogic, ['loadBillingSuccess'], teamLogic, ['updateCurrentTeam', 'updateCurrentTeamSuccess']], }), @@ -200,8 +203,11 @@ export const onboardingLogic = kea([ }, ], shouldShowBillingStep: [ - (s) => [s.product, s.subscribedDuringOnboarding], - (product: BillingProductV2Type | null, subscribedDuringOnboarding: boolean) => { + (s) => [s.product, s.subscribedDuringOnboarding, s.isCloudOrDev], + (product: BillingProductV2Type | null, subscribedDuringOnboarding: boolean, isCloudOrDev) => { + if (!isCloudOrDev) { + return false + } const hasAllAddons = product?.addons?.every((addon) => addon.subscribed) return !product?.subscribed || !hasAllAddons || subscribedDuringOnboarding },