diff --git a/.github/workflows/deploy-cloud.yaml b/.github/workflows/deploy-cloud.yaml index 9f933746d6..389b10f7d3 100644 --- a/.github/workflows/deploy-cloud.yaml +++ b/.github/workflows/deploy-cloud.yaml @@ -12,31 +12,22 @@ jobs: runs-on: ubuntu-latest steps: - # - name: Fail if not a tag - # run: | - # if [[ $GITHUB_REF != refs/tags/* ]]; then - # echo "Workflow Dispatch can only be run on tags" - # exit 1 - # fi - - - uses: actions/checkout@v2 - # with: - # fetch-depth: 0 - - # - name: Fail if tag is not in master - # run: | - # if ! git merge-base --is-ancestor ${{ github.sha }} origin/master; then - # echo "Tag is not in master. This pipeline can only execute tags that are present on the master branch" - # exit 1 - # fi - - - name: Pull values.yaml from budibase-infra + - name: Fail if not a tag run: | - curl -H "Authorization: token ${{ secrets.GH_ACCESS_TOKEN }}" \ - -H 'Accept: application/vnd.github.v3.raw' \ - -o values.production.yaml \ - -L https://api.github.com/repos/budibase/budibase-infra/contents/kubernetes/values.yaml - wc -l values.production.yaml + if [[ $GITHUB_REF != refs/tags/* ]]; then + echo "Workflow Dispatch can only be run on tags" + exit 1 + fi + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Fail if tag is not in master + run: | + if ! git merge-base --is-ancestor ${{ github.sha }} origin/master; then + echo "Tag is not in master. This pipeline can only execute tags that are present on the master branch" + exit 1 + fi - name: Get the latest budibase release version id: version @@ -48,29 +39,10 @@ jobs: fi echo "RELEASE_VERSION=$release_version" >> $GITHUB_ENV - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v1 + - uses: passeidireto/trigger-external-workflow-action@main + env: + PAYLOAD_VERSION: ${{ env.RELEASE_VERSION }} with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: eu-west-1 - - - name: Deploy to EKS - uses: craftech-io/eks-helm-deploy-action@v1 - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS__KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: eu-west-1 - cluster-name: budibase-eks-production - config-files: values.production.yaml - chart-path: charts/budibase - namespace: budibase - values: globals.appVersion=v${{ env.RELEASE_VERSION }},services.couchdb.url=${{ secrets.PRODUCTION_COUCHDB_URL }},services.couchdb.password=${{ secrets.PRODUCTION_COUCHDB_PASSWORD }} - name: budibase-prod - - - name: Discord Webhook Action - uses: tsickert/discord-webhook@v4.0.0 - with: - webhook-url: ${{ secrets.PROD_DEPLOY_WEBHOOK_URL }} - content: "Production Deployment Complete: ${{ env.RELEASE_VERSION }} deployed to Budibase Cloud." - embed-title: ${{ env.RELEASE_VERSION }} + repository: budibase/budibase-deploys + event: budicloud-prod-deploy + github_pat: ${{ secrets.GH_ACCESS_TOKEN }} diff --git a/.github/workflows/deploy-preprod.yml b/.github/workflows/deploy-preprod.yml index 81395bc7e3..9b7bca4770 100644 --- a/.github/workflows/deploy-preprod.yml +++ b/.github/workflows/deploy-preprod.yml @@ -24,51 +24,18 @@ jobs: echo "Tag is not in master. This pipeline can only execute tags that are present on the master branch" exit 1 fi - - 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: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v1 - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: eu-west-1 - - name: Pull values.yaml from budibase-infra - run: | - curl -H "Authorization: token ${{ secrets.GH_ACCESS_TOKEN }}" \ - -H 'Accept: application/vnd.github.v3.raw' \ - -o values.preprod.yaml \ - -L https://api.github.com/repos/budibase/budibase-infra/contents/kubernetes/budibase-preprod/values.yaml - wc -l values.preprod.yaml - - name: Deploy to Preprod Environment - uses: budibase/helm@v1.8.0 - with: - release: budibase-preprod - namespace: budibase - chart: charts/budibase - token: ${{ github.token }} - helm: helm3 - values: | - globals: - appVersion: v${{ env.RELEASE_VERSION }} - ingress: - enabled: true - nginx: true - value-files: >- - [ - "values.preprod.yaml" - ] + - uses: passeidireto/trigger-external-workflow-action@main env: - KUBECONFIG_FILE: '${{ secrets.PREPROD_KUBECONFIG }}' - - - name: Discord Webhook Action - uses: tsickert/discord-webhook@v4.0.0 + PAYLOAD_VERSION: ${{ env.RELEASE_VERSION }} with: - webhook-url: ${{ secrets.PROD_DEPLOY_WEBHOOK_URL }} - content: "Preprod Deployment Complete: ${{ env.RELEASE_VERSION }} deployed to Budibase Pre-prod." - embed-title: ${{ env.RELEASE_VERSION }} + repository: budibase/budibase-deploys + event: budicloud-preprod-deploy + github_pat: ${{ secrets.GH_ACCESS_TOKEN }} + diff --git a/lerna.json b/lerna.json index a530305314..b43faee706 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.7.11", + "version": "2.7.33", "npmClient": "yarn", "packages": [ "packages/backend-core", diff --git a/packages/bbui/src/Markdown/SpectrumMDE.svelte b/packages/bbui/src/Markdown/SpectrumMDE.svelte index 9b0832c91f..8e7b1bbdfd 100644 --- a/packages/bbui/src/Markdown/SpectrumMDE.svelte +++ b/packages/bbui/src/Markdown/SpectrumMDE.svelte @@ -87,7 +87,7 @@ border-color: var(--spectrum-global-color-gray-400); } /* Toolbar button color */ - :global(.EasyMDEContainer .editor-toolbar button i) { + :global(.EasyMDEContainer .editor-toolbar button) { color: var(--spectrum-global-color-gray-800); } /* Separator between toolbar buttons*/ diff --git a/packages/builder/index.html b/packages/builder/index.html index 96abc8e582..eb151de75c 100644 --- a/packages/builder/index.html +++ b/packages/builder/index.html @@ -5,9 +5,10 @@ Budibase - - + + + + diff --git a/packages/builder/package.json b/packages/builder/package.json index 73bc003343..a2567dc638 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -70,6 +70,7 @@ "@codemirror/state": "^6.2.0", "@codemirror/theme-one-dark": "^6.1.2", "@codemirror/view": "^6.11.2", + "@fontsource/source-sans-pro": "^5.0.3", "@fortawesome/fontawesome-svg-core": "^6.2.1", "@fortawesome/free-brands-svg-icons": "^6.2.1", "@fortawesome/free-solid-svg-icons": "^6.2.1", @@ -122,6 +123,7 @@ "tsconfig-paths": "4.0.0", "typescript": "4.7.3", "vite": "^3.0.8", + "vite-plugin-static-copy": "^0.16.0", "vitest": "^0.29.2" }, "nx": { diff --git a/packages/builder/public/bblogo.png b/packages/builder/public/bblogo.png new file mode 100644 index 0000000000..8c89c12f19 Binary files /dev/null and b/packages/builder/public/bblogo.png differ diff --git a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/ActionModal.svelte b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/ActionModal.svelte index c5e4eaf61f..96dc8f4686 100644 --- a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/ActionModal.svelte +++ b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/ActionModal.svelte @@ -12,7 +12,7 @@ import { automationStore, selectedAutomation } from "builderStore" import { admin, licensing } from "stores/portal" import { externalActions } from "./ExternalActions" - import { TriggerStepID } from "constants/backend/automations" + import { TriggerStepID, ActionStepID } from "constants/backend/automations" import { checkForCollectStep } from "builderStore/utils" export let blockIdx @@ -149,7 +149,7 @@
{action.name} - {#if isDisabled && !syncAutomationsEnabled} + {#if isDisabled && !syncAutomationsEnabled && action.stepId === ActionStepID.COLLECT}
Business diff --git a/packages/builder/src/components/backend/DataTable/DataTable.svelte b/packages/builder/src/components/backend/DataTable/DataTable.svelte index 1b0c92bde0..981a619ebd 100644 --- a/packages/builder/src/components/backend/DataTable/DataTable.svelte +++ b/packages/builder/src/components/backend/DataTable/DataTable.svelte @@ -1,5 +1,5 @@
@@ -37,7 +49,7 @@ allowDeleteRows={!isUsersTable} schemaOverrides={isUsersTable ? userSchemaOverrides : null} showAvatars={false} - on:updatetable={e => tables.replaceTable(id, e.detail)} + on:updatetable={handleGridTableUpdate} > {#if isInternal} diff --git a/packages/builder/src/components/backend/DataTable/formula.js b/packages/builder/src/components/backend/DataTable/formula.js index 9fd5949178..43e8dc721e 100644 --- a/packages/builder/src/components/backend/DataTable/formula.js +++ b/packages/builder/src/components/backend/DataTable/formula.js @@ -76,6 +76,10 @@ export function getBindings({ // will be replaced by the main array binding readableBinding: label, runtimeBinding: binding, + display: { + name: label, + type: field.name === FIELDS.LINK.name ? "Array" : field.name, + }, }) } return bindings diff --git a/packages/builder/src/components/backend/Datasources/CreateEditRelationship.svelte b/packages/builder/src/components/backend/Datasources/CreateEditRelationship.svelte index 1413cd157e..4908512515 100644 --- a/packages/builder/src/components/backend/Datasources/CreateEditRelationship.svelte +++ b/packages/builder/src/components/backend/Datasources/CreateEditRelationship.svelte @@ -59,7 +59,6 @@ $: valid = getErrorCount(errors) === 0 && allRequiredAttributesSet() $: isManyToMany = relationshipType === RelationshipTypes.MANY_TO_MANY $: isManyToOne = relationshipType === RelationshipTypes.MANY_TO_ONE - $: toRelationship.relationshipType = fromRelationship?.relationshipType function getTable(id) { return plusTables.find(table => table._id === id) @@ -180,6 +179,16 @@ return getErrorCount(errors) === 0 } + function otherRelationshipType(type) { + if (type === RelationshipTypes.MANY_TO_ONE) { + return RelationshipTypes.ONE_TO_MANY + } else if (type === RelationshipTypes.ONE_TO_MANY) { + return RelationshipTypes.MANY_TO_ONE + } else if (type === RelationshipTypes.MANY_TO_MANY) { + return RelationshipTypes.MANY_TO_MANY + } + } + function buildRelationships() { const id = Helpers.uuid() //Map temporary variables @@ -200,6 +209,7 @@ ...toRelationship, tableId: fromId, name: fromColumn, + relationshipType: otherRelationshipType(relationshipType), through: throughId, type: "link", _id: id, diff --git a/packages/builder/src/components/backend/TableNavigator/modals/CreateTableModal.svelte b/packages/builder/src/components/backend/TableNavigator/modals/CreateTableModal.svelte index bd1761620d..bfca91afaa 100644 --- a/packages/builder/src/components/backend/TableNavigator/modals/CreateTableModal.svelte +++ b/packages/builder/src/components/backend/TableNavigator/modals/CreateTableModal.svelte @@ -93,6 +93,7 @@ try { await beforeSave() table = await tables.save(newTable) + await datasources.fetch() await afterSave(table) } catch (e) { notifications.error(e) diff --git a/packages/builder/src/components/backend/TableNavigator/popovers/EditTablePopover.svelte b/packages/builder/src/components/backend/TableNavigator/popovers/EditTablePopover.svelte index 01c62d56f7..11ef60480b 100644 --- a/packages/builder/src/components/backend/TableNavigator/popovers/EditTablePopover.svelte +++ b/packages/builder/src/components/backend/TableNavigator/popovers/EditTablePopover.svelte @@ -65,6 +65,7 @@ const updatedTable = cloneDeep(table) updatedTable.name = updatedName await tables.save(updatedTable) + await datasources.fetch() notifications.success("Table renamed successfully") } diff --git a/packages/builder/src/components/common/FontAwesomeIcon.svelte b/packages/builder/src/components/common/FontAwesomeIcon.svelte index 364b3af25f..97d33f5790 100644 --- a/packages/builder/src/components/common/FontAwesomeIcon.svelte +++ b/packages/builder/src/components/common/FontAwesomeIcon.svelte @@ -9,6 +9,18 @@ faFileArrowUp, faChevronLeft, faCircleInfo, + faBold, + faItalic, + faHeading, + faQuoteLeft, + faListUl, + faListOl, + faLink, + faImage, + faEye, + faColumns, + faArrowsAlt, + faQuestionCircle, } from "@fortawesome/free-solid-svg-icons" import { faGithub, faDiscord } from "@fortawesome/free-brands-svg-icons" @@ -22,7 +34,22 @@ faEnvelope, faFileArrowUp, faChevronLeft, - faCircleInfo + faCircleInfo, + + // -- Required for easyMDE use in the builder. + faBold, + faItalic, + faHeading, + faQuoteLeft, + faListUl, + faListOl, + faLink, + faImage, + faEye, + faColumns, + faArrowsAlt, + faQuestionCircle + // -- ) dom.watch() diff --git a/packages/builder/src/components/common/bindings/BindingPanel.svelte b/packages/builder/src/components/common/bindings/BindingPanel.svelte index 3843eabf45..c95988e90c 100644 --- a/packages/builder/src/components/common/bindings/BindingPanel.svelte +++ b/packages/builder/src/components/common/bindings/BindingPanel.svelte @@ -19,7 +19,7 @@ readableToRuntimeBinding, runtimeToReadableBinding, } from "builderStore/dataBinding" - import { store } from "builderStore" + import { convertToJS } from "@budibase/string-templates" import { admin } from "stores/portal" import CodeEditor from "../CodeEditor/CodeEditor.svelte" @@ -339,25 +339,28 @@ {/if}
- - + {#if drawerActions?.hide} + + {/if} + {#if bindingDrawerActions?.save} + + {/if}
diff --git a/packages/builder/src/components/common/bindings/BindingPicker.svelte b/packages/builder/src/components/common/bindings/BindingPicker.svelte index 0f709fd262..50e7c66682 100644 --- a/packages/builder/src/components/common/bindings/BindingPicker.svelte +++ b/packages/builder/src/components/common/bindings/BindingPicker.svelte @@ -36,7 +36,7 @@ .map(([name, categoryBindings]) => ({ name, bindings: categoryBindings?.filter(binding => { - return binding.readableBinding.match(searchRgx) + return !search || binding.readableBinding.match(searchRgx) }), })) .filter(category => { @@ -46,7 +46,11 @@ ) }) $: filteredHelpers = helpers?.filter(helper => { - return helper.label.match(searchRgx) || helper.description.match(searchRgx) + return ( + !search || + helper.label.match(searchRgx) || + helper.description.match(searchRgx) + ) }) const getHelperExample = (helper, js) => { @@ -124,9 +128,6 @@ { - if (!search) { - return - } search = null }} class:searching={search} diff --git a/packages/builder/src/components/common/bindings/DrawerBindableCombobox.svelte b/packages/builder/src/components/common/bindings/DrawerBindableCombobox.svelte index bb01d557b8..55f7866453 100644 --- a/packages/builder/src/components/common/bindings/DrawerBindableCombobox.svelte +++ b/packages/builder/src/components/common/bindings/DrawerBindableCombobox.svelte @@ -76,7 +76,7 @@ {/if}
- + Add the objects on the left to enrich your text. diff --git a/packages/builder/src/components/common/bindings/DrawerBindableInput.svelte b/packages/builder/src/components/common/bindings/DrawerBindableInput.svelte index f41b66bd77..7fbbf75a30 100644 --- a/packages/builder/src/components/common/bindings/DrawerBindableInput.svelte +++ b/packages/builder/src/components/common/bindings/DrawerBindableInput.svelte @@ -5,8 +5,6 @@ runtimeToReadableBinding, } from "builderStore/dataBinding" - import { store } from "builderStore" - import ClientBindingPanel from "components/common/bindings/ClientBindingPanel.svelte" import { createEventDispatcher, setContext } from "svelte" import { isJSBinding } from "@budibase/string-templates" @@ -36,7 +34,6 @@ const saveBinding = () => { onChange(tempValue) - store.actions.settings.propertyFocus(null) onBlur() bindingDrawer.hide() } @@ -70,7 +67,6 @@
{ - store.actions.settings.propertyFocus(key) bindingDrawer.show() }} > diff --git a/packages/builder/src/components/design/settings/controls/PropertyControl.svelte b/packages/builder/src/components/design/settings/controls/PropertyControl.svelte index daa3f29592..57601d47ca 100644 --- a/packages/builder/src/components/design/settings/controls/PropertyControl.svelte +++ b/packages/builder/src/components/design/settings/controls/PropertyControl.svelte @@ -73,10 +73,6 @@ if (highlighted) { store.actions.settings.highlight(null) } - // To fix focus 'affect' when property is target of a drawer other actions in the builder. - if (propertyFocus) { - store.actions.settings.propertyFocus(null) - } }) diff --git a/packages/builder/src/components/integration/QueryEditor.svelte b/packages/builder/src/components/integration/QueryEditor.svelte index f543438b9c..51fdb4879e 100644 --- a/packages/builder/src/components/integration/QueryEditor.svelte +++ b/packages/builder/src/components/integration/QueryEditor.svelte @@ -186,7 +186,6 @@ } div :global(.CodeMirror) { - width: var(--code-mirror-width) !important; height: var(--code-mirror-height) !important; border-radius: var(--border-radius-s); font-family: var(--font-mono); diff --git a/packages/builder/src/pages/builder/Branding.svelte b/packages/builder/src/pages/builder/Branding.svelte index 142473abb8..e51ca1c70d 100644 --- a/packages/builder/src/pages/builder/Branding.svelte +++ b/packages/builder/src/pages/builder/Branding.svelte @@ -8,7 +8,7 @@ $: platformTitle = !$auth.user && platformTitleText ? platformTitleText : "Budibase" - $: faviconUrl = $organisation.faviconUrl || "https://i.imgur.com/Xhdt1YP.png" + $: faviconUrl = $organisation.faviconUrl || "/builder/bblogo.png" onMount(async () => { await organisation.init() @@ -27,6 +27,6 @@ {:else} - + {/if} diff --git a/packages/builder/src/pages/builder/portal/apps/onboarding/_components/ExampleApp.svelte b/packages/builder/src/pages/builder/portal/apps/onboarding/_components/ExampleApp.svelte index 0b290decbf..48221a918d 100644 --- a/packages/builder/src/pages/builder/portal/apps/onboarding/_components/ExampleApp.svelte +++ b/packages/builder/src/pages/builder/portal/apps/onboarding/_components/ExampleApp.svelte @@ -44,7 +44,7 @@
- Budibase Logo + Budibase Logo

{name}

diff --git a/packages/builder/src/stores/backend/datasources.js b/packages/builder/src/stores/backend/datasources.js index 0815f9d766..af914cbee7 100644 --- a/packages/builder/src/stores/backend/datasources.js +++ b/packages/builder/src/stores/backend/datasources.js @@ -113,6 +113,10 @@ export function createDatasourcesStore() { ...state, list: [...state.list, datasource], })) + + // If this is a new datasource then we should refresh the tables list, + // because otherwise we'll never see the new tables + tables.fetch() } // Update existing datasource diff --git a/packages/builder/src/stores/backend/tables.js b/packages/builder/src/stores/backend/tables.js index f8796712a8..d79ed6f072 100644 --- a/packages/builder/src/stores/backend/tables.js +++ b/packages/builder/src/stores/backend/tables.js @@ -1,5 +1,4 @@ import { get, writable, derived } from "svelte/store" -import { datasources } from "./" import { cloneDeep } from "lodash/fp" import { API } from "api" import { SWITCHABLE_TYPES } from "constants/backend" @@ -63,7 +62,6 @@ export function createTablesStore() { const savedTable = await API.saveTable(updatedTable) replaceTable(savedTable._id, savedTable) - await datasources.fetch() select(savedTable._id) return savedTable } diff --git a/packages/builder/vite.config.js b/packages/builder/vite.config.js index 7227551850..bf6b4ce17e 100644 --- a/packages/builder/vite.config.js +++ b/packages/builder/vite.config.js @@ -1,6 +1,7 @@ import { svelte } from "@sveltejs/vite-plugin-svelte" import replace from "@rollup/plugin-replace" import { defineConfig, loadEnv } from "vite" +import { viteStaticCopy } from "vite-plugin-static-copy" import path from "path" const ignoredWarnings = [ @@ -59,6 +60,18 @@ export default defineConfig(({ mode }) => { ), "process.env.SENTRY_DSN": JSON.stringify(process.env.SENTRY_DSN), }), + viteStaticCopy({ + targets: [ + { + src: "../../node_modules/@fontsource/source-sans-pro", + dest: "fonts", + }, + { + src: "../../node_modules/remixicon/fonts/*", + dest: "fonts", + }, + ], + }), ], optimizeDeps: { exclude: ["@roxi/routify"], diff --git a/packages/client/src/components/app/Layout.svelte b/packages/client/src/components/app/Layout.svelte index 244500f266..ba5bbedd2f 100644 --- a/packages/client/src/components/app/Layout.svelte +++ b/packages/client/src/components/app/Layout.svelte @@ -180,10 +180,7 @@ {/if}