gate env vars in binding drawers behind license
This commit is contained in:
parent
843649eb54
commit
debef20af5
|
@ -21,7 +21,7 @@ import {
|
|||
import { TableNames } from "../constants"
|
||||
import { JSONUtils } from "@budibase/frontend-core"
|
||||
import ActionDefinitions from "components/design/settings/controls/ButtonActionEditor/manifest.json"
|
||||
import { environment } from "stores/portal"
|
||||
import { environment, licensing } from "stores/portal"
|
||||
|
||||
// Regex to match all instances of template strings
|
||||
const CAPTURE_VAR_INSIDE_TEMPLATE = /{{([^}]+)}}/g
|
||||
|
@ -54,8 +54,13 @@ export const getBindableProperties = (asset, componentId) => {
|
|||
* Gets all rest bindable data fields
|
||||
*/
|
||||
export const getRestBindings = () => {
|
||||
const hasEnvironmentVariablesEnabled = get(licensing).hasEnvironmentVariables
|
||||
const userBindings = getUserBindings()
|
||||
return [...userBindings, ...getAuthBindings(), ...getEnvironmentBindings()]
|
||||
return [
|
||||
...userBindings,
|
||||
...getAuthBindings(),
|
||||
...(hasEnvironmentVariablesEnabled ? getEnvironmentBindings() : []),
|
||||
]
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
import { automationStore } from "builderStore"
|
||||
import { tables } from "stores/backend"
|
||||
import { environment } from "stores/portal"
|
||||
import { environment, licensing } from "stores/portal"
|
||||
import WebhookDisplay from "../Shared/WebhookDisplay.svelte"
|
||||
import DrawerBindableInput from "../../common/bindings/DrawerBindableInput.svelte"
|
||||
import AutomationBindingPanel from "../../common/bindings/ServerBindingPanel.svelte"
|
||||
|
@ -169,21 +169,22 @@
|
|||
}
|
||||
|
||||
// Environment bindings
|
||||
bindings = bindings.concat(
|
||||
$environment.variables.map(variable => {
|
||||
return {
|
||||
label: `env.${variable.name}`,
|
||||
path: `env.${variable.name}`,
|
||||
type: "test",
|
||||
icon: "Key",
|
||||
category: "Environment",
|
||||
display: {
|
||||
type: "string",
|
||||
name: variable.name,
|
||||
},
|
||||
}
|
||||
})
|
||||
)
|
||||
if ($licensing.environmentVariablesEnabled) {
|
||||
bindings = bindings.concat(
|
||||
$environment.variables.map(variable => {
|
||||
return {
|
||||
label: `env.${variable.name}`,
|
||||
path: `env.${variable.name}`,
|
||||
icon: "Key",
|
||||
category: "Environment",
|
||||
display: {
|
||||
type: "string",
|
||||
name: variable.name,
|
||||
},
|
||||
}
|
||||
})
|
||||
)
|
||||
}
|
||||
|
||||
return bindings
|
||||
}
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
|
||||
$: readableValue = runtimeToReadableBinding(bindings, value)
|
||||
$: tempValue = readableValue
|
||||
$: console.log(tempValue)
|
||||
$: isJS = isJSBinding(value)
|
||||
|
||||
const saveBinding = () => {
|
||||
|
|
|
@ -64,7 +64,6 @@ export const createLicensingStore = () => {
|
|||
Constants.Features.ENVIRONMENT_VARIABLES
|
||||
)
|
||||
|
||||
environmentVariablesEnabled = true
|
||||
store.update(state => {
|
||||
return {
|
||||
...state,
|
||||
|
|
Loading…
Reference in New Issue