diff --git a/packages/builder/assets/FreeTrial.svelte b/packages/builder/assets/FreeTrial.svelte new file mode 100644 index 0000000000..79a722d90c --- /dev/null +++ b/packages/builder/assets/FreeTrial.svelte @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + diff --git a/packages/builder/src/components/portal/onboarding/EnterpriseBasicTrialModal.svelte b/packages/builder/src/components/portal/onboarding/EnterpriseBasicTrialModal.svelte new file mode 100644 index 0000000000..fa789311d1 --- /dev/null +++ b/packages/builder/src/components/portal/onboarding/EnterpriseBasicTrialModal.svelte @@ -0,0 +1,64 @@ + + + + { + if (get(auth).user) { + try { + await API.updateSelf({ + freeTrialConfirmedAt: new Date().toISOString(), + }) + // Update the cached user + await auth.getSelf() + } finally { + freeTrialModal.hide() + } + } + }} + > + Experience all of Budibase with a free 14-day trial + + We've upgraded you to a free 14-day trial that allows you to try all our + features before deciding which plan is right for you. + + At the end of your trial, we'll automatically downgrade you to the Free + plan unless you choose to upgrade. + + + + + + + diff --git a/packages/builder/src/helpers/planTitle.js b/packages/builder/src/helpers/planTitle.js index 79f2bc2382..c08b8bf3fe 100644 --- a/packages/builder/src/helpers/planTitle.js +++ b/packages/builder/src/helpers/planTitle.js @@ -20,6 +20,9 @@ export function getFormattedPlanName(userPlanType) { case PlanType.ENTERPRISE: planName = "Enterprise" break + case PlanType.ENTERPRISE_BASIC_TRIAL: + planName = "Trial" + break default: planName = "Free" // Default to "Free" if the type is not explicitly handled } diff --git a/packages/builder/src/pages/builder/app/[application]/_layout.svelte b/packages/builder/src/pages/builder/app/[application]/_layout.svelte index fd6a97560d..60c45fd2e4 100644 --- a/packages/builder/src/pages/builder/app/[application]/_layout.svelte +++ b/packages/builder/src/pages/builder/app/[application]/_layout.svelte @@ -32,6 +32,7 @@ import { UserAvatars } from "@budibase/frontend-core" import { TOUR_KEYS } from "components/portal/onboarding/tours.js" import PreviewOverlay from "./_components/PreviewOverlay.svelte" + import EnterpriseBasicTrialModal from "components/portal/onboarding/EnterpriseBasicTrialModal.svelte" export let application @@ -192,6 +193,8 @@ + +
+ At the end of your trial, we'll automatically downgrade you to the Free + plan unless you choose to upgrade. +