diff --git a/packages/bbui/src/Form/Core/EnvDropdown.svelte b/packages/bbui/src/Form/Core/EnvDropdown.svelte new file mode 100644 index 0000000000..9b6346a8e1 --- /dev/null +++ b/packages/bbui/src/Form/Core/EnvDropdown.svelte @@ -0,0 +1,241 @@ + + +
+
+ + + +
+ {#if open} +
+ + +
+ +
showModal()} class="primary-text"> + Add Variable +
+
+
+ {/if} +
+ + diff --git a/packages/bbui/src/Form/EnvDropdown.svelte b/packages/bbui/src/Form/EnvDropdown.svelte new file mode 100644 index 0000000000..941b036e24 --- /dev/null +++ b/packages/bbui/src/Form/EnvDropdown.svelte @@ -0,0 +1,48 @@ + + + + + diff --git a/packages/bbui/src/index.js b/packages/bbui/src/index.js index 601c4dcbca..06f3c22037 100644 --- a/packages/bbui/src/index.js +++ b/packages/bbui/src/index.js @@ -27,6 +27,7 @@ export { default as RadioGroup } from "./Form/RadioGroup.svelte" export { default as Checkbox } from "./Form/Checkbox.svelte" export { default as InputDropdown } from "./Form/InputDropdown.svelte" export { default as PickerDropdown } from "./Form/PickerDropdown.svelte" +export { default as EnvDropdown } from "./Form/EnvDropdown.svelte" export { default as DetailSummary } from "./DetailSummary/DetailSummary.svelte" export { default as Popover } from "./Popover/Popover.svelte" export { default as ProgressBar } from "./ProgressBar/ProgressBar.svelte" diff --git a/packages/builder/src/components/backend/DatasourceNavigator/TableIntegrationMenu/IntegrationConfigForm.svelte b/packages/builder/src/components/backend/DatasourceNavigator/TableIntegrationMenu/IntegrationConfigForm.svelte index 05649e1773..fab633ffa2 100644 --- a/packages/builder/src/components/backend/DatasourceNavigator/TableIntegrationMenu/IntegrationConfigForm.svelte +++ b/packages/builder/src/components/backend/DatasourceNavigator/TableIntegrationMenu/IntegrationConfigForm.svelte @@ -6,16 +6,22 @@ Toggle, Button, TextArea, + Modal, + EnvDropdown, } from "@budibase/bbui" import KeyValueBuilder from "components/integration/KeyValueBuilder.svelte" import { capitalise } from "helpers" import { IntegrationTypes } from "constants/backend" import { createValidationStore } from "helpers/validation/yup" - import { createEventDispatcher } from "svelte" + import { createEventDispatcher, onMount } from "svelte" + import { environment } from "stores/portal" + import CreateEditVariableModal from "components/portal/environment/CreateEditVariableModal.svelte" export let datasource export let schema export let creating + + let createVariableModal const validation = createValidationStore() const dispatch = createEventDispatcher() @@ -60,6 +66,18 @@ } return capitalise(name) } + + function save(data) { + environment.createVariable(data) + createVariableModal.hide() + } + + function showModal() { + createVariableModal.show() + } + onMount(async () => { + await environment.loadVariables() + })
@@ -103,7 +121,9 @@ {:else}
- + + + +