Skip to content
Open
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
9 changes: 6 additions & 3 deletions frontend/common/utils/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -397,17 +397,20 @@ const Utils = Object.assign({}, BaseUtils, {
return EnvironmentPermissionDescriptions.UPDATE_FEATURE_STATE
},

getNextPlan: (skipFree?: boolean) => {
getNextPlan: () => {
const currentPlan = Utils.getPlanName(AccountStore.getActiveOrgPlan())
if (currentPlan !== planNames.enterprise && !Utils.isSaas()) {
return planNames.enterprise
}
switch (currentPlan) {
case planNames.free: {
return skipFree ? planNames.startup : planNames.scaleUp
return planNames.startup
}
case planNames.startup: {
return planNames.startup
return planNames.scaleUp
}
case planNames.scaleUp: {
return planNames.enterprise
}
default: {
return planNames.enterprise
Expand Down
4 changes: 2 additions & 2 deletions frontend/env/project_dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ const Project = {
// This is used for Sentry tracking
maintenance: false,
plans: {
scaleUp: { annual: 'scale-up-annual-v2', monthly: 'scale-up-v2' },
startup: { annual: 'startup-annual-v2', monthly: 'startup-v2' },
scaleUp: { annual: 'Scale-Up-v4-USD-Yearly', monthly: 'Scale-Up-v4-USD-Monthly' },
startup: { annual: 'start-up-12-months-v2', monthly: 'startup-v2' },
},
useSecureCookies: true,
...(_globalThis.projectOverrides || {}),
Expand Down
5 changes: 3 additions & 2 deletions frontend/env/project_local.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ const Project = {
// This is used for Sentry tracking
maintenance: false,
plans: {
scaleUp: { annual: 'scale-up-annual-v2', monthly: 'scale-up-v2' },
startup: { annual: 'startup-annual-v2', monthly: 'startup-v2' },
scaleUp: { annual: 'Scale-Up-v4-USD-Yearly', monthly: 'Scale-Up-v4-USD-Monthly' },
startup: { annual: 'start-up-12-months-v2', monthly: 'startup-v2' },
},
cookieSameSite: 'lax',
useSecureCookies: false,
...(_globalThis.projectOverrides || {}),
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/env/project_prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const Project = {
// This is used for Sentry tracking
maintenance: false,
plans: {
scaleUp: { annual: 'scale-up-12-months-v2', monthly: 'scale-up-v2' },
scaleUp: { annual: 'Scale-Up-v4-USD-Yearly', monthly: 'Scale-Up-v4-USD-Monthly' },
startup: { annual: 'start-up-12-months-v2', monthly: 'startup-v2' },
},
useSecureCookies: true,
Expand Down
34 changes: 26 additions & 8 deletions frontend/web/components/modals/payment/Payment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ import BlockedOrgInfo from 'components/BlockedOrgInfo'
import { Organisation } from 'common/types/responses'
import { PricingToggle } from './PricingToggle'
import { PricingPanel } from './PricingPanel'
import { STARTUP_FEATURES, ENTERPRISE_FEATURES } from './pricingFeatures'
import {
STARTUP_FEATURES,
SCALE_UP_FEATURES,
ENTERPRISE_FEATURES,
} from './pricingFeatures'
import {
CHARGEBEE_SCRIPT_URL,
CONTACT_US_URL,
Expand Down Expand Up @@ -104,6 +108,27 @@ export const Payment: FC<PaymentProps> = ({
organisationId={organisation.id}
/>

<PricingPanel
title='Scale-Up'
priceYearly='270'
priceMonthly='300'
seatPriceYearly='50'
seatPriceMonthly='60'
isYearly={yearly}
isFeatured
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This triggers the "Most popular!" tag on the price tile (see screenshot). It's inherited from #4583 — not sure if it should stay. @asaphko please advise!

chargebeePlanId={
yearly
? Project.plans?.scaleUp?.annual
: Project.plans?.scaleUp?.monthly
}
isPurchased={plan.includes('scale-up')}
isDisableAccount={isDisableAccountText}
features={SCALE_UP_FEATURES}
hasActiveSubscription={hasActiveSubscription}
organisationId={organisation.id}
includesFrom='Start-Up'
/>

<PricingPanel
title='Enterprise'
isYearly={yearly}
Expand Down Expand Up @@ -136,13 +161,6 @@ export const Payment: FC<PaymentProps> = ({
}
/>
</Row>
<div className='text-center mt-4'>
*Need something in-between our Enterprise plan for users or API
limits?
<div>
<a href={CONTACT_US_URL}>Reach out</a> to us and we'll help you out
</div>
</div>
</div>
</div>
)
Expand Down
21 changes: 20 additions & 1 deletion frontend/web/components/modals/payment/PricingPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ export type PricingPanelProps = {
title: string
priceMonthly?: string
priceYearly?: string
seatPriceMonthly?: string
seatPriceYearly?: string
includesFrom?: string
isFeatured?: boolean
isYearly: boolean
chargebeePlanId?: string
isPurchased?: boolean
Expand All @@ -27,13 +31,17 @@ export const PricingPanel = ({
features,
hasActiveSubscription,
headerContent,
includesFrom,
isDisableAccount,
isEnterprise,
isFeatured,
isPurchased,
isYearly,
organisationId,
priceMonthly,
priceYearly,
seatPriceMonthly,
seatPriceYearly,
title,
}: PricingPanelProps) => {
return (
Expand All @@ -46,6 +54,11 @@ export const PricingPanel = ({
<div className='p-3 pt-4 pricing-panel-content'>
<div className='pricing-panel-layout'>
<div>
{isFeatured && (
<span className='fw-bold text-primary fs-small'>
Most Popular
</span>
)}
{headerContent && (
<span
className={classNames('featured', {
Expand Down Expand Up @@ -81,6 +94,12 @@ export const PricingPanel = ({
</Row>
)}

{(seatPriceMonthly || seatPriceYearly) && (
<div className='pricing-type pt-1 text-muted'>
+ ${isYearly ? seatPriceYearly : seatPriceMonthly}/seat
</div>
)}

{isEnterprise && (
<Row className='pt-3 justify-content-center'>
<div className='pricing-type text-secondary'>
Expand Down Expand Up @@ -125,7 +144,7 @@ export const PricingPanel = ({
>
All from{' '}
<span className={isEnterprise ? 'text-secondary' : 'text-primary'}>
{isEnterprise ? 'Start-Up,' : 'Free,'}
{includesFrom ?? (isEnterprise ? 'Scale-Up' : 'Free')},
</span>{' '}
plus
</h5>
Expand Down
27 changes: 27 additions & 0 deletions frontend/web/components/modals/payment/pricingFeatures.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,33 @@ export const STARTUP_FEATURES: PricingFeature[] = [
},
]

export const SCALE_UP_FEATURES: PricingFeature[] = [
{
text: (
<>
Up to
<strong> 5,000,000</strong> Requests per month
</>
),
},
{
text: (
<>
Up to <strong>20</strong> Team members
</>
),
},
{
text: 'User roles and permissions',
},
{
text: 'Change requests',
},
{
text: 'Audit logs',
},
]

export const ENTERPRISE_FEATURES: PricingFeature[] = [
{
text: (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ const UsersAndPermissionsInner: FC<UsersAndPermissionsInnerType> = ({
) : (
<strong>
You will automatically be charged
$20/month for each additional member that
$60/month for each additional member that
joins your organisation.
</strong>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import React from 'react'
import { Organisation } from 'common/types/responses'
import Icon from 'components/icons/Icon'
import Utils from 'common/utils/utils'
import PaymentLegacy from 'components/modals/Payment'
import PaymentNew from 'components/modals/payment'
import PaymentLegacy from 'components/modals/Payment.js'
import { Payment as PaymentNew } from 'components/modals/payment/Payment'
import { useGetSubscriptionMetadataQuery } from 'common/services/useSubscriptionMetadata'
import StatItem, { StatItemProps } from 'components/StatItem'

Expand Down
Loading