diff --git a/lerna.json b/lerna.json index bfafe7be44..3c3b56bf83 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.0.105-alpha.29", + "version": "1.0.105-alpha.30", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index 027a11e910..6fdafea9de 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "1.0.105-alpha.29", + "version": "1.0.105-alpha.30", "description": "Budibase backend core libraries used in server and worker", "main": "src/index.js", "author": "Budibase", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index e9fa0e88a0..5e8c431855 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/bbui", "description": "A UI solution used in the different Budibase projects.", - "version": "1.0.105-alpha.29", + "version": "1.0.105-alpha.30", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", @@ -38,7 +38,7 @@ ], "dependencies": { "@adobe/spectrum-css-workflow-icons": "^1.2.1", - "@budibase/string-templates": "^1.0.105-alpha.29", + "@budibase/string-templates": "^1.0.105-alpha.30", "@spectrum-css/actionbutton": "^1.0.1", "@spectrum-css/actiongroup": "^1.0.1", "@spectrum-css/avatar": "^3.0.2", diff --git a/packages/bbui/src/ActionButton/ActionButton.svelte b/packages/bbui/src/ActionButton/ActionButton.svelte index 5ab7a7f047..b518ac3d92 100644 --- a/packages/bbui/src/ActionButton/ActionButton.svelte +++ b/packages/bbui/src/ActionButton/ActionButton.svelte @@ -80,8 +80,4 @@ .active svg { color: var(--spectrum-global-color-blue-600); } - - .spectrum-ActionButton-label { - padding-bottom: 2px; - } diff --git a/packages/bbui/src/Table/Table.svelte b/packages/bbui/src/Table/Table.svelte index 1d957b3f30..863dc84040 100644 --- a/packages/bbui/src/Table/Table.svelte +++ b/packages/bbui/src/Table/Table.svelte @@ -36,6 +36,7 @@ export let disableSorting = false export let autoSortColumns = true export let compact = false + export let customPlaceholder = false const dispatch = createEventDispatcher() @@ -387,13 +388,24 @@ {/each} {:else} -
-
- - - -
No rows found
-
+
+ {#if customPlaceholder} + + {:else} +
+ + + +
No rows found
+
+ {/if}
{/if}
@@ -458,6 +470,13 @@ justify-content: flex-start; align-items: center; user-select: none; + border-top: var(--table-border); + } + .spectrum-Table-headCell:first-of-type { + border-left: var(--table-border); + } + .spectrum-Table-headCell:last-of-type { + border-right: var(--table-border); } .spectrum-Table-headCell--alignCenter { justify-content: center; @@ -576,16 +595,19 @@ border-top: none; grid-column: 1 / -1; background-color: var(--table-bg); + padding: 40px; } .placeholder--no-fields { border-top: var(--table-border); } + .placeholder--custom { + justify-content: flex-start; + } .wrapper--quiet .placeholder { border-left: none; border-right: none; } .placeholder-content { - padding: 40px; display: flex; flex-direction: column; justify-content: center; diff --git a/packages/builder/package.json b/packages/builder/package.json index 93e4ecda7a..d56f60405d 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.0.105-alpha.29", + "version": "1.0.105-alpha.30", "license": "GPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^1.0.105-alpha.29", - "@budibase/client": "^1.0.105-alpha.29", - "@budibase/frontend-core": "^1.0.105-alpha.29", - "@budibase/string-templates": "^1.0.105-alpha.29", + "@budibase/bbui": "^1.0.105-alpha.30", + "@budibase/client": "^1.0.105-alpha.30", + "@budibase/frontend-core": "^1.0.105-alpha.30", + "@budibase/string-templates": "^1.0.105-alpha.30", "@sentry/browser": "5.19.1", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/builder/src/builderStore/dataBinding.js b/packages/builder/src/builderStore/dataBinding.js index 8dff56dd6b..8cbc629291 100644 --- a/packages/builder/src/builderStore/dataBinding.js +++ b/packages/builder/src/builderStore/dataBinding.js @@ -654,7 +654,7 @@ export const getSchemaForDatasource = (asset, datasource, options) => { * Builds a form schema given a form component. * A form schema is a schema of all the fields nested anywhere within a form. */ -const buildFormSchema = component => { +export const buildFormSchema = component => { let schema = {} if (!component) { return schema diff --git a/packages/builder/src/components/backend/DataTable/DataTable.svelte b/packages/builder/src/components/backend/DataTable/DataTable.svelte index 9132fc1c89..6a1befd7e4 100644 --- a/packages/builder/src/components/backend/DataTable/DataTable.svelte +++ b/packages/builder/src/components/backend/DataTable/DataTable.svelte @@ -14,7 +14,7 @@ import Table from "./Table.svelte" import { TableNames } from "constants" import CreateEditRow from "./modals/CreateEditRow.svelte" - import { Pagination } from "@budibase/bbui" + import { Pagination, Heading, Body, Layout } from "@budibase/bbui" import { fetchData } from "@budibase/frontend-core" import { API } from "api" @@ -27,6 +27,8 @@ $: enrichedSchema = enrichSchema($tables.selected?.schema) $: id = $tables.selected?._id $: fetch = createFetch(id) + $: hasCols = checkHasCols(schema) + $: hasRows = !!$fetch.rows?.length const enrichSchema = schema => { let tempSchema = { ...schema } @@ -47,6 +49,20 @@ return tempSchema } + + const checkHasCols = schema => { + if (!schema || Object.keys(schema).length === 0) { + return false + } + let fields = Object.values(schema) + for (let field of fields) { + if (!field.autocolumn) { + return true + } + } + return false + } + // Fetches new data whenever the table changes const createFetch = tableId => { return fetchData({ @@ -104,40 +120,73 @@ disableSorting on:updatecolumns={onUpdateColumns} on:updaterows={onUpdateRows} + customPlaceholder > - - {#if schema && Object.keys(schema).length > 0} - {#if !isUsersTable} - - {/if} - {#if isInternal} - - {/if} - - {#if isUsersTable} - - {/if} - {#if !isInternal} - +
+ - {/if} - - - - - {#key id} - - {/key} - {/if} + {#if !isUsersTable} + + {/if} + {#if isInternal} + + {/if} +
+
+ + {#if isUsersTable} + + {/if} + {#if !isInternal} + + {/if} + + + + {#key id} + + {/key} +
+ +
+ + {#if !hasCols} + Let's create some columns + + Start building out your table structure
+ by adding some columns + + {:else} + Now let's add a row + + Add some data to your table
+ by adding some rows + + {/if} +
+
{#key id}
@@ -162,4 +211,20 @@ align-items: center; margin-top: var(--spacing-xl); } + .buttons { + flex: 1 1 auto; + display: flex; + flex-direction: row; + justify-content: space-between; + align-items: center; + flex-wrap: wrap; + } + .left-buttons, + .right-buttons { + display: flex; + flex-direction: row; + justify-content: flex-start; + align-items: center; + gap: var(--spacing-m); + } diff --git a/packages/builder/src/components/backend/DataTable/Table.svelte b/packages/builder/src/components/backend/DataTable/Table.svelte index 81edb39667..85b271dee8 100644 --- a/packages/builder/src/components/backend/DataTable/Table.svelte +++ b/packages/builder/src/components/backend/DataTable/Table.svelte @@ -25,6 +25,7 @@ export let rowCount export let type export let disableSorting = false + export let customPlaceholder = false let selectedRows = [] let editableColumn @@ -117,10 +118,10 @@ -
+ {#if title}
- {title} + {title} {#if loading}
@@ -134,7 +135,7 @@ {/if}
-
+
{#key tableId}
editRow(e.detail)} on:clickrelationship={e => selectRelationship(e.detail)} on:sort - /> + > + +
{/key} @@ -176,6 +180,7 @@ flex-direction: row; justify-content: flex-start; align-items: center; + margin-top: var(--spacing-m); } .table-title > div { margin-left: var(--spacing-xs); diff --git a/packages/builder/src/components/backend/DataTable/buttons/CreateColumnButton.svelte b/packages/builder/src/components/backend/DataTable/buttons/CreateColumnButton.svelte index abf7e25d2a..8644ee86da 100644 --- a/packages/builder/src/components/backend/DataTable/buttons/CreateColumnButton.svelte +++ b/packages/builder/src/components/backend/DataTable/buttons/CreateColumnButton.svelte @@ -2,10 +2,21 @@ import { ActionButton, Modal } from "@budibase/bbui" import CreateEditColumn from "../modals/CreateEditColumn.svelte" + export let highlighted = false + export let disabled = false + let modal - + Create column diff --git a/packages/builder/src/components/backend/DataTable/buttons/CreateRowButton.svelte b/packages/builder/src/components/backend/DataTable/buttons/CreateRowButton.svelte index 2a31d02375..1676a5b23c 100644 --- a/packages/builder/src/components/backend/DataTable/buttons/CreateRowButton.svelte +++ b/packages/builder/src/components/backend/DataTable/buttons/CreateRowButton.svelte @@ -4,11 +4,21 @@ export let modalContentComponent = CreateEditRow export let title = "Create row" + export let disabled = false + export let highlighted = false let modal - + {title} diff --git a/packages/builder/src/components/backend/DataTable/buttons/CreateViewButton.svelte b/packages/builder/src/components/backend/DataTable/buttons/CreateViewButton.svelte index 297d120ede..0133b5bd79 100644 --- a/packages/builder/src/components/backend/DataTable/buttons/CreateViewButton.svelte +++ b/packages/builder/src/components/backend/DataTable/buttons/CreateViewButton.svelte @@ -2,10 +2,18 @@ import { Modal, ActionButton } from "@budibase/bbui" import CreateViewModal from "../modals/CreateViewModal.svelte" + export let disabled = false + let modal - + Create view diff --git a/packages/builder/src/components/backend/DataTable/buttons/ExportButton.svelte b/packages/builder/src/components/backend/DataTable/buttons/ExportButton.svelte index d8502c7d3e..093ca33182 100644 --- a/packages/builder/src/components/backend/DataTable/buttons/ExportButton.svelte +++ b/packages/builder/src/components/backend/DataTable/buttons/ExportButton.svelte @@ -3,11 +3,18 @@ import ExportModal from "../modals/ExportModal.svelte" export let view + export let disabled = false let modal - + Export diff --git a/packages/builder/src/components/backend/DataTable/buttons/HideAutocolumnButton.svelte b/packages/builder/src/components/backend/DataTable/buttons/HideAutocolumnButton.svelte index 3d74188ee4..e9b042a653 100644 --- a/packages/builder/src/components/backend/DataTable/buttons/HideAutocolumnButton.svelte +++ b/packages/builder/src/components/backend/DataTable/buttons/HideAutocolumnButton.svelte @@ -8,6 +8,12 @@ } - - {#if hideAutocolumns}Show auto columns{:else}Hide auto columns{/if} + + Auto columns diff --git a/packages/builder/src/components/backend/DataTable/buttons/TableFilterButton.svelte b/packages/builder/src/components/backend/DataTable/buttons/TableFilterButton.svelte index c07b11237b..cf9e4b1358 100644 --- a/packages/builder/src/components/backend/DataTable/buttons/TableFilterButton.svelte +++ b/packages/builder/src/components/backend/DataTable/buttons/TableFilterButton.svelte @@ -5,6 +5,7 @@ export let schema export let filters + export let disabled = false const dispatch = createEventDispatcher() let modal @@ -17,6 +18,7 @@ icon="Filter" size="S" quiet + {disabled} on:click={modal.show} active={tempValue?.length > 0} > diff --git a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ButtonActionEditor/actions/UpdateFieldValue.svelte b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ButtonActionEditor/actions/UpdateFieldValue.svelte new file mode 100644 index 0000000000..cddf3e9fda --- /dev/null +++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ButtonActionEditor/actions/UpdateFieldValue.svelte @@ -0,0 +1,78 @@ + + +
+ + + + + {#if parameters.type === "set"} + + (parameters.value = e.detail)} + /> + {/if} +
+ + diff --git a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ButtonActionEditor/actions/index.js b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ButtonActionEditor/actions/index.js index 2306d4a548..8f0baf08be 100644 --- a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ButtonActionEditor/actions/index.js +++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ButtonActionEditor/actions/index.js @@ -14,3 +14,4 @@ export { default as DuplicateRow } from "./DuplicateRow.svelte" export { default as S3Upload } from "./S3Upload.svelte" export { default as ExportData } from "./ExportData.svelte" export { default as ContinueIf } from "./ContinueIf.svelte" +export { default as UpdateFieldValue } from "./UpdateFieldValue.svelte" diff --git a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ButtonActionEditor/manifest.json b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ButtonActionEditor/manifest.json index 80464b281f..cf18fee3a6 100644 --- a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ButtonActionEditor/manifest.json +++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ButtonActionEditor/manifest.json @@ -42,25 +42,29 @@ "name": "Trigger Automation", "component": "TriggerAutomation" }, + { + "name": "Update Field Value", + "component": "UpdateFieldValue" + }, { "name": "Validate Form", "component": "ValidateForm" }, { - "name": "Log Out", - "component": "LogOut" + "name": "Change Form Step", + "component": "ChangeFormStep" }, { "name": "Clear Form", "component": "ClearForm" }, { - "name": "Close Screen Modal", - "component": "CloseScreenModal" + "name": "Log Out", + "component": "LogOut" }, { - "name": "Change Form Step", - "component": "ChangeFormStep" + "name": "Close Screen Modal", + "component": "CloseScreenModal" }, { "name": "Refresh Data Provider", diff --git a/packages/builder/src/pages/builder/portal/apps/create.svelte b/packages/builder/src/pages/builder/portal/apps/create.svelte index cf1e3b66bd..cd2d47ea4c 100644 --- a/packages/builder/src/pages/builder/portal/apps/create.svelte +++ b/packages/builder/src/pages/builder/portal/apps/create.svelte @@ -75,8 +75,8 @@
- {createAppTitle} - + {createAppTitle} + {welcomeBody} @@ -84,7 +84,7 @@