Modified planTitle function to accommodate old plans (#12854)

* Modified planTitle function to accommodate old plans

* Fixed liniting issues.
This commit is contained in:
Conor Webb 2024-01-24 09:43:31 +00:00 committed by GitHub
parent f6b229e7eb
commit 3ea8bfda91
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 21 additions and 5 deletions

View File

@ -1,11 +1,27 @@
import { PlanType } from "@budibase/types" import { PlanType } from "@budibase/types"
export function getFormattedPlanName(userPlanType) { export function getFormattedPlanName(userPlanType) {
let planName = "Free" let planName
if (userPlanType === PlanType.PREMIUM_PLUS) { switch (userPlanType) {
planName = "Premium" case PlanType.PRO:
} else if (userPlanType === PlanType.ENTERPRISE_BASIC) { planName = "Pro"
planName = "Enterprise" break
case PlanType.TEAM:
planName = "Team"
break
case PlanType.PREMIUM:
case PlanType.PREMIUM_PLUS:
planName = "Premium"
break
case PlanType.BUSINESS:
planName = "Business"
break
case PlanType.ENTERPRISE_BASIC:
case PlanType.ENTERPRISE:
planName = "Enterprise"
break
default:
planName = "Free" // Default to "Free" if the type is not explicitly handled
} }
return `${planName} Plan` return `${planName} Plan`
} }