Skip to content

Commit

Permalink
feat: hide integrated persons / personfull addon (#21238)
Browse files Browse the repository at this point in the history
* hide addon from billing page

* hide from plan comparison and don't include in upgrade link

* rename

* fix types

* fix type
  • Loading branch information
raquelmsmith authored Mar 29, 2024
1 parent 5e3c3b9 commit 92e17ce
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 4 deletions.
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

0 comments on commit 92e17ce

Please sign in to comment.