Merge branch 'feature/environment-variables' of github.com:Budibase/budibase into feature/environment-variables
This commit is contained in:
commit
2007543c98
9 changed files with 38 additions and 20 deletions
|
@ -218,7 +218,11 @@
|
|||
}
|
||||
|
||||
onMount(async () => {
|
||||
await environment.loadVariables()
|
||||
try {
|
||||
await environment.loadVariables()
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
|
|
|
@ -96,10 +96,13 @@
|
|||
}
|
||||
|
||||
onMount(async () => {
|
||||
await environment.loadVariables()
|
||||
|
||||
if ($auth.user) {
|
||||
await licensing.init()
|
||||
try {
|
||||
await environment.loadVariables()
|
||||
if ($auth.user) {
|
||||
await licensing.init()
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(err)
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
runtimeToReadableMap,
|
||||
} from "builderStore/dataBinding"
|
||||
import { cloneDeep } from "lodash/fp"
|
||||
import { licensing } from "stores/portal"
|
||||
|
||||
export let datasource
|
||||
export let queries
|
||||
|
@ -94,7 +95,9 @@
|
|||
headings
|
||||
bind:object={datasource.config.staticVariables}
|
||||
on:change
|
||||
bindings={getEnvironmentBindings()}
|
||||
bindings={$licensing.environmentVariablesEnabled
|
||||
? getEnvironmentBindings()
|
||||
: []}
|
||||
/>
|
||||
</Layout>
|
||||
<div />
|
||||
|
|
|
@ -45,10 +45,13 @@
|
|||
let formFieldkey
|
||||
|
||||
onMount(async () => {
|
||||
await environment.loadVariables()
|
||||
|
||||
if ($auth.user) {
|
||||
await licensing.init()
|
||||
try {
|
||||
await environment.loadVariables()
|
||||
if ($auth.user) {
|
||||
await licensing.init()
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(err)
|
||||
}
|
||||
|
||||
if (currentConfig) {
|
||||
|
|
|
@ -105,7 +105,7 @@
|
|||
>
|
||||
{#each fields as field, idx}
|
||||
<Input
|
||||
placeholder={"hello"}
|
||||
placeholder={keyPlaceholder}
|
||||
readonly={readOnly}
|
||||
bind:value={field.name}
|
||||
on:blur={changed}
|
||||
|
|
|
@ -367,7 +367,7 @@
|
|||
// load the environment variables
|
||||
await environment.loadVariables()
|
||||
} catch (error) {
|
||||
notifications.error("Error getting environment variables")
|
||||
notifications.error(`Error getting environment variables - ${error}`)
|
||||
}
|
||||
|
||||
datasource = $datasources.list.find(ds => ds._id === query?.datasourceId)
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
})
|
||||
notifications.success("Environment variable saved")
|
||||
} catch (err) {
|
||||
notifications.error("Error saving environment variable")
|
||||
notifications.error(`Error saving environment variable - ${err.message}`)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
let editVariableModal
|
||||
let deleteDialog
|
||||
|
||||
const save = data => {
|
||||
environment.updateVariable(data)
|
||||
const save = async data => {
|
||||
await environment.updateVariable(data)
|
||||
editVariableModal.hide()
|
||||
}
|
||||
</script>
|
||||
|
@ -23,8 +23,8 @@
|
|||
|
||||
<ConfirmDialog
|
||||
bind:this={deleteDialog}
|
||||
onOk={() => {
|
||||
environment.deleteVariable(row.name)
|
||||
onOk={async () => {
|
||||
await environment.deleteVariable(row.name)
|
||||
}}
|
||||
okText="Delete Environment Variable"
|
||||
title="Confirm Deletion"
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
Tags,
|
||||
Tag,
|
||||
InlineAlert,
|
||||
notifications,
|
||||
} from "@budibase/bbui"
|
||||
import { environment, licensing, auth, admin } from "stores/portal"
|
||||
import { onMount } from "svelte"
|
||||
|
@ -44,9 +45,13 @@
|
|||
return schema
|
||||
}
|
||||
|
||||
const save = data => {
|
||||
environment.createVariable(data)
|
||||
modal.hide()
|
||||
const save = async data => {
|
||||
try {
|
||||
await environment.createVariable(data)
|
||||
modal.hide()
|
||||
} catch (err) {
|
||||
notifications.error(`Error saving variable: ${err.message}`)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
Loading…
Reference in a new issue