Load variables on mount
This commit is contained in:
parent
3e59fcdbbb
commit
52cc191ab2
|
@ -1,10 +1,17 @@
|
|||
<script lang="ts">
|
||||
import { onMount } from "svelte"
|
||||
import { ModalContent, Layout, Select, Body, Input } from "@budibase/bbui"
|
||||
import {
|
||||
ModalContent,
|
||||
Layout,
|
||||
Select,
|
||||
Body,
|
||||
Input,
|
||||
notifications,
|
||||
} from "@budibase/bbui"
|
||||
import { AUTH_TYPE_LABELS, AUTH_TYPES } from "./authTypes"
|
||||
import { BindableCombobox } from "@/components/common/bindings"
|
||||
import { getAuthBindings, getEnvironmentBindings } from "@/dataBinding"
|
||||
import { licensing } from "@/stores/portal"
|
||||
import { environment, licensing } from "@/stores/portal"
|
||||
import EnvVariableInput from "@/components/portal/environment/EnvVariableInput.svelte"
|
||||
|
||||
interface FormData {
|
||||
|
@ -178,6 +185,14 @@
|
|||
const onConfirmInternal = () => {
|
||||
onConfirm(constructConfig())
|
||||
}
|
||||
|
||||
onMount(async () => {
|
||||
try {
|
||||
await environment.loadVariables()
|
||||
} catch (error) {
|
||||
notifications.error(`Error getting environment variables - ${error}`)
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<ModalContent
|
||||
|
|
|
@ -1,14 +1,15 @@
|
|||
<script>
|
||||
import { Heading, Layout } from "@budibase/bbui"
|
||||
import { Heading, Layout, notifications } from "@budibase/bbui"
|
||||
import KeyValueBuilder from "@/components/integration/KeyValueBuilder.svelte"
|
||||
import ViewDynamicVariables from "./ViewDynamicVariables.svelte"
|
||||
import { getEnvironmentBindings } from "@/dataBinding"
|
||||
import { licensing } from "@/stores/portal"
|
||||
import { environment, licensing } from "@/stores/portal"
|
||||
import { queries } from "@/stores/builder"
|
||||
import { cloneDeep } from "lodash/fp"
|
||||
import SaveDatasourceButton from "../SaveDatasourceButton.svelte"
|
||||
import Panel from "../Panel.svelte"
|
||||
import Tooltip from "../Tooltip.svelte"
|
||||
import { onMount } from "svelte"
|
||||
|
||||
export let datasource
|
||||
|
||||
|
@ -27,6 +28,14 @@
|
|||
|
||||
updatedDatasource.config.staticVariables = newStaticVariables
|
||||
}
|
||||
|
||||
onMount(async () => {
|
||||
try {
|
||||
await environment.loadVariables()
|
||||
} catch (error) {
|
||||
notifications.error(`Error getting environment variables - ${error}`)
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<Panel>
|
||||
|
|
Loading…
Reference in New Issue