From 6a68f5dde6340e0fa919b1ac4586203b52c99d24 Mon Sep 17 00:00:00 2001 From: Richard Fontein <32132657+rifont@users.noreply.github.com> Date: Tue, 9 Apr 2024 18:27:32 +0100 Subject: [PATCH] chore(web): Add feature flag for Hubspot onboarding flow (#5386) * chore: Add feature flag for Hubspot onboarding flow * fix: Add missing condition --- apps/web/src/pages/auth/QuestionnairePage.tsx | 16 +++++++++++++--- .../src/types/feature-flags/feature-flags.ts | 1 + 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/apps/web/src/pages/auth/QuestionnairePage.tsx b/apps/web/src/pages/auth/QuestionnairePage.tsx index 2afcf1ab85e..04d1c4df411 100644 --- a/apps/web/src/pages/auth/QuestionnairePage.tsx +++ b/apps/web/src/pages/auth/QuestionnairePage.tsx @@ -3,13 +3,18 @@ import AuthContainer from '../../components/layout/components/AuthContainer'; import { QuestionnaireForm } from './components/QuestionnaireForm'; import { useVercelIntegration } from '../../hooks'; import SetupLoader from './components/SetupLoader'; -import { ENV, IS_DOCKER_HOSTED } from '@novu/shared-web'; +import { ENV, IS_DOCKER_HOSTED, useFeatureFlag } from '@novu/shared-web'; import { HubspotSignupForm } from './components/HubspotSignupForm'; +import { FeatureFlagsKeysEnum } from '@novu/shared'; +import { When } from '@novu/design-system'; export default function QuestionnairePage() { const { isLoading } = useVercelIntegration(); + const isHubspotFormEnabled = useFeatureFlag(FeatureFlagsKeysEnum.IS_HUBSPOT_ONBOARDING_ENABLED); const isNovuProd = !IS_DOCKER_HOSTED && ENV === 'production'; + const shouldUseHubspotForm = isHubspotFormEnabled && isNovuProd; + return ( {isLoading ? ( @@ -17,9 +22,14 @@ export default function QuestionnairePage() { ) : ( - {!isNovuProd ? : } + + + + + + )} diff --git a/libs/shared/src/types/feature-flags/feature-flags.ts b/libs/shared/src/types/feature-flags/feature-flags.ts index 0d3320140ff..1eb4cf87b64 100644 --- a/libs/shared/src/types/feature-flags/feature-flags.ts +++ b/libs/shared/src/types/feature-flags/feature-flags.ts @@ -12,4 +12,5 @@ export enum FeatureFlagsKeysEnum { IS_IMPROVED_ONBOARDING_ENABLED = 'IS_IMPROVED_ONBOARDING_ENABLED', IS_NEW_MESSAGES_API_RESPONSE_ENABLED = 'IS_NEW_MESSAGES_API_RESPONSE_ENABLED', IS_BILLING_REVERSE_TRIAL_ENABLED = 'IS_BILLING_REVERSE_TRIAL_ENABLED', + IS_HUBSPOT_ONBOARDING_ENABLED = 'IS_HUBSPOT_ONBOARDING_ENABLED', }