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