From e38bde79ac518fc12a80a9665cf8a9bee29686eb Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Tue, 17 Jan 2023 10:13:49 +0000 Subject: [PATCH] add licensing work --- .../portal/settings/environment/index.svelte | 71 ++++++++++++++----- .../builder/src/stores/portal/environment.js | 1 + .../builder/src/stores/portal/licensing.js | 5 +- 3 files changed, 59 insertions(+), 18 deletions(-) diff --git a/packages/builder/src/pages/builder/portal/settings/environment/index.svelte b/packages/builder/src/pages/builder/portal/settings/environment/index.svelte index 06cfc02085..bb9df4a946 100644 --- a/packages/builder/src/pages/builder/portal/settings/environment/index.svelte +++ b/packages/builder/src/pages/builder/portal/settings/environment/index.svelte @@ -7,8 +7,10 @@ Divider, Modal, Table, + Tags, + Tag, } from "@budibase/bbui" - import { environment } from "stores/portal" + import { environment, licensing, auth, admin } from "stores/portal" import { onMount } from "svelte" import CreateEditVariableModal from "./_components/CreateEditVariableModal.svelte" import EditVariableColumn from "./_components/EditVariableColumn.svelte" @@ -40,25 +42,53 @@ - Envrironment Variables +
+ Envrironment Variables + {#if !$licensing.environmentVariablesEnabled} + + Pro plan + + {/if} +
Add and manage environment variable for development and productionAdd and manage environment variables for development and production
- - - - -
- -
+ {#if $licensing.environmentVariablesEnabled} + + +
+ +
+ +
+ {:else} +
+ + + +
+ {/if} @@ -66,4 +96,11 @@ diff --git a/packages/builder/src/stores/portal/environment.js b/packages/builder/src/stores/portal/environment.js index ba33f22e6f..fa06242cf5 100644 --- a/packages/builder/src/stores/portal/environment.js +++ b/packages/builder/src/stores/portal/environment.js @@ -26,6 +26,7 @@ export function createEnvironmentStore() { async function updateVariable(data) { await API.updateEnvironmentVariable(data) } + return { subscribe, loadVariables, diff --git a/packages/builder/src/stores/portal/licensing.js b/packages/builder/src/stores/portal/licensing.js index 59a1622c9f..f6e96b1dcd 100644 --- a/packages/builder/src/stores/portal/licensing.js +++ b/packages/builder/src/stores/portal/licensing.js @@ -60,7 +60,9 @@ export const createLicensingStore = () => { const backupsEnabled = license.features.includes( Constants.Features.BACKUPS ) - + let environmentVariablesEnabled = license.features.includes( + Constants.Features.ENVIRONMENT_VARIABLES + ) store.update(state => { return { ...state, @@ -68,6 +70,7 @@ export const createLicensingStore = () => { isFreePlan, groupsEnabled, backupsEnabled, + environmentVariablesEnabled, } }) },