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: hide integrated persons / personfull addon #21238

Merged
merged 5 commits into from
Mar 29, 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
2 changes: 2 additions & 0 deletions frontend/src/mocks/fixtures/_billing_v2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,7 @@ export const billingJson: BillingV2Type = {
addons: [
{
name: 'Group analytics',
inclusion_only: false,
description:
'Associate events with a group or entity - such as a company, community, or project. Analyze these events as if they were sent by that entity itself. Great for B2B, marketplaces, and more.',
price_description: null,
Expand Down Expand Up @@ -512,6 +513,7 @@ export const billingJson: BillingV2Type = {
},
{
name: 'Data pipelines',
inclusion_only: false,
description:
'Get your PostHog data into your data warehouse or other tools like BigQuery, Redshift, Customer.io, and more.',
price_description: null,
Expand Down
1 change: 1 addition & 0 deletions frontend/src/scenes/billing/Billing.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ export const BillingUnsubscribeModal_DataPipelines = (): JSX.Element => {
plans: [],
usage_key: '',
contact_support: false,
inclusion_only: false,
},
]

Expand Down
8 changes: 5 additions & 3 deletions frontend/src/scenes/billing/BillingProduct.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -586,9 +586,11 @@ export const BillingProduct = ({ product }: { product: BillingProductV2Type }):
<div className="pb-8">
<h4 className="my-4">Addons</h4>
<div className="gap-y-4 flex flex-col">
{product.addons.map((addon, i) => {
return <BillingProductAddon key={i} addon={addon} />
})}
{product.addons
.filter((addon) => !addon.inclusion_only)
.map((addon, i) => {
return <BillingProductAddon key={i} addon={addon} />
})}
</div>
</div>
)}
Expand Down
1 change: 1 addition & 0 deletions frontend/src/scenes/billing/PlanComparison.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ export const PlanComparison = ({
)}
{includeAddons &&
product.addons?.map((addon) => {
// TODO: integrated_persons addon will show up here when we add a price plan. Make sure this can handle it.
return addon.tiered ? (
<tr key={addon.name + 'pricing-row'} className="PlanTable__tr__border">
<th scope="row">
Expand Down
6 changes: 5 additions & 1 deletion frontend/src/scenes/billing/billing-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,11 @@ export const getUpgradeProductLink = (
url += `${product.type}:${upgradeToPlanKey},`
if (includeAddons && product.addons?.length) {
for (const addon of product.addons) {
if (addon.plans?.[0]?.plan_key) {
if (
// TODO: this breaks if we support multiple plans per addon due to just grabbing the first plan
addon.plans?.[0]?.plan_key &&
!addon.inclusion_only
) {
url += `${addon.type}:${addon.plans[0].plan_key},`
}
}
Expand Down
1 change: 1 addition & 0 deletions frontend/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1427,6 +1427,7 @@ export interface BillingProductV2AddonType {
subscribed: boolean
// sometimes addons are included with the base product, but they aren't subscribed individually
included_with_main_product?: boolean
inclusion_only: boolean | null
contact_support: boolean | null
unit: string | null
unit_amount_usd: string | null
Expand Down
Loading