From 113c68e4c955cfbebd885946258ec9353c612fbf Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Thu, 26 Nov 2020 14:43:56 +0000 Subject: [PATCH] budibase postgres E2E working --- .../DataTable/ExternalDataSourceTable.svelte | 32 +++++++ .../EditIntegrationConfigButton.svelte | 43 ++++++++++ .../modals/EditIntegrationConfig.svelte | 69 +++++++++++++++ .../IntegrationConfigForm.svelte | 15 ++++ .../TableIntegrationMenu/index.svelte | 52 ++++++++++++ .../modals/CreateTableModal.svelte | 7 ++ .../popovers/EditTablePopover.svelte | 6 +- .../data/table/[selectedTable]/index.svelte | 11 ++- packages/server/package.json | 1 + .../server/src/api/controllers/integration.js | 8 ++ packages/server/src/api/controllers/row.js | 12 ++- packages/server/src/api/routes/index.js | 2 + packages/server/src/api/routes/integration.js | 10 +++ .../server/src/integrations/Integration.js | 7 ++ packages/server/src/integrations/index.js | 14 ++++ packages/server/src/integrations/postgres.js | 48 +++++++++++ packages/server/yarn.lock | 83 +++++++++++++++++++ 17 files changed, 416 insertions(+), 4 deletions(-) create mode 100644 packages/builder/src/components/backend/DataTable/ExternalDataSourceTable.svelte create mode 100644 packages/builder/src/components/backend/DataTable/buttons/EditIntegrationConfigButton.svelte create mode 100644 packages/builder/src/components/backend/DataTable/modals/EditIntegrationConfig.svelte create mode 100644 packages/builder/src/components/backend/TableNavigator/TableIntegrationMenu/IntegrationConfigForm.svelte create mode 100644 packages/builder/src/components/backend/TableNavigator/TableIntegrationMenu/index.svelte create mode 100644 packages/server/src/api/controllers/integration.js create mode 100644 packages/server/src/api/routes/integration.js create mode 100644 packages/server/src/integrations/Integration.js create mode 100644 packages/server/src/integrations/index.js create mode 100644 packages/server/src/integrations/postgres.js diff --git a/packages/builder/src/components/backend/DataTable/ExternalDataSourceTable.svelte b/packages/builder/src/components/backend/DataTable/ExternalDataSourceTable.svelte new file mode 100644 index 0000000000..75a5abed82 --- /dev/null +++ b/packages/builder/src/components/backend/DataTable/ExternalDataSourceTable.svelte @@ -0,0 +1,32 @@ + + + + +
diff --git a/packages/builder/src/components/backend/DataTable/buttons/EditIntegrationConfigButton.svelte b/packages/builder/src/components/backend/DataTable/buttons/EditIntegrationConfigButton.svelte new file mode 100644 index 0000000000..223fc8b6b1 --- /dev/null +++ b/packages/builder/src/components/backend/DataTable/buttons/EditIntegrationConfigButton.svelte @@ -0,0 +1,43 @@ + + +
+ +
+ + + + + diff --git a/packages/builder/src/components/backend/DataTable/modals/EditIntegrationConfig.svelte b/packages/builder/src/components/backend/DataTable/modals/EditIntegrationConfig.svelte new file mode 100644 index 0000000000..8bd8cecb51 --- /dev/null +++ b/packages/builder/src/components/backend/DataTable/modals/EditIntegrationConfig.svelte @@ -0,0 +1,69 @@ + + +
+ Schema + + {#each fields as field} +
+ + +
+ {/each} + + + Datasource + {#each Object.keys(table.integration) as configKey} + + {/each} +
+ + diff --git a/packages/builder/src/components/backend/TableNavigator/TableIntegrationMenu/IntegrationConfigForm.svelte b/packages/builder/src/components/backend/TableNavigator/TableIntegrationMenu/IntegrationConfigForm.svelte new file mode 100644 index 0000000000..913e26f668 --- /dev/null +++ b/packages/builder/src/components/backend/TableNavigator/TableIntegrationMenu/IntegrationConfigForm.svelte @@ -0,0 +1,15 @@ + + +
+ {#each Object.keys(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 new file mode 100644 index 0000000000..cdf7ba99f3 --- /dev/null +++ b/packages/builder/src/components/backend/TableNavigator/TableIntegrationMenu/index.svelte @@ -0,0 +1,52 @@ + + +
+ {#await integrationsPromise} + Loading integrations... + {:then integrations} + {#each Object.keys(integrations) as integrationType} +
{ + selectedIntegration = integrations[integrationType] + integration.type = integrationType + }}> +
{integrationType}
+
+ {/each} + {:catch} + shit itself + {/await} + + {#if selectedIntegration} + {#each Object.keys(selectedIntegration) as configKey} + + {/each} +