1
0
Fork 0
mirror of synced 2024-09-10 22:46:09 +12:00

Hide upgrade button on enterprise plan

This commit is contained in:
Rory Powell 2023-03-02 08:58:54 +00:00
parent c49eb26377
commit a80d963c88
2 changed files with 7 additions and 3 deletions

View file

@ -1,11 +1,11 @@
<script>
import { Button } from "@budibase/bbui"
import { goto } from "@roxi/routify"
import { auth, admin } from "stores/portal"
import { auth, admin, licensing } from "stores/portal"
import { isEnabled, TENANT_FEATURE_FLAGS } from "helpers/featureFlags"
</script>
{#if isEnabled(TENANT_FEATURE_FLAGS.LICENSING)}
{#if isEnabled(TENANT_FEATURE_FLAGS.LICENSING) && !$licensing.isEnterprisePlan}
{#if $admin.cloud && $auth?.user?.accountPortalAccess}
<Button
cta

View file

@ -12,6 +12,7 @@ export const createLicensingStore = () => {
// the top level license
license: undefined,
isFreePlan: true,
isEnterprisePlan: true,
// features
groupsEnabled: false,
backupsEnabled: false,
@ -53,7 +54,9 @@ export const createLicensingStore = () => {
},
setLicense: () => {
const license = get(auth).user.license
const isFreePlan = license?.plan.type === Constants.PlanType.FREE
const planType = license?.plan.type
const isEnterprisePlan = planType === Constants.PlanType.ENTERPRISE
const isFreePlan = planType === Constants.PlanType.FREE
const groupsEnabled = license.features.includes(
Constants.Features.USER_GROUPS
)
@ -74,6 +77,7 @@ export const createLicensingStore = () => {
return {
...state,
license,
isEnterprisePlan,
isFreePlan,
groupsEnabled,
backupsEnabled,