From 0de6b554383fe5136ae355bc61167c1d74130831 Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Thu, 23 Sep 2021 21:47:22 +0100 Subject: [PATCH] add base wizard for datasources --- .../modals/CreateDatasourceModal.svelte | 207 ++++++++++++------ .../modals/DatasourceDetailsModal.svelte | 51 +++++ packages/builder/src/constants/index.js | 14 ++ .../app/[application]/data/_layout.svelte | 8 +- .../app/[application]/data/index.svelte | 11 +- 5 files changed, 224 insertions(+), 67 deletions(-) create mode 100644 packages/builder/src/components/backend/DatasourceNavigator/modals/DatasourceDetailsModal.svelte diff --git a/packages/builder/src/components/backend/DatasourceNavigator/modals/CreateDatasourceModal.svelte b/packages/builder/src/components/backend/DatasourceNavigator/modals/CreateDatasourceModal.svelte index 9cdd893230..bf8585d401 100644 --- a/packages/builder/src/components/backend/DatasourceNavigator/modals/CreateDatasourceModal.svelte +++ b/packages/builder/src/components/backend/DatasourceNavigator/modals/CreateDatasourceModal.svelte @@ -1,74 +1,159 @@ - - + + - - - - - + + + + + + + { + chooseNextModal() + }} + > + All apps need data. You can connect to a data source below, or add data + to your app using Budibase's built-in database - it's simple! + + + +
selectIntegration(INTERNAL)} + class="item hoverable" + > +
+ + + Budibase DB (no prior data required) +
+
+ + +
+ {#each Object.entries(integrations).filter(([key]) => key !== INTERNAL) as [integrationType, schema]} +
selectIntegration(integrationType)} + class="item hoverable" + > +
+ + + + {schema.name || IntegrationNames[integrationType]} +
+
+ {/each} +
+
+
+
+ + diff --git a/packages/builder/src/components/backend/DatasourceNavigator/modals/DatasourceDetailsModal.svelte b/packages/builder/src/components/backend/DatasourceNavigator/modals/DatasourceDetailsModal.svelte new file mode 100644 index 0000000000..dcdd2da497 --- /dev/null +++ b/packages/builder/src/components/backend/DatasourceNavigator/modals/DatasourceDetailsModal.svelte @@ -0,0 +1,51 @@ + + + saveDatasource()} + confirmText="Continue" + cancelText="Start from scratch" + size="M" +> + + + + diff --git a/packages/builder/src/constants/index.js b/packages/builder/src/constants/index.js index a892eb2129..c0d283b0ea 100644 --- a/packages/builder/src/constants/index.js +++ b/packages/builder/src/constants/index.js @@ -15,6 +15,20 @@ export const AppStatus = { DEPLOYED: "published", } +export const IntegrationNames = { + POSTGRES: "PostgreSQL", + MONGODB: "MongoDB", + COUCHDB: "CouchDB", + S3: "S3", + MYSQL: "MySQL", + REST: "REST", + DYNAMODB: "DynamoDB", + ELASTICSEARCH: "ElasticSearch", + SQL_SERVER: "SQL Server", + AIRTABLE: "Airtable", + ARANGODB: "ArangoDB", +} + // fields on the user table that cannot be edited export const UNEDITABLE_USER_FIELDS = [ "email", diff --git a/packages/builder/src/pages/builder/app/[application]/data/_layout.svelte b/packages/builder/src/pages/builder/app/[application]/data/_layout.svelte index 5202bd45f2..f321a2c422 100644 --- a/packages/builder/src/pages/builder/app/[application]/data/_layout.svelte +++ b/packages/builder/src/pages/builder/app/[application]/data/_layout.svelte @@ -1,12 +1,14 @@ +{#if !setupComplete} + +{/if}