1
0
Fork 0
mirror of synced 2024-08-15 10:01:34 +12:00

Merge pull request #9858 from Budibase/hide-upgrade-on-enterprise

Hide upgrade button on enterprise plan
This commit is contained in:
Martin McKeaveney 2023-03-06 16:16:23 +00:00 committed by GitHub
commit 937cb7742f
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,