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/createView.spec.js b/packages/builder/cypress/integration/createView.spec.js index 95cabc887f..8f0c9565c8 100644 --- a/packages/builder/cypress/integration/createView.spec.js +++ b/packages/builder/cypress/integration/createView.spec.js @@ -50,13 +50,11 @@ context("Create a View", () => { it("creates a stats calculation view based on age", () => { cy.contains("Calculate").click() + // we may reinstate this - have commented this dropdown for now as there is only one option + //cy.get(".menu-container").find("select").first().select("Statistics") cy.get(".menu-container") .find("select") - .first() - .select("Statistics") - cy.get(".menu-container") - .find("select") - .eq(1) + .eq(0) .select("age") cy.contains("Save").click() cy.get("thead th div").should($headers => { diff --git a/packages/builder/package.json b/packages/builder/package.json index 73a8be3fe6..74bff1b6a8 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.40.1", - "@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/backend/DataTable/ModelDataTable.svelte b/packages/builder/src/components/backend/DataTable/ModelDataTable.svelte index 49659ff8d0..63d94aeab4 100644 --- a/packages/builder/src/components/backend/DataTable/ModelDataTable.svelte +++ b/packages/builder/src/components/backend/DataTable/ModelDataTable.svelte @@ -8,6 +8,7 @@ import Table from "./Table.svelte" let data = [] + let loading = false $: title = $backendUiStore.selectedModel.name $: schema = $backendUiStore.selectedModel.schema @@ -19,14 +20,16 @@ // Fetch records for specified model $: { if ($backendUiStore.selectedView?.name?.startsWith("all_")) { + loading = true api.fetchDataForView($backendUiStore.selectedView).then(records => { data = records || [] + loading = false }) } } - +
{#if Object.keys(schema).length > 0} diff --git a/packages/builder/src/components/backend/DataTable/Table.svelte b/packages/builder/src/components/backend/DataTable/Table.svelte index 2e28577c60..c1e34074e6 100644 --- a/packages/builder/src/components/backend/DataTable/Table.svelte +++ b/packages/builder/src/components/backend/DataTable/Table.svelte @@ -1,6 +1,7 @@
@@ -71,8 +78,8 @@ {#if field.type !== 'link'} (field.constraints.presence.allowEmpty = !e.target.checked)} + checked={required} + on:change={onChangeRequired} thin text="Required" /> {/if} diff --git a/packages/builder/src/components/backend/DataTable/popovers/FilterPopover.svelte b/packages/builder/src/components/backend/DataTable/popovers/FilterPopover.svelte index 889fdd0726..efa736e3a1 100644 --- a/packages/builder/src/components/backend/DataTable/popovers/FilterPopover.svelte +++ b/packages/builder/src/components/backend/DataTable/popovers/FilterPopover.svelte @@ -1,5 +1,5 @@
@@ -99,6 +126,16 @@ {/each} + - {#each viewModel.schema[filter.key].constraints.inclusion as option} - + {#each fieldOptions(filter.key) as option} + {/each} + {:else if filter.key && isDate(filter.key)} + + {:else if filter.key && isNumber(filter.key)} + {:else} - + {/if} removeFilter(idx)} /> {/each} diff --git a/packages/builder/src/components/backend/ModelNavigator/TableDataImport.svelte b/packages/builder/src/components/backend/ModelNavigator/TableDataImport.svelte new file mode 100644 index 0000000000..1356bae25c --- /dev/null +++ b/packages/builder/src/components/backend/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/backend/ModelNavigator/popovers/CreateTablePopover.svelte b/packages/builder/src/components/backend/ModelNavigator/popovers/CreateTablePopover.svelte index eb76abf3df..1468d206eb 100644 --- a/packages/builder/src/components/backend/ModelNavigator/popovers/CreateTablePopover.svelte +++ b/packages/builder/src/components/backend/ModelNavigator/popovers/CreateTablePopover.svelte @@ -2,23 +2,30 @@ import { goto } from "@sveltech/routify" import { backendUiStore } from "builderStore" import { notifier } from "builderStore/store/notifications" - import { Popover, Button, Icon, Input, Select } from "@budibase/bbui" + import { Popover, Button, Icon, Input, Select, Label } from "@budibase/bbui" + import Spinner from "components/common/Spinner.svelte" + import TableDataImport from "../TableDataImport.svelte" import analytics from "analytics" 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() - analytics.captureEvent("Table Created", { name }) + loading = false } const onClosed = () => { @@ -38,9 +45,21 @@ thin label="Table Name" bind:value={name} /> +
+ + +
- +
diff --git a/packages/builder/src/components/start/CreateAppModal.svelte b/packages/builder/src/components/start/CreateAppModal.svelte index d2d4e27d7a..587c408ecb 100644 --- a/packages/builder/src/components/start/CreateAppModal.svelte +++ b/packages/builder/src/components/start/CreateAppModal.svelte @@ -146,7 +146,7 @@ }) const appJson = await appResp.json() analytics.captureEvent("App Created", { - name, + name: $createAppStore.values.applicationName, appId: appJson._id, template, }) diff --git a/packages/builder/src/components/start/Steps/API.svelte b/packages/builder/src/components/start/Steps/API.svelte index 5f7a6d71f8..d954330d64 100644 --- a/packages/builder/src/components/start/Steps/API.svelte +++ b/packages/builder/src/components/start/Steps/API.svelte @@ -11,7 +11,7 @@ on:input={() => (blurred.api = true)} label="API Key" name="apiKey" - placeholder="Enter your API Key" + placeholder="Use command-V to paste your API Key" type="password" error={blurred.api && validationErrors.apiKey} /> Get API Key diff --git a/packages/builder/src/components/start/Steps/User.svelte b/packages/builder/src/components/start/Steps/User.svelte index d7420c0a05..06c42c553f 100644 --- a/packages/builder/src/components/start/Steps/User.svelte +++ b/packages/builder/src/components/start/Steps/User.svelte @@ -19,7 +19,7 @@ label="Password" name="password" placeholder="Password" - type="pasword" + type="password" error={blurred.password && validationErrors.password} />