-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into playwright-wait-for-image-load
- Loading branch information
Showing
150 changed files
with
2,334 additions
and
1,762 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
-362 Bytes
(99%)
...snapshots__/exporter-exporter--funnel-top-to-bottom-breakdown-insight--dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-446 Bytes
(99%)
...napshots__/exporter-exporter--funnel-top-to-bottom-breakdown-insight--light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-10.2 KB
(91%)
frontend/__snapshots__/replay-player-failure--recent-recordings-404--dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-8.78 KB
(92%)
frontend/__snapshots__/replay-player-failure--recent-recordings-404--light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+6.64 KB
(110%)
frontend/__snapshots__/replay-player-success--recent-recordings--dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+6.81 KB
(110%)
frontend/__snapshots__/replay-player-success--recent-recordings--light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+6.62 KB
(110%)
frontend/__snapshots__/replay-player-success--second-recording-in-list--dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+6.77 KB
(110%)
frontend/__snapshots__/replay-player-success--second-recording-in-list--light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-78.1 KB
(31%)
frontend/__snapshots__/scenes-app-dashboards--insight-legend--dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-7.1 KB
(93%)
...apshots__/scenes-app-insights--funnel-top-to-bottom-breakdown--dark--webkit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-4.06 KB
(96%)
...end/__snapshots__/scenes-app-insights--funnel-top-to-bottom-breakdown--dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-7.02 KB
(93%)
...pshots__/scenes-app-insights--funnel-top-to-bottom-breakdown--light--webkit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-4.6 KB
(95%)
...nd/__snapshots__/scenes-app-insights--funnel-top-to-bottom-breakdown--light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-3.88 KB
(98%)
...ts__/scenes-app-insights--funnel-top-to-bottom-breakdown-edit--dark--webkit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-3.78 KB
(98%)
..._snapshots__/scenes-app-insights--funnel-top-to-bottom-breakdown-edit--dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-3.92 KB
(98%)
...s__/scenes-app-insights--funnel-top-to-bottom-breakdown-edit--light--webkit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-3.81 KB
(98%)
...snapshots__/scenes-app-insights--funnel-top-to-bottom-breakdown-edit--light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+7 Bytes
(100%)
frontend/__snapshots__/scenes-app-insights--funnel-top-to-bottom-edit--light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-101 Bytes
(100%)
frontend/__snapshots__/scenes-app-insights--user-paths-edit--light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-4.54 KB
(90%)
frontend/__snapshots__/scenes-app-notebooks--recordings-playlist--light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-614 Bytes
(100%)
frontend/__snapshots__/scenes-app-pipeline--pipeline-destinations-page--dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-602 Bytes
(100%)
frontend/__snapshots__/scenes-app-pipeline--pipeline-destinations-page--light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+1.52 KB
(100%)
...s__/scenes-app-pipeline--pipeline-destinations-page-without-pipelines--dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+1.58 KB
(100%)
...__/scenes-app-pipeline--pipeline-destinations-page-without-pipelines--light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-2.95 KB
(97%)
frontend/__snapshots__/scenes-app-pipeline--pipeline-landing-page--dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-2.83 KB
(97%)
frontend/__snapshots__/scenes-app-pipeline--pipeline-landing-page--light.png
Oops, something went wrong.
Binary file modified
BIN
-2.97 KB
(97%)
...shots__/scenes-app-pipeline--pipeline-landing-page-iff-legacy-sources--dark.png
Oops, something went wrong.
Binary file modified
BIN
-2.83 KB
(97%)
...hots__/scenes-app-pipeline--pipeline-landing-page-iff-legacy-sources--light.png
Oops, something went wrong.
Binary file modified
BIN
-3.25 KB
(92%)
frontend/__snapshots__/scenes-app-pipeline--pipeline-legacy-sources-page--dark.png
Oops, something went wrong.
Binary file modified
BIN
-3.52 KB
(92%)
...tend/__snapshots__/scenes-app-pipeline--pipeline-legacy-sources-page--light.png
Oops, something went wrong.
Binary file modified
BIN
+2.67 KB
(100%)
...tend/__snapshots__/scenes-app-pipeline--pipeline-node-new-destination--dark.png
Oops, something went wrong.
Binary file modified
BIN
+2.65 KB
(100%)
...end/__snapshots__/scenes-app-pipeline--pipeline-node-new-destination--light.png
Oops, something went wrong.
Binary file modified
BIN
+78.6 KB
(400%)
...es-app-pipeline--pipeline-node-new-destination-without-data-pipelines--dark.png
Oops, something went wrong.
Binary file modified
BIN
+79.2 KB
(410%)
...s-app-pipeline--pipeline-node-new-destination-without-data-pipelines--light.png
Oops, something went wrong.
Binary file modified
BIN
-4.1 KB
(99%)
...end/__snapshots__/scenes-app-pipeline--pipeline-nodes-management-page--dark.png
Oops, something went wrong.
Binary file modified
BIN
-4.11 KB
(99%)
...nd/__snapshots__/scenes-app-pipeline--pipeline-nodes-management-page--light.png
Oops, something went wrong.
Binary file modified
BIN
-2.95 KB
(97%)
frontend/__snapshots__/scenes-app-pipeline--pipeline-overview-page--dark.png
Oops, something went wrong.
Binary file modified
BIN
-2.83 KB
(97%)
frontend/__snapshots__/scenes-app-pipeline--pipeline-overview-page--light.png
Oops, something went wrong.
Binary file modified
BIN
-1020 Bytes
(99%)
frontend/__snapshots__/scenes-app-pipeline--pipeline-site-apps-page--dark.png
Oops, something went wrong.
Binary file modified
BIN
-998 Bytes
(99%)
frontend/__snapshots__/scenes-app-pipeline--pipeline-site-apps-page--light.png
Oops, something went wrong.
Binary file modified
BIN
+667 Bytes
(100%)
...tend/__snapshots__/scenes-app-pipeline--pipeline-transformations-page--dark.png
Oops, something went wrong.
Binary file modified
BIN
+804 Bytes
(100%)
...end/__snapshots__/scenes-app-pipeline--pipeline-transformations-page--light.png
Oops, something went wrong.
Binary file modified
BIN
+719 Bytes
(100%)
..._snapshots__/scenes-app-pipeline--pipeline-transformations-page-empty--dark.png
Oops, something went wrong.
Binary file modified
BIN
+945 Bytes
(100%)
...snapshots__/scenes-app-pipeline--pipeline-transformations-page-empty--light.png
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
89 changes: 37 additions & 52 deletions
89
frontend/src/lib/components/PayGateMini/PayGateButton.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,64 +1,49 @@ | ||
import { LemonButton } from '@posthog/lemon-ui' | ||
import { LemonButton, LemonButtonProps } from '@posthog/lemon-ui' | ||
import { useValues } from 'kea' | ||
import { useMemo } from 'react' | ||
import { urls } from 'scenes/urls' | ||
|
||
import { BillingFeatureType, BillingProductV2AddonType, BillingProductV2Type } from '~/types' | ||
import { payGateMiniLogic, PayGateMiniLogicProps } from './payGateMiniLogic' | ||
|
||
interface PayGateButtonProps { | ||
gateVariant: 'add-card' | 'contact-sales' | 'move-to-cloud' | null | ||
productWithFeature: BillingProductV2AddonType | BillingProductV2Type | ||
featureInfo: BillingFeatureType | ||
onCtaClick: () => void | ||
isAddonProduct?: boolean | ||
scrollToProduct: boolean | ||
} | ||
type PayGateButtonProps = PayGateMiniLogicProps & Partial<LemonButtonProps> | ||
export const PayGateButton = ({ feature, currentUsage, ...buttonProps }: PayGateButtonProps): JSX.Element | null => { | ||
const { productWithFeature, featureInfo, gateVariant, isAddonProduct, scrollToProduct } = useValues( | ||
payGateMiniLogic({ feature, currentUsage }) | ||
) | ||
|
||
const ctaLink = useMemo(() => { | ||
if (gateVariant === 'add-card' && !isAddonProduct) { | ||
return `/api/billing/activate?products=all_products:&redirect_path=${urls.organizationBilling()}&intent_product=${ | ||
productWithFeature?.type | ||
}` | ||
} else if (gateVariant === 'add-card') { | ||
return `/organization/billing${scrollToProduct ? `?products=${productWithFeature?.type}` : ''}` | ||
} else if (gateVariant === 'contact-sales') { | ||
return `mailto:[email protected]?subject=Inquiring about ${featureInfo?.name}` | ||
} else if (gateVariant === 'move-to-cloud') { | ||
return 'https://us.posthog.com/signup?utm_medium=in-product&utm_campaign=move-to-cloud' | ||
} | ||
return undefined | ||
}, [gateVariant, isAddonProduct, productWithFeature, featureInfo, scrollToProduct]) | ||
|
||
const ctaLabel = useMemo(() => { | ||
if (gateVariant === 'add-card') { | ||
return 'Upgrade now' | ||
} else if (gateVariant === 'contact-sales') { | ||
return 'Contact sales' | ||
} | ||
return 'Move to PostHog Cloud' | ||
}, [gateVariant]) | ||
|
||
export const PayGateButton = ({ | ||
gateVariant, | ||
productWithFeature, | ||
featureInfo, | ||
onCtaClick, | ||
isAddonProduct, | ||
scrollToProduct = true, | ||
}: PayGateButtonProps): JSX.Element => { | ||
return ( | ||
<LemonButton | ||
to={getCtaLink(gateVariant, productWithFeature, featureInfo, isAddonProduct, scrollToProduct)} | ||
disableClientSideRouting={gateVariant === 'add-card' && !isAddonProduct} | ||
type="primary" | ||
center | ||
onClick={onCtaClick} | ||
{...buttonProps} | ||
to={ctaLink} | ||
disableClientSideRouting={gateVariant === 'add-card' && !isAddonProduct} | ||
> | ||
{getCtaLabel(gateVariant)} | ||
{ctaLabel} | ||
</LemonButton> | ||
) | ||
} | ||
|
||
const getCtaLink = ( | ||
gateVariant: 'add-card' | 'contact-sales' | 'move-to-cloud' | null, | ||
productWithFeature: BillingProductV2AddonType | BillingProductV2Type, | ||
featureInfo: BillingFeatureType, | ||
isAddonProduct?: boolean, | ||
scrollToProduct: boolean = true | ||
): string | undefined => { | ||
if (gateVariant === 'add-card' && !isAddonProduct) { | ||
return `/api/billing/activate?products=all_products:&redirect_path=${urls.organizationBilling()}&intent_product=${ | ||
productWithFeature.type | ||
}` | ||
} else if (gateVariant === 'add-card') { | ||
return `/organization/billing${scrollToProduct ? `?products=${productWithFeature.type}` : ''}` | ||
} else if (gateVariant === 'contact-sales') { | ||
return `mailto:[email protected]?subject=Inquiring about ${featureInfo.name}` | ||
} else if (gateVariant === 'move-to-cloud') { | ||
return 'https://us.posthog.com/signup?utm_medium=in-product&utm_campaign=move-to-cloud' | ||
} | ||
return undefined | ||
} | ||
|
||
const getCtaLabel = (gateVariant: 'add-card' | 'contact-sales' | 'move-to-cloud' | null): string => { | ||
if (gateVariant === 'add-card') { | ||
return 'Upgrade now' | ||
} else if (gateVariant === 'contact-sales') { | ||
return 'Contact sales' | ||
} | ||
return 'Move to PostHog Cloud' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.