diff --git a/.github/workflows/budibase_ci.yml b/.github/workflows/budibase_ci.yml index bbab4d5bb7..0881d2528d 100644 --- a/.github/workflows/budibase_ci.yml +++ b/.github/workflows/budibase_ci.yml @@ -14,6 +14,8 @@ on: env: BRANCH: ${{ github.event.pull_request.head.ref }} + BASE_BRANCH: ${{ github.event.pull_request.base.ref}} + PERSONAL_ACCESS_TOKEN : ${{ secrets.PERSONAL_ACCESS_TOKEN }} jobs: build: @@ -31,16 +33,8 @@ jobs: with: node-version: ${{ matrix.node-version }} - # Add @budibase/pro to filesystem - - name: Checkout pro - uses: actions/checkout@v2 - with: - repository: budibase/budibase-pro - ref: ${{ env.BRANCH }} - path: './pro' - token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} - - name: Setup pro - run: mv pro ../budibase-pro && cd ../budibase-pro && yarn setup + - name: Install Pro + run: yarn install:pro $BRANCH $BASE_BRANCH - run: yarn - run: yarn bootstrap diff --git a/.github/workflows/release-develop.yml b/.github/workflows/release-develop.yml index 9e0e2b3ed1..87e4f0988a 100644 --- a/.github/workflows/release-develop.yml +++ b/.github/workflows/release-develop.yml @@ -19,32 +19,20 @@ env: POSTHOG_TOKEN: ${{ secrets.POSTHOG_TOKEN }} INTERCOM_TOKEN: ${{ secrets.INTERCOM_TOKEN }} POSTHOG_URL: ${{ secrets.POSTHOG_URL }} + PERSONAL_ACCESS_TOKEN : ${{ secrets.PERSONAL_ACCESS_TOKEN }} jobs: release: runs-on: ubuntu-latest steps: - - name: Extract branch name - shell: bash - run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF_NAME})" - id: extract_branch - - uses: actions/checkout@v2 - uses: actions/setup-node@v1 with: node-version: 14.x - # Add @budibase/pro to filesystem - - name: Checkout pro - uses: actions/checkout@v2 - with: - repository: budibase/budibase-pro - ref: ${{ steps.extract_branch.outputs.branch }} - path: './pro' - token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} - - name: Setup pro - run: mv pro ../budibase-pro && cd ../budibase-pro && yarn setup + - name: Install Pro + run: yarn install:pro develop - run: yarn - run: yarn bootstrap @@ -69,21 +57,6 @@ jobs: echo //registry.npmjs.org/:_authToken=${NPM_TOKEN} >> .npmrc yarn release:develop - - name: Get the latest budibase release version - id: version - run: | - release_version=$(cat lerna.json | jq -r '.version') - echo "RELEASE_VERSION=$release_version" >> $GITHUB_ENV - - - name: Publish @budibase/pro package to NPM - env: - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - VERSION: ${{ steps.previoustag.outputs.tag }} - run: | - cd ../budibase-pro - echo //registry.npmjs.org/:_authToken=${NPM_TOKEN} >> .npmrc - yarn release:develop $RELEASE_VERSION - - name: Build/release Docker images run: | docker login -u $DOCKER_USER -p $DOCKER_PASSWORD diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 82848c78e4..07df3bd427 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,6 +20,7 @@ env: INTERCOM_TOKEN: ${{ secrets.INTERCOM_TOKEN }} POSTHOG_URL: ${{ secrets.POSTHOG_URL }} SENTRY_DSN: ${{ secrets.SENTRY_DSN }} + PERSONAL_ACCESS_TOKEN : ${{ secrets.PERSONAL_ACCESS_TOKEN }} jobs: release: @@ -30,6 +31,10 @@ jobs: - uses: actions/setup-node@v1 with: node-version: 14.x + + - name: Install Pro + run: yarn install:pro master + - run: yarn - run: yarn bootstrap - run: yarn lint diff --git a/charts/budibase/Chart.yaml b/charts/budibase/Chart.yaml index 134d29441f..694c8c77fe 100644 --- a/charts/budibase/Chart.yaml +++ b/charts/budibase/Chart.yaml @@ -11,7 +11,7 @@ sources: - https://github.com/Budibase/budibase - https://budibase.com type: application -version: 0.2.8 +version: 0.2.9 appVersion: 1.0.48 dependencies: - name: couchdb diff --git a/lerna.json b/lerna.json index 2e95a9e807..ec8a84538c 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.0.105-alpha.25", + "version": "1.0.105-alpha.35", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/package.json b/package.json index 953c4bcd76..3e6290e40b 100644 --- a/package.json +++ b/package.json @@ -23,8 +23,10 @@ "setup": "node ./hosting/scripts/setup.js && yarn && yarn bootstrap && yarn build && yarn dev", "bootstrap": "lerna link && lerna bootstrap && ./scripts/link-dependencies.sh", "build": "lerna run build", - "release": "lerna publish patch --yes --force-publish", - "release:develop": "lerna publish prerelease --yes --force-publish --dist-tag develop", + "release": "lerna publish patch --yes --force-publish && yarn release:pro", + "release:develop": "lerna publish prerelease --yes --force-publish --dist-tag develop && yarn release:pro:develop", + "release:pro": "bash scripts/pro/release.sh", + "release:pro:develop": "bash scripts/pro/release.sh develop", "restore": "yarn run clean && yarn run bootstrap && yarn run build", "nuke": "yarn run nuke:packages && yarn run nuke:docker", "nuke:packages": "yarn run restore", @@ -71,6 +73,7 @@ "mode:cloud": "yarn env:selfhost:disable && yarn env:multi:enable && yarn env:account:disable", "mode:account": "yarn mode:cloud && yarn env:account:enable", "security:audit": "node scripts/audit.js", - "postinstall": "husky install" + "postinstall": "husky install", + "install:pro": "bash scripts/pro/install.sh" } } diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index 372fb4477f..f286389c22 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.25", + "version": "1.0.105-alpha.35", "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 a0e01e47a7..a9d8fc249a 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.25", + "version": "1.0.105-alpha.35", "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.25", + "@budibase/string-templates": "^1.0.105-alpha.35", "@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 53c94b135a..44bfb215c5 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.0.105-alpha.25", + "version": "1.0.105-alpha.35", "license": "GPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^1.0.105-alpha.25", - "@budibase/client": "^1.0.105-alpha.25", - "@budibase/frontend-core": "^1.0.105-alpha.25", - "@budibase/string-templates": "^1.0.105-alpha.25", + "@budibase/bbui": "^1.0.105-alpha.35", + "@budibase/client": "^1.0.105-alpha.35", + "@budibase/frontend-core": "^1.0.105-alpha.35", + "@budibase/string-templates": "^1.0.105-alpha.35", "@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 @@