From 3ea8bfda91a2a2abd7ccd9fbd1364511f3a0644f Mon Sep 17 00:00:00 2001 From: Conor Webb <126772285+ConorWebb96@users.noreply.github.com> Date: Wed, 24 Jan 2024 09:43:31 +0000 Subject: [PATCH] Modified planTitle function to accommodate old plans (#12854) * Modified planTitle function to accommodate old plans * Fixed liniting issues. --- packages/builder/src/helpers/planTitle.js | 26 ++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/packages/builder/src/helpers/planTitle.js b/packages/builder/src/helpers/planTitle.js index dc07e8be2f..098bfb4529 100644 --- a/packages/builder/src/helpers/planTitle.js +++ b/packages/builder/src/helpers/planTitle.js @@ -1,11 +1,27 @@ import { PlanType } from "@budibase/types" export function getFormattedPlanName(userPlanType) { - let planName = "Free" - if (userPlanType === PlanType.PREMIUM_PLUS) { - planName = "Premium" - } else if (userPlanType === PlanType.ENTERPRISE_BASIC) { - planName = "Enterprise" + let planName + switch (userPlanType) { + case PlanType.PRO: + planName = "Pro" + 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` }