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: Experiment with language on billing pages in app #20567

Merged
merged 66 commits into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
f96e4d8
toggle upgrade language depending on flag value
Feb 27, 2024
99653cc
forgot some local changes
Feb 27, 2024
8f4728c
Merge remote-tracking branch 'origin/master' into by/billing-page-lan…
Feb 29, 2024
24472cf
update credit card case language
Feb 29, 2024
b126319
Update UI snapshots for `chromium` (1)
github-actions[bot] Feb 29, 2024
eab15c7
add event to record subscription status
Mar 1, 2024
756e0eb
Merge remote-tracking branch 'origin/master' into by/billing-page-lan…
Mar 1, 2024
060cab2
Update UI snapshots for `chromium` (1)
github-actions[bot] Mar 1, 2024
a36121c
Update UI snapshots for `chromium` (2)
github-actions[bot] Mar 1, 2024
c598759
add tests
Mar 1, 2024
bd3c9d4
remove length check
Mar 1, 2024
f156bd1
Update UI snapshots for `chromium` (1)
github-actions[bot] Mar 2, 2024
2020dd7
Merge remote-tracking branch 'origin/master' into by/billing-page-lan…
Mar 4, 2024
3b6537f
Update UI snapshots for `chromium` (1)
github-actions[bot] Mar 4, 2024
bdd10b4
Update UI snapshots for `webkit` (2)
github-actions[bot] Mar 4, 2024
809f967
Update UI snapshots for `chromium` (2)
github-actions[bot] Mar 4, 2024
86ea4b1
Update UI snapshots for `webkit` (2)
github-actions[bot] Mar 4, 2024
cae427d
Update UI snapshots for `chromium` (2)
github-actions[bot] Mar 4, 2024
e7be167
make common button component
Mar 4, 2024
7b398db
some more small changes
Mar 5, 2024
f7b0efa
Update UI snapshots for `webkit` (2)
github-actions[bot] Mar 5, 2024
0aa359c
Update UI snapshots for `webkit` (2)
github-actions[bot] Mar 5, 2024
f6c6dec
Merge remote-tracking branch 'origin/master' into by/billing-page-lan…
Mar 5, 2024
eebfea9
remove extraneous files
Mar 5, 2024
811bd28
remove optional chaining
Mar 5, 2024
3a60b37
Update UI snapshots for `webkit` (2)
github-actions[bot] Mar 5, 2024
37c8aba
Update UI snapshots for `webkit` (2)
github-actions[bot] Mar 5, 2024
c1053d7
Update UI snapshots for `webkit` (2)
github-actions[bot] Mar 5, 2024
eee2dbf
Merge remote-tracking branch 'origin/master' into by/billing-page-lan…
Mar 6, 2024
b05947d
remove test...rename event
Mar 6, 2024
e5f1928
Merge branch 'master' into by/billing-page-language
xrdt Mar 6, 2024
770e636
Update UI snapshots for `chromium` (1)
github-actions[bot] Mar 6, 2024
6872e41
didn't save before commiting
Mar 6, 2024
e750e0c
undo changes to billing cypress test
Mar 6, 2024
c94aa31
Update UI snapshots for `chromium` (1)
github-actions[bot] Mar 6, 2024
66db709
Update UI snapshots for `chromium` (2)
github-actions[bot] Mar 6, 2024
e3d8e41
finally get cypress to work!
Mar 7, 2024
578068f
Merge remote-tracking branch 'origin/master' into by/billing-page-lan…
Mar 7, 2024
f9de718
small fix to test
Mar 7, 2024
e89e47c
Merge remote-tracking branch 'origin' into by/billing-page-language
Mar 7, 2024
1bee5a0
Update UI snapshots for `chromium` (2)
github-actions[bot] Mar 7, 2024
15c0b1c
Update UI snapshots for `chromium` (2)
github-actions[bot] Mar 7, 2024
0c06558
Merge remote-tracking branch 'origin/master' into by/billing-page-lan…
Mar 13, 2024
74a0b70
remove from paygate mini
Mar 13, 2024
22fa7de
Update UI snapshots for `chromium` (1)
github-actions[bot] Mar 13, 2024
2859414
Update UI snapshots for `chromium` (2)
github-actions[bot] Mar 13, 2024
195b386
Update UI snapshots for `chromium` (1)
github-actions[bot] Mar 13, 2024
9e3d648
Merge remote-tracking branch 'origin/master' into by/billing-page-lan…
Mar 14, 2024
3dbfcbc
remove paygate test
Mar 14, 2024
4b63d15
Update UI snapshots for `webkit` (2)
github-actions[bot] Mar 14, 2024
8195a88
Update UI snapshots for `chromium` (2)
github-actions[bot] Mar 14, 2024
d9075e4
Update UI snapshots for `chromium` (2)
github-actions[bot] Mar 14, 2024
80d1bf7
remove extraneous files
Mar 14, 2024
1dd2cfd
remove files!
Mar 14, 2024
c78fbf5
Merge remote-tracking branch 'origin/master' into by/billing-page-lan…
Mar 14, 2024
2f726c2
Update UI snapshots for `webkit` (2)
github-actions[bot] Mar 14, 2024
4f9625d
Update UI snapshots for `chromium` (1)
github-actions[bot] Mar 14, 2024
b230f95
Update UI snapshots for `chromium` (2)
github-actions[bot] Mar 14, 2024
96e2d8d
Update UI snapshots for `chromium` (1)
github-actions[bot] Mar 14, 2024
58dff56
Update UI snapshots for `chromium` (1)
github-actions[bot] Mar 14, 2024
4adb470
Merge branch 'master' into by/billing-page-language
raquelmsmith Mar 14, 2024
fa83cfc
update tests
Mar 15, 2024
e4874b3
Merge remote-tracking branch 'origin/master' into by/billing-page-lan…
Mar 18, 2024
e82d259
Update UI snapshots for `webkit` (2)
github-actions[bot] Mar 18, 2024
88e10ac
Update UI snapshots for `chromium` (1)
github-actions[bot] Mar 18, 2024
518f7fd
Update UI snapshots for `chromium` (2)
github-actions[bot] Mar 18, 2024
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
57 changes: 57 additions & 0 deletions cypress/e2e/billingUpgradeCTA.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import { decideResponse } from '../fixtures/api/decide'
import * as fflate from 'fflate'

// Mainly testing to make sure events are fired as expected

describe('Billing Upgrade CTA', () => {
beforeEach(() => {
cy.intercept('**/decide/*', (req) =>
req.reply(
decideResponse({
'billing-upgrade-language': 'credit_card',
})
)
)

cy.intercept('/api/billing-v2/', { fixture: 'api/billing-v2/billing-v2-unsubscribed.json' })
})

it('Check that events are being sent on each page visit', () => {
cy.visit('/organization/billing')
cy.get('[data-attr=product_analytics-upgrade-cta] .LemonButton__content').should('have.text', 'Add credit card')
cy.window().then((win) => {
const events = (win as any)._cypress_posthog_captures

const matchingEvents = events.filter((event) => event.event === 'billing CTA shown')
// One for each product card
expect(matchingEvents.length).to.equal(4)
})

// Mock billing response with subscription
cy.intercept('/api/billing-v2/', { fixture: 'api/billing-v2/billing-v2.json' })
cy.reload()

cy.get('[data-attr=session_replay-upgrade-cta] .LemonButton__content').should('have.text', 'Add paid plan')
cy.intercept('POST', '**/e/?compression=gzip-js*').as('capture3')
cy.window().then((win) => {
const events = (win as any)._cypress_posthog_captures

const matchingEvents = events.filter((event) => event.event === 'billing CTA shown')
expect(matchingEvents.length).to.equal(4)
})

cy.intercept('/api/billing-v2/', { fixture: 'api/billing-v2/billing-v2-unsubscribed.json' })
// Navigate to the onboarding billing step
cy.visit('/products')
cy.get('[data-attr=product_analytics-onboarding-card]').click()
cy.get('[data-attr=onboarding-breadcrumbs] > :nth-child(5)').click()

cy.intercept('POST', '**/e/?compression=gzip-js*').as('capture4')
cy.window().then((win) => {
const events = (win as any)._cypress_posthog_captures

const matchingEvents = events.filter((event) => event.event === 'billing CTA shown')
expect(matchingEvents.length).to.equal(3)
})
})
})
738 changes: 581 additions & 157 deletions cypress/fixtures/api/billing-v2/billing-v2-unsubscribed.json

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions frontend/src/layout/navigation/ProjectSwitcher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export function ProjectSwitcherOverlay({ onClickInside }: { onClickInside?: () =
fullWidth
disabled={!!projectCreationForbiddenReason}
tooltip={projectCreationForbiddenReason}
data-attr="new-project-button"
onClick={() => {
onClickInside?.()
guardAvailableFeature(
Expand Down
13 changes: 13 additions & 0 deletions frontend/src/lib/components/BillingUpgradeCTA.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { useActions } from 'kea'
import { LemonButton, LemonButtonProps } from 'lib/lemon-ui/LemonButton'
import { eventUsageLogic } from 'lib/utils/eventUsageLogic'
import { useEffect } from 'react'

export function BillingUpgradeCTA({ children, ...props }: LemonButtonProps): JSX.Element {
const { reportBillingCTAShown } = useActions(eventUsageLogic)
useEffect(() => {
reportBillingCTAShown()
}, [])

return <LemonButton {...props}>{children}</LemonButton>
}
1 change: 1 addition & 0 deletions frontend/src/lib/constants.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ export const FEATURE_FLAGS = {
REPLAY_SIMILAR_RECORDINGS: 'session-replay-similar-recordings', // owner: #team-replay
SAVED_NOT_PINNED: 'saved-not-pinned', // owner: #team-replay
EXPORTS_SIDEPANEL: 'exports-sidepanel', // owner: #team-product-analytics
BILLING_UPGRADE_LANGUAGE: 'billing-upgrade-language', // owner: @biancayang
NEW_EXPERIMENTS_UI: 'new-experiments-ui', // owner: @jurajmajerik #team-feature-success
SESSION_REPLAY_V3_INGESTION_PLAYBACK: 'session-replay-v3-ingestion-playback', // owner: @benjackwhite
SESSION_REPLAY_FILTER_ORDERING: 'session-replay-filter-ordering', // owner: #team-replay
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/lib/lemon-ui/LemonModal/LemonModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export interface LemonModalProps {
forceAbovePopovers?: boolean
contentRef?: React.RefCallback<HTMLDivElement>
overlayRef?: React.RefCallback<HTMLDivElement>
'data-attr'?: string
}

export const LemonModalHeader = ({ children, className }: LemonModalInnerProps): JSX.Element => {
Expand Down Expand Up @@ -82,14 +83,15 @@ export function LemonModal({
contentRef,
overlayRef,
hideCloseButton = false,
'data-attr': dataAttr,
}: LemonModalProps): JSX.Element {
const nodeRef = useRef(null)
const [ignoredOverlayClickCount, setIgnoredOverlayClickCount] = useState(0)

useEffect(() => setIgnoredOverlayClickCount(0), [hasUnsavedInput]) // Reset when there no longer is unsaved input

const modalContent = (
<div ref={nodeRef} className="LemonModal__container">
<div ref={nodeRef} className="LemonModal__container" data-attr={dataAttr}>
{closable && !hideCloseButton && (
// The key causes the div to be re-rendered, which restarts the animation,
// providing immediate visual feedback on click
Expand Down
4 changes: 4 additions & 0 deletions frontend/src/lib/utils/eventUsageLogic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -507,8 +507,12 @@ export const eventUsageLogic = kea<eventUsageLogicType>([
reportCommandBarSearchResultOpened: (type: ResultType) => ({ type }),
reportCommandBarActionSearch: (query: string) => ({ query }),
reportCommandBarActionResultExecuted: (resultDisplay) => ({ resultDisplay }),
reportBillingCTAShown: true,
}),
listeners(({ values }) => ({
reportBillingCTAShown: () => {
posthog.capture('billing CTA shown')
},
reportAxisUnitsChanged: (properties) => {
posthog.capture('axis units changed', properties)
},
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/scenes/UpgradeModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ export function UpgradeModal(): JSX.Element {
isGrandfathered={upgradeModalIsGrandfathered ?? undefined}
background={false}
>
<>
<div className="pr-7">
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sure the text doesn't overlap with the X button to close the modal

You should have access to this feature already. If you are still seeing this modal, please let
us know 🙂
</>
</div>
</PayGateMini>
</div>
</LemonModal>
Expand Down
18 changes: 15 additions & 3 deletions frontend/src/scenes/billing/Billing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,18 @@ import clsx from 'clsx'
import { useActions, useValues } from 'kea'
import { Field, Form } from 'kea-forms'
import { router } from 'kea-router'
import { BillingUpgradeCTA } from 'lib/components/BillingUpgradeCTA'
import { SurprisedHog } from 'lib/components/hedgehogs'
import { PageHeader } from 'lib/components/PageHeader'
import { supportLogic } from 'lib/components/Support/supportLogic'
import { FEATURE_FLAGS } from 'lib/constants'
import { dayjs } from 'lib/dayjs'
import { useResizeBreakpoints } from 'lib/hooks/useResizeObserver'
import { LemonBanner } from 'lib/lemon-ui/LemonBanner'
import { LemonLabel } from 'lib/lemon-ui/LemonLabel/LemonLabel'
import { SpinnerOverlay } from 'lib/lemon-ui/Spinner/Spinner'
import { Tooltip } from 'lib/lemon-ui/Tooltip'
import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
import { useEffect } from 'react'
import { preflightLogic } from 'scenes/PreflightCheck/preflightLogic'
import { SceneExport } from 'scenes/sceneTypes'
Expand Down Expand Up @@ -48,6 +51,7 @@ export function Billing(): JSX.Element {
const { reportBillingV2Shown } = useActions(billingLogic)
const { preflight, isCloudOrDev } = useValues(preflightLogic)
const { openSupportForm } = useActions(supportLogic)
const { featureFlags } = useValues(featureFlagLogic)

if (preflight && !isCloudOrDev) {
router.actions.push(urls.default())
Expand Down Expand Up @@ -310,14 +314,22 @@ export function Billing(): JSX.Element {
<div className="flex justify-between mt-4">
<h2>Products</h2>
{isOnboarding && upgradeAllProductsLink && (
<LemonButton
<BillingUpgradeCTA
type="primary"
icon={<IconPlus />}
to={upgradeAllProductsLink}
disableClientSideRouting
>
Upgrade all
</LemonButton>
{featureFlags[FEATURE_FLAGS.BILLING_UPGRADE_LANGUAGE] === 'subscribe'
? 'Subscribe to all'
: featureFlags[FEATURE_FLAGS.BILLING_UPGRADE_LANGUAGE] === 'credit_card' &&
!billing?.has_active_subscription
? 'Add credit card to all products'
: featureFlags[FEATURE_FLAGS.BILLING_UPGRADE_LANGUAGE] === 'credit_card' &&
billing?.has_active_subscription
? 'Add all products to plan'
: 'Upgrade to all'}{' '}
</BillingUpgradeCTA>
)}
</div>
<LemonDivider className="mt-2 mb-8" />
Expand Down
20 changes: 18 additions & 2 deletions frontend/src/scenes/billing/BillingHero.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
import './BillingHero.scss'

import { useValues } from 'kea'
import { BlushingHog } from 'lib/components/hedgehogs'
import { FEATURE_FLAGS } from 'lib/constants'
import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
import useResizeObserver from 'use-resize-observer'

import { billingLogic } from './billingLogic'

export const BillingHero = (): JSX.Element => {
const { width, ref: billingHeroRef } = useResizeObserver()
const { featureFlags } = useValues(featureFlagLogic)
const { billing } = useValues(billingLogic)

return (
<div className="BillingHero" ref={billingHeroRef}>
Expand All @@ -13,8 +20,17 @@ export const BillingHero = (): JSX.Element => {
<h1 className="ingestion-title">Get the whole hog.</h1>
<h1 className="ingestion-title text-danger">Only pay for what you use.</h1>
<p className="mt-2 mb-0">
Add your credit card details to get access to premium product and platform features. Set billing
limits as low as $0 to control spend.
{featureFlags[FEATURE_FLAGS.BILLING_UPGRADE_LANGUAGE] === 'subscribe'
? 'Subscribe'
: featureFlags[FEATURE_FLAGS.BILLING_UPGRADE_LANGUAGE] === 'credit_card' &&
!billing?.has_active_subscription
? 'Add your credit card'
: featureFlags[FEATURE_FLAGS.BILLING_UPGRADE_LANGUAGE] === 'credit_card' &&
billing?.has_active_subscription
? 'Add the paid plan'
: 'Upgrade'}{' '}
to get access to premium product and platform features. Set billing limits as low as $0 to control
spend.
</p>
</div>
{width && width > 500 && (
Expand Down
33 changes: 27 additions & 6 deletions frontend/src/scenes/billing/BillingProduct.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import { IconCheckCircle, IconChevronDown, IconDocument, IconInfo, IconPlus } fr
import { LemonButton, LemonSelectOptions, LemonTable, LemonTag, Link } from '@posthog/lemon-ui'
import clsx from 'clsx'
import { useActions, useValues } from 'kea'
import { UNSUBSCRIBE_SURVEY_ID } from 'lib/constants'
import { BillingUpgradeCTA } from 'lib/components/BillingUpgradeCTA'
import { FEATURE_FLAGS, UNSUBSCRIBE_SURVEY_ID } from 'lib/constants'
import { useResizeBreakpoints } from 'lib/hooks/useResizeObserver'
import { IconChevronRight } from 'lib/lemon-ui/icons'
import { LemonBanner } from 'lib/lemon-ui/LemonBanner'
Expand Down Expand Up @@ -211,6 +212,7 @@ export const BillingProduct = ({ product }: { product: BillingProductV2Type }):
} = useActions(billingProductLogic({ product, productRef }))
const { reportBillingUpgradeClicked } = useActions(eventUsageLogic)

const { featureFlags } = useValues(featureFlagLogic)
const upgradePlan = currentAndUpgradePlans?.upgradePlan
const currentPlan = currentAndUpgradePlans?.currentPlan
const downgradePlan = currentAndUpgradePlans?.downgradePlan
Expand Down Expand Up @@ -609,8 +611,18 @@ export const BillingProduct = ({ product }: { product: BillingProductV2Type }):
{additionalFeaturesOnUpgradedPlan?.length > 0 ? (
<>
<p className="ml-0 max-w-200">
{!upgradePlan ? 'You now' : `Upgrade to the ${upgradePlan.name} plan to`} get
sweet features such as:
{product.subscribed
? 'You now'
: featureFlags[FEATURE_FLAGS.BILLING_UPGRADE_LANGUAGE] === 'subscribe'
? 'Subscribe to'
: featureFlags[FEATURE_FLAGS.BILLING_UPGRADE_LANGUAGE] === 'credit_card' &&
!billing?.has_active_subscription
? 'Add a credit card to'
: featureFlags[FEATURE_FLAGS.BILLING_UPGRADE_LANGUAGE] === 'credit_card' &&
billing?.has_active_subscription
? 'Add paid plan'
: 'Upgrade to'}{' '}
get sweet features such as:
</p>
<div>
{additionalFeaturesOnUpgradedPlan?.map((feature, i) => {
Expand Down Expand Up @@ -682,7 +694,8 @@ export const BillingProduct = ({ product }: { product: BillingProductV2Type }):
) : (
upgradePlan.included_if !== 'has_subscription' &&
!upgradePlan.unit_amount_usd && (
<LemonButton
<BillingUpgradeCTA
data-attr={`${product.type}-upgrade-cta`}
to={getUpgradeProductLink(
product,
upgradeToPlanKey || '',
Expand All @@ -698,8 +711,16 @@ export const BillingProduct = ({ product }: { product: BillingProductV2Type }):
className="grow"
center
>
Upgrade
</LemonButton>
{featureFlags[FEATURE_FLAGS.BILLING_UPGRADE_LANGUAGE] === 'subscribe'
? 'Subscribe'
: featureFlags[FEATURE_FLAGS.BILLING_UPGRADE_LANGUAGE] ===
'credit_card' && !billing?.has_active_subscription
? 'Add credit card'
: featureFlags[FEATURE_FLAGS.BILLING_UPGRADE_LANGUAGE] ===
'credit_card' && billing?.has_active_subscription
? 'Add paid plan'
: 'Upgrade'}
</BillingUpgradeCTA>
)
)}
</div>
Expand Down
35 changes: 29 additions & 6 deletions frontend/src/scenes/billing/PlanComparison.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import './PlanComparison.scss'

import { IconCheckCircle, IconWarning, IconX } from '@posthog/icons'
import { LemonButton, LemonModal, LemonTag, Link } from '@posthog/lemon-ui'
import { LemonModal, LemonTag, Link } from '@posthog/lemon-ui'
import clsx from 'clsx'
import { useActions, useValues } from 'kea'
import { UNSUBSCRIBE_SURVEY_ID } from 'lib/constants'
import { BillingUpgradeCTA } from 'lib/components/BillingUpgradeCTA'
import { FEATURE_FLAGS, UNSUBSCRIBE_SURVEY_ID } from 'lib/constants'
import { dayjs } from 'lib/dayjs'
import { Tooltip } from 'lib/lemon-ui/Tooltip'
import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
import { eventUsageLogic } from 'lib/utils/eventUsageLogic'
import React from 'react'
import { getProductIcon } from 'scenes/products/Products'
Expand Down Expand Up @@ -119,6 +121,7 @@ export const PlanComparison = ({
const { billing, redirectPath } = useValues(billingLogic)
const { width, ref: planComparisonRef } = useResizeObserver()
const { reportBillingUpgradeClicked } = useActions(eventUsageLogic)
const { featureFlags } = useValues(featureFlagLogic)
const currentPlanIndex = plans.findIndex((plan) => plan.current_plan)
const { surveyID, comparisonModalHighlightedFeatureKey } = useValues(billingProductLogic({ product }))
const { reportSurveyShown, setSurveyResponse } = useActions(billingProductLogic({ product }))
Expand All @@ -131,7 +134,7 @@ export const PlanComparison = ({
const upgradeButtons = plans?.map((plan, i) => {
return (
<td key={`${plan.plan_key}-cta`} className="PlanTable__td__upgradeButton">
<LemonButton
<BillingUpgradeCTA
to={
plan.contact_support
? 'mailto:[email protected]?subject=Enterprise%20plan%20request'
Expand Down Expand Up @@ -182,16 +185,36 @@ export const PlanComparison = ({
i >= currentPlanIndex &&
!billing?.has_active_subscription
? 'View products'
: 'Subscribe'}
</LemonButton>
: plan.free_allocation && !plan.tiers
? 'Select' // Free plan
: featureFlags[FEATURE_FLAGS.BILLING_UPGRADE_LANGUAGE] === 'subscribe'
? 'Subscribe'
: featureFlags[FEATURE_FLAGS.BILLING_UPGRADE_LANGUAGE] === 'credit_card' &&
!billing?.has_active_subscription
? 'Add credit card'
: featureFlags[FEATURE_FLAGS.BILLING_UPGRADE_LANGUAGE] === 'credit_card' &&
billing?.has_active_subscription
? 'Add paid plan'
: 'Upgrade'}
</BillingUpgradeCTA>
{!plan.current_plan && !plan.free_allocation && includeAddons && product.addons?.length > 0 && (
<p className="text-center ml-0 mt-2 mb-0">
<Link
to={`/api/billing-v2/activation?products=${product.type}:${plan.plan_key}&redirect_path=${redirectPath}`}
className="text-muted text-xs"
disableClientSideRouting
>
or subscribe without addons
or{' '}
{featureFlags[FEATURE_FLAGS.BILLING_UPGRADE_LANGUAGE] === 'subscribe'
? 'subscribe'
: featureFlags[FEATURE_FLAGS.BILLING_UPGRADE_LANGUAGE] === 'credit_card' &&
!billing?.has_active_subscription
? 'add credit card'
: featureFlags[FEATURE_FLAGS.BILLING_UPGRADE_LANGUAGE] === 'credit_card' &&
!billing?.has_active_subscription
? 'add paid plan'
: 'upgrade'}{' '}
without addons
</Link>
</p>
)}
Expand Down
Loading
Loading