From 1f891cc8aed64b8a123084ab6076ede83c8ff1f1 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Thu, 26 Nov 2020 16:46:36 +0000 Subject: [PATCH] mongoDB end to end --- .../DataTable/ExternalDataSourceTable.svelte | 2 +- .../EditIntegrationConfigButton.svelte | 2 +- .../modals/EditIntegrationConfig.svelte | 92 ++++++++++++------- .../TableIntegrationMenu/index.svelte | 48 ++++++++-- packages/server/package.json | 1 + .../server/src/integrations/Integration.js | 7 -- packages/server/src/integrations/dynamodb.js | 64 +++++++++++++ packages/server/src/integrations/index.js | 10 ++ packages/server/src/integrations/mongodb.js | 49 ++++++++++ packages/server/src/integrations/postgres.js | 4 + packages/server/yarn.lock | 65 ++++++++++++- 11 files changed, 293 insertions(+), 51 deletions(-) create mode 100644 packages/server/src/integrations/dynamodb.js create mode 100644 packages/server/src/integrations/mongodb.js diff --git a/packages/builder/src/components/backend/DataTable/ExternalDataSourceTable.svelte b/packages/builder/src/components/backend/DataTable/ExternalDataSourceTable.svelte index 75a5abed82..33d107e1c5 100644 --- a/packages/builder/src/components/backend/DataTable/ExternalDataSourceTable.svelte +++ b/packages/builder/src/components/backend/DataTable/ExternalDataSourceTable.svelte @@ -27,6 +27,6 @@ } - +
diff --git a/packages/builder/src/components/backend/DataTable/buttons/EditIntegrationConfigButton.svelte b/packages/builder/src/components/backend/DataTable/buttons/EditIntegrationConfigButton.svelte index 223fc8b6b1..e78e7ac93d 100644 --- a/packages/builder/src/components/backend/DataTable/buttons/EditIntegrationConfigButton.svelte +++ b/packages/builder/src/components/backend/DataTable/buttons/EditIntegrationConfigButton.svelte @@ -37,7 +37,7 @@ confirmText="Save" cancelText="Cancel" onConfirm={saveTable} - title={'Edit Datasource Configuration'}> + title={'Datasource Configuration'}> diff --git a/packages/builder/src/components/backend/DataTable/modals/EditIntegrationConfig.svelte b/packages/builder/src/components/backend/DataTable/modals/EditIntegrationConfig.svelte index 8bd8cecb51..48bb22320c 100644 --- a/packages/builder/src/components/backend/DataTable/modals/EditIntegrationConfig.svelte +++ b/packages/builder/src/components/backend/DataTable/modals/EditIntegrationConfig.svelte @@ -1,11 +1,21 @@
- Schema - - {#each fields as field} -
- - -
- {/each} +
+
Schema
+ {#each fields as field, idx} +
+ + + deleteField(idx)} /> +
+ {/each} + +
- - Datasource - {#each Object.keys(table.integration) as configKey} - - {/each} +
+
Datasource
+ {#each Object.keys(table.integration) as configKey} + + + {/each} +
diff --git a/packages/builder/src/components/backend/TableNavigator/TableIntegrationMenu/index.svelte b/packages/builder/src/components/backend/TableNavigator/TableIntegrationMenu/index.svelte index cdf7ba99f3..80d096f440 100644 --- a/packages/builder/src/components/backend/TableNavigator/TableIntegrationMenu/index.svelte +++ b/packages/builder/src/components/backend/TableNavigator/TableIntegrationMenu/index.svelte @@ -3,45 +3,52 @@ import { Input, TextArea } from "@budibase/bbui" import api from "builderStore/api" + const INTEGRATION_ICON_MAP = { + POSTGRES: "ri-database-2-line", + } + export let integration = {} let integrationsPromise = fetchIntegrations() let selectedIntegration + let integrations = [] async function fetchIntegrations() { const INTEGRATIONS_URL = `/api/integrations` const response = await api.get(INTEGRATIONS_URL) const json = await response.json() + integrations = json return json } + + onMount(() => { + fetchIntegrations() + })
- {#await integrationsPromise} - Loading integrations... - {:then integrations} +
{#each Object.keys(integrations) as integrationType}
{ selectedIntegration = integrations[integrationType] integration.type = integrationType }}> -
{integrationType}
+ {integrationType} +
{/each} - {:catch} - shit itself - {/await} +
{#if selectedIntegration} {#each Object.keys(selectedIntegration) as configKey} {/each} -