diff --git a/lerna.json b/lerna.json index 39e368fc2f..8808d0369a 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "0.1.23", + "version": "0.1.25", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/package.json b/package.json index d99718ca02..dbbe008b42 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,6 @@ "test:e2e:ci": "lerna run cy:ci" }, "dependencies": { - "@fortawesome/fontawesome": "^1.1.8", - "pouchdb-replication-stream": "^1.2.9" + "@fortawesome/fontawesome": "^1.1.8" } -} +} \ No newline at end of file diff --git a/packages/builder/cypress/integration/createTable.spec.js b/packages/builder/cypress/integration/createTable.spec.js index 214727ab7d..6958eb5d37 100644 --- a/packages/builder/cypress/integration/createTable.spec.js +++ b/packages/builder/cypress/integration/createTable.spec.js @@ -8,7 +8,7 @@ context('Create a Table', () => { cy.createTable('dog') // Check if Table exists - cy.get('.title').should('have.text', 'dog') + cy.get('.title').should('contain.text', 'dog') }) it('adds a new column to the table', () => { diff --git a/packages/builder/package.json b/packages/builder/package.json index 19f8a5a9cf..d34472e353 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "0.1.23", + "version": "0.1.25", "license": "AGPL-3.0", "private": true, "scripts": { @@ -64,7 +64,7 @@ }, "dependencies": { "@budibase/bbui": "^1.34.6", - "@budibase/client": "^0.1.23", + "@budibase/client": "^0.1.25", "@budibase/colorpicker": "^1.0.1", "@fortawesome/fontawesome-free": "^5.14.0", "@sentry/browser": "5.19.1", diff --git a/packages/builder/src/components/database/DataTable/ModelDataTable.svelte b/packages/builder/src/components/database/DataTable/ModelDataTable.svelte index c47d8909b4..fbef976bd5 100644 --- a/packages/builder/src/components/database/DataTable/ModelDataTable.svelte +++ b/packages/builder/src/components/database/DataTable/ModelDataTable.svelte @@ -1,5 +1,6 @@ + +
+
+

+ {$backendUiStore.selectedModel.name} + {#if loading} +
+ +
+ {/if} +

+
+ + {#if Object.keys($backendUiStore.selectedModel.schema).length > 0} + + + + {/if} +
+
+ + + + + {#each headers as header} + + {/each} + + + + {#if paginatedData.length === 0} +
No Data.
+ {/if} + {#each paginatedData as row} + + + {#each headers as header} + + {/each} + + {/each} + +
+
Edit
+
+ +
+ + + {#if schema[header].type === 'link'} + + {:else if schema[header].type === 'attachment'} + + {:else}{getOr('', header, row)}{/if} +
+ +
+ + diff --git a/packages/builder/src/components/nav/ModelNavigator/CreateTable.svelte b/packages/builder/src/components/nav/ModelNavigator/CreateTable.svelte index 0f4b604166..fe723843b3 100644 --- a/packages/builder/src/components/nav/ModelNavigator/CreateTable.svelte +++ b/packages/builder/src/components/nav/ModelNavigator/CreateTable.svelte @@ -2,25 +2,41 @@ import { goto } from "@sveltech/routify" import { backendUiStore } from "builderStore" import { notifier } from "builderStore/store/notifications" - import { DropdownMenu, Button, Icon, Input, Select } from "@budibase/bbui" + import Spinner from "components/common/Spinner.svelte" + import { + DropdownMenu, + Button, + Label, + Heading, + Icon, + Input, + Select, + Dropzone, + Spacer, + } from "@budibase/bbui" + import TableDataImport from "./TableDataImport.svelte" + import api from "builderStore/api" import analytics from "analytics" - export let table - let anchor let dropdown let name + let dataImport + let loading async function saveTable() { + loading = true const model = await backendUiStore.actions.models.save({ name, - schema: {}, + schema: dataImport.schema || {}, + dataImport, }) notifier.success(`Table ${name} created successfully.`) $goto(`./model/${model._id}`) analytics.captureEvent("Table Created", { name }) name = "" dropdown.hide() + loading = false } const onClosed = () => { @@ -35,25 +51,38 @@
Create Table
+ + + +
diff --git a/packages/builder/src/components/nav/ModelNavigator/TableDataImport.svelte b/packages/builder/src/components/nav/ModelNavigator/TableDataImport.svelte new file mode 100644 index 0000000000..1356bae25c --- /dev/null +++ b/packages/builder/src/components/nav/ModelNavigator/TableDataImport.svelte @@ -0,0 +1,189 @@ + + +
+ + +
+
+ {#if schema} + {#each Object.keys(schema).filter(key => schema[key].type !== 'omit') as columnName} +
+ {columnName} + + + {schema[columnName].success ? 'Success' : 'Failure'} + + omitColumn(columnName)} /> +
+ {/each} + {/if} +
+ + diff --git a/packages/builder/src/components/settings/tabs/APIKeys.svelte b/packages/builder/src/components/settings/tabs/APIKeys.svelte index c99a867e33..7645548348 100644 --- a/packages/builder/src/components/settings/tabs/APIKeys.svelte +++ b/packages/builder/src/components/settings/tabs/APIKeys.svelte @@ -5,7 +5,7 @@ import posthog from "posthog-js" import analytics from "analytics" - let keys = { budibase: "", sendGrid: "" } + let keys = { budibase: "" } async function updateKey([key, value]) { if (key === "budibase") { @@ -42,14 +42,6 @@ value={keys.budibase} label="Budibase" /> -
- updateKey(['sendgrid', e.detail])} - thin - edit - value={keys.sendgrid} - label="Sendgrid" /> -