+
+
+
+
+
+ {
+ console.log("delete")
+ }}
+ okText="Delete Environment Variable"
+ title="Confirm Deletion"
+>
+ Are you sure you wish to delete the environment variable
+ {row.name}?
+ This action cannot be undone.
+
diff --git a/packages/builder/src/pages/builder/portal/environment/index.svelte b/packages/builder/src/pages/builder/portal/environment/index.svelte
index 9fb19fe676..4c377d2051 100644
--- a/packages/builder/src/pages/builder/portal/environment/index.svelte
+++ b/packages/builder/src/pages/builder/portal/environment/index.svelte
@@ -7,33 +7,92 @@
Select,
Divider,
Modal,
+ ModalContent,
Search,
+ Page,
+ Table,
+ Input,
+ Checkbox,
} from "@budibase/bbui"
-
+ import { envVars } from "stores/portal"
import { onMount } from "svelte"
+ import EditVariableModal from "./_components/editVariableModal.svelte"
+
+ let modal
+
+ let useProductionValue = true
+
+ let developmentValue
+ let productionValue
+ const schema = {
+ name: {
+ width: "2fr",
+ },
+ edit: {
+ width: "auto",
+ borderLeft: true,
+ displayName: "",
+ },
+ }
+
+ const customRenderers = [{ column: "edit", component: EditVariableModal }]
onMount(async () => {
await envVars.load()
})
-
-
- Envrironment Variables
- Add and manage environment variable for development and production
-
-
+
- {#each $envVars as envVar}
-
- {envVar}
-
-
- {/each}
+
+ Envrironment Variables
+ Add and manage environment variable for development and production
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+ Production
+
+
+
+ Development
+
+ {
+ developmentValue = productionValue
+ }}
+ bind:value={useProductionValue}
+ text="Use production value"
+ />
+
+
+
diff --git a/packages/builder/src/stores/portal/envVars.js b/packages/builder/src/stores/portal/envVars.js
index 9c9880511a..81d3143f15 100644
--- a/packages/builder/src/stores/portal/envVars.js
+++ b/packages/builder/src/stores/portal/envVars.js
@@ -5,10 +5,15 @@ export function createEnvVarsStore() {
const { subscribe, set, update } = writable([])
async function load() {
- const envVars = await API.fetchEnvVars()
+ // const envVars = await API.fetchEnvVars()
let testVars = ['blah', 'blah123']
- set(testVars)
+
+ // turn the testVars array in to a map with "name" being the value of each
+ // item in the array
+ const vars = testVars.map((name) => ({ name }))
+ console.log(vars)
+ set(vars)
}
return {
diff --git a/packages/builder/src/stores/portal/index.js b/packages/builder/src/stores/portal/index.js
index 81d26b900e..370c448bb3 100644
--- a/packages/builder/src/stores/portal/index.js
+++ b/packages/builder/src/stores/portal/index.js
@@ -11,3 +11,4 @@ export { groups } from "./groups"
export { plugins } from "./plugins"
export { backups } from "./backups"
export { overview } from "./overview"
+export { envVars } from "./envVars"
\ No newline at end of file