diff --git a/packages/builder/src/components/backend/DataTable/modals/ManageAccessModal.svelte b/packages/builder/src/components/backend/DataTable/modals/ManageAccessModal.svelte
index 161757c570..09553c1bcd 100644
--- a/packages/builder/src/components/backend/DataTable/modals/ManageAccessModal.svelte
+++ b/packages/builder/src/components/backend/DataTable/modals/ManageAccessModal.svelte
@@ -13,6 +13,7 @@
Icon,
} from "@budibase/bbui"
import { capitalise } from "helpers"
+ import { getFormattedPlanName } from "helpers/planTitle"
import { get } from "svelte/store"
export let resourceId
@@ -99,7 +100,9 @@
{#if requiresPlanToModify}
- {capitalise(requiresPlanToModify)}
+ {getFormattedPlanName(requiresPlanToModify)}
{/if}
diff --git a/packages/builder/src/helpers/planTitle.js b/packages/builder/src/helpers/planTitle.js
new file mode 100644
index 0000000000..dc07e8be2f
--- /dev/null
+++ b/packages/builder/src/helpers/planTitle.js
@@ -0,0 +1,11 @@
+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"
+ }
+ return `${planName} Plan`
+}
diff --git a/packages/builder/src/pages/builder/portal/account/usage.svelte b/packages/builder/src/pages/builder/portal/account/usage.svelte
index 9e7c402e91..8eb26c20d6 100644
--- a/packages/builder/src/pages/builder/portal/account/usage.svelte
+++ b/packages/builder/src/pages/builder/portal/account/usage.svelte
@@ -15,7 +15,7 @@
import { DashCard, Usage } from "components/usage"
import { PlanModel } from "constants"
import { sdk } from "@budibase/shared-core"
- import { PlanType } from "@budibase/types"
+ import { getFormattedPlanName } from "helpers/planTitle"
let staticUsage = []
let monthlyUsage = []
@@ -100,23 +100,6 @@
cancelAt = license?.billing?.subscription?.cancelAt
}
- const capitalise = string => {
- if (string) {
- return string.charAt(0).toUpperCase() + string.slice(1)
- }
- }
-
- const planTitle = () => {
- const planType = license?.plan.type
- let planName = license?.plan.type
- if (planType === PlanType.PREMIUM_PLUS) {
- planName = "Premium"
- } else if (planType === PlanType.ENTERPRISE_BASIC) {
- planName = "Enterprise"
- }
- return `${capitalise(planName)} Plan`
- }
-
const getDaysRemaining = timestamp => {
if (!timestamp) {
return
@@ -227,7 +210,7 @@