From a350a715fa670c2d5e20229852bf2f50c7fc30b4 Mon Sep 17 00:00:00 2001 From: melohagan <101575380+melohagan@users.noreply.github.com> Date: Wed, 15 May 2024 11:33:02 +0100 Subject: [PATCH] Fix: Only show free trial banner/modal to account owner (#13692) * Add free_trial to deploy camunda script * Fix only show trial banner to owner --- .../EnterpriseBasicTrialModal.svelte | 6 +- .../src/pages/builder/portal/_layout.svelte | 13 +- yarn.lock | 672 ++++++++++++++---- 3 files changed, 543 insertions(+), 148 deletions(-) diff --git a/packages/builder/src/components/portal/onboarding/EnterpriseBasicTrialModal.svelte b/packages/builder/src/components/portal/onboarding/EnterpriseBasicTrialModal.svelte index 6652bd4104..e195b52106 100644 --- a/packages/builder/src/components/portal/onboarding/EnterpriseBasicTrialModal.svelte +++ b/packages/builder/src/components/portal/onboarding/EnterpriseBasicTrialModal.svelte @@ -2,21 +2,21 @@ import { Modal, ModalContent } from "@budibase/bbui" import FreeTrial from "../../../../assets/FreeTrial.svelte" import { get } from "svelte/store" - import { auth, licensing } from "stores/portal" + import { auth, licensing, admin } from "stores/portal" import { API } from "api" import { PlanType } from "@budibase/types" - import { sdk } from "@budibase/shared-core" let freeTrialModal $: planType = $licensing?.license?.plan?.type $: showFreeTrialModal(planType, freeTrialModal) + $: isOwner = $auth.accountPortalAccess && $admin.cloud const showFreeTrialModal = (planType, freeTrialModal) => { if ( planType === PlanType.ENTERPRISE_BASIC_TRIAL && !$auth.user?.freeTrialConfirmedAt && - sdk.users.isAdmin($auth.user) + isOwner ) { freeTrialModal?.show() } diff --git a/packages/builder/src/pages/builder/portal/_layout.svelte b/packages/builder/src/pages/builder/portal/_layout.svelte index a62233fad5..73152a1cd5 100644 --- a/packages/builder/src/pages/builder/portal/_layout.svelte +++ b/packages/builder/src/pages/builder/portal/_layout.svelte @@ -1,7 +1,14 @@