diff --git a/.github/workflows/deploy-preprod.yml b/.github/workflows/deploy-preprod.yml deleted file mode 100644 index eec5546444..0000000000 --- a/.github/workflows/deploy-preprod.yml +++ /dev/null @@ -1,65 +0,0 @@ -name: Budibase Deploy Preprod - -on: - workflow_dispatch: - -env: - INTERCOM_TOKEN: ${{ secrets.INTERCOM_TOKEN }} - SENTRY_DSN: ${{ secrets.SENTRY_DSN }} - -jobs: - release: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - - 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: 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: Pull values.yaml from budibase-infra - run: | - curl -H "Authorization: token ${{ secrets.GH_PERSONAL_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" - ] - env: - KUBECONFIG_FILE: '${{ secrets.PREPROD_KUBECONFIG }}' - - - name: Discord Webhook Action - uses: tsickert/discord-webhook@v4.0.0 - 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 }} diff --git a/.github/workflows/deploy-release.yml b/.github/workflows/deploy-release.yml deleted file mode 100644 index 1f7a5ebfd4..0000000000 --- a/.github/workflows/deploy-release.yml +++ /dev/null @@ -1,88 +0,0 @@ -name: Budibase Deploy Release - -on: - workflow_dispatch: - -jobs: - release: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - - 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: Fail if branch is not develop - if: github.ref != 'refs/heads/develop' - run: | - echo "Ref is not develop, you must run this job from develop." - exit 1 - - - 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: Pull values.yaml from budibase-infra - run: | - curl -H "Authorization: token ${{ secrets.GH_PERSONAL_TOKEN }}" \ - -H 'Accept: application/vnd.github.v3.raw' \ - -o values.release.yaml \ - -L https://api.github.com/repos/budibase/budibase-infra/contents/kubernetes/budibase-release/values.yaml - wc -l values.release.yaml - - - name: Deploy to Release Environment - uses: budibase/helm@v1.8.0 - with: - release: budibase-release - namespace: budibase - chart: charts/budibase - token: ${{ github.token }} - helm: helm3 - values: | - globals: - appVersion: develop - ingress: - enabled: true - nginx: true - value-files: >- - [ - "values.release.yaml" - ] - env: - KUBECONFIG_FILE: '${{ secrets.RELEASE_KUBECONFIG }}' - - - name: Re roll app-service - uses: actions-hub/kubectl@master - env: - KUBE_CONFIG: ${{ secrets.RELEASE_KUBECONFIG_BASE64 }} - with: - args: rollout restart deployment app-service -n budibase - - - name: Re roll proxy-service - uses: actions-hub/kubectl@master - env: - KUBE_CONFIG: ${{ secrets.RELEASE_KUBECONFIG_BASE64 }} - with: - args: rollout restart deployment proxy-service -n budibase - - - name: Re roll worker-service - uses: actions-hub/kubectl@master - env: - KUBE_CONFIG: ${{ secrets.RELEASE_KUBECONFIG_BASE64 }} - with: - args: rollout restart deployment worker-service -n budibase - - - - name: Discord Webhook Action - uses: tsickert/discord-webhook@v4.0.0 - with: - webhook-url: ${{ secrets.PROD_DEPLOY_WEBHOOK_URL }} - content: "Release Env Deployment Complete: ${{ env.RELEASE_VERSION }} deployed to Budibase Release Env." - embed-title: ${{ env.RELEASE_VERSION }} diff --git a/.github/workflows/release-develop.yml b/.github/workflows/release-develop.yml index e986179cfc..68c949447c 100644 --- a/.github/workflows/release-develop.yml +++ b/.github/workflows/release-develop.yml @@ -117,4 +117,4 @@ jobs: with: repository: budibase/budibase-deploys event: budicloud-qa-deploy - github_pat: ${{ secrets.GH_ACCESS_TOKEN }} \ No newline at end of file + github_pat: ${{ secrets.GH_ACCESS_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release-master.yml similarity index 54% rename from .github/workflows/release.yml rename to .github/workflows/release-master.yml index a24537ccd4..7d113a3719 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release-master.yml @@ -35,9 +35,8 @@ env: PERSONAL_ACCESS_TOKEN : ${{ secrets.PERSONAL_ACCESS_TOKEN }} jobs: - release: + release-images: runs-on: ubuntu-latest - steps: - name: Fail if branch is not master if: github.ref != 'refs/heads/master' @@ -57,14 +56,6 @@ jobs: - run: yarn lint - run: yarn build - run: yarn build:sdk - - run: yarn test - - - 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: Publish budibase packages to NPM env: @@ -90,46 +81,59 @@ jobs: DOCKER_USER: ${{ secrets.DOCKER_USERNAME }} DOCKER_PASSWORD: ${{ secrets.DOCKER_API_KEY }} BUDIBASE_RELEASE_VERSION: ${{ steps.previoustag.outputs.tag }} - - - 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_PERSONAL_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 + release-helm-chart: + needs: [release-images] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Setup Helm + uses: azure/setup-helm@v1 + id: helm-install - - 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: ${{ steps.previoustag.outputs.tag }} - ingress: - enabled: true - nginx: true - value-files: >- - [ - "values.preprod.yaml" - ] + - name: 'Get Previous tag' + id: previoustag + uses: "WyriHaximus/github-action-get-previous-tag@v1" + + # due to helm repo index issue: https://github.com/helm/helm/issues/7363 + # we need to create new package in a different dir, merge the index and move the package back + - name: Build and release helm chart + run: | + git config user.name "Budibase Helm Bot" + git config user.email "<>" + git reset --hard + git pull + mkdir sync + echo "Packaging chart to sync dir" + helm package charts/budibase --version 0.0.0-master --app-version "$RELEASE_VERSION" --destination sync + echo "Packaging successful" + git checkout gh-pages + echo "Indexing helm repo" + helm repo index --merge docs/index.yaml sync + mv -f sync/* docs + rm -rf sync + echo "Pushing new helm release" + git add -A + git commit -m "Helm Release: ${{ env.RELEASE_VERSION }}" + git push env: - KUBECONFIG_FILE: '${{ secrets.PREPROD_KUBECONFIG }}' + RELEASE_VERSION: ${{ steps.previoustag.outputs.tag }} - - name: Discord Webhook Action - uses: tsickert/discord-webhook@v4.0.0 + + # Trigger deploy to new EKS preprod environment + trigger-deploy-to-preprod-env: + needs: [release-helm-chart] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: 'Get Previous tag' + id: previoustag + uses: "WyriHaximus/github-action-get-previous-tag@v1" + + - uses: passeidireto/trigger-external-workflow-action@main + env: + PAYLOAD_VERSION: ${{ steps.previoustag.outputs.tag }} with: - webhook-url: ${{ secrets.PROD_DEPLOY_WEBHOOK_URL }} - content: "Preprod Deployment Complete: ${{ steps.previoustag.outputs.tag }} deployed to Budibase Pre-prod." - embed-title: ${{ steps.previoustag.outputs.tag }} + repository: budibase/budibase-deploys + event: budicloud-preprod-deploy + github_pat: ${{ secrets.GH_ACCESS_TOKEN }} diff --git a/.github/workflows/deploy-single-image.yml b/.github/workflows/release-singleimage.yml similarity index 100% rename from .github/workflows/deploy-single-image.yml rename to .github/workflows/release-singleimage.yml diff --git a/.github/workflows/smoke_test.yaml b/.github/workflows/smoke_test.yaml deleted file mode 100644 index 3fd61cd9c5..0000000000 --- a/.github/workflows/smoke_test.yaml +++ /dev/null @@ -1,31 +0,0 @@ -name: Budibase Nightly Tests - -on: - workflow_dispatch: - schedule: - - cron: "0 5 * * *" # every day at 5AM - -jobs: - nightly: - runs-on: [self-hosted, qa] - - steps: - - uses: actions/checkout@v2 - - name: Use Node.js 14.x - uses: actions/setup-node@v1 - with: - node-version: 14.x - - name: QA Core Integration Tests - run: | - cd qa-core - yarn - yarn api:test:ci - env: - BUDIBASE_HOST: budicloud.qa.budibase.net - BUDIBASE_ACCOUNTS_URL: https://account-portal.budicloud.qa.budibase.net - - - name: Cypress Discord Notify - run: yarn test:notify - env: - WEBHOOK_URL: ${{ secrets.BUDI_QA_WEBHOOK }} - GITHUB_RUN_URL: $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID \ No newline at end of file diff --git a/docs/DEV-SETUP-DEBIAN.md b/docs/DEV-SETUP-DEBIAN.md index 9edd8286cb..cfd7eebf47 100644 --- a/docs/DEV-SETUP-DEBIAN.md +++ b/docs/DEV-SETUP-DEBIAN.md @@ -52,4 +52,14 @@ So this command will actually run the application in dev mode. It creates .env f The dev version will be available on port 10000 i.e. -http://127.0.0.1:10000/builder/admin \ No newline at end of file +http://127.0.0.1:10000/builder/admin + +### File descriptor issues with Vite and Chrome in Linux +If your dev environment stalls forever, with some network requests stuck in flight, it's likely that Chrome is trying to open more file descriptors than your system allows. +To fix this, apply the following tweaks. + +Debian based distros: +Add `* - nofile 65536` to `/etc/security/limits.conf`. + +Arch: +Add `DefaultLimitNOFILE=65536` to `/etc/systemd/system.conf`. \ No newline at end of file diff --git a/hosting/proxy/nginx.prod.conf b/hosting/proxy/nginx.prod.conf index 4d8b3466bf..8954106feb 100644 --- a/hosting/proxy/nginx.prod.conf +++ b/hosting/proxy/nginx.prod.conf @@ -55,12 +55,12 @@ http { set $csp_style "style-src 'self' 'unsafe-inline' https://cdn.jsdelivr.net https://fonts.googleapis.com https://rsms.me https://maxcdn.bootstrapcdn.com"; set $csp_object "object-src 'none'"; set $csp_base_uri "base-uri 'self'"; - set $csp_connect "connect-src 'self' https://*.budibase.net https://api-iam.intercom.io https://api-iam.intercom.io https://api-ping.intercom.io https://app.posthog.com wss://nexus-websocket-a.intercom.io wss://nexus-websocket-b.intercom.io https://nexus-websocket-a.intercom.io https://nexus-websocket-b.intercom.io https://uploads.intercomcdn.com https://uploads.intercomusercontent.com https://*.s3.*.amazonaws.com https://s3.*.amazonaws.com https://api.github.com"; + set $csp_connect "connect-src 'self' https://*.budibase.net https://api-iam.intercom.io https://api-iam.intercom.io https://api-ping.intercom.io https://app.posthog.com wss://nexus-websocket-a.intercom.io wss://nexus-websocket-b.intercom.io https://nexus-websocket-a.intercom.io https://nexus-websocket-b.intercom.io https://uploads.intercomcdn.com https://uploads.intercomusercontent.com https://*.s3.amazonaws.com https://*.s3.us-east-2.amazonaws.com https://*.s3.us-east-1.amazonaws.com https://*.s3.us-west-1.amazonaws.com https://*.s3.us-west-2.amazonaws.com https://*.s3.af-south-1.amazonaws.com https://*.s3.ap-east-1.amazonaws.com https://*.s3.ap-southeast-3.amazonaws.com https://*.s3.ap-south-1.amazonaws.com https://*.s3.ap-northeast-3.amazonaws.com https://*.s3.ap-northeast-2.amazonaws.com https://*.s3.ap-southeast-1.amazonaws.com https://*.s3.ap-southeast-2.amazonaws.com https://*.s3.ap-northeast-1.amazonaws.com https://*.s3.ca-central-1.amazonaws.com https://*.s3.cn-north-1.amazonaws.com https://*.s3.cn-northwest-1.amazonaws.com https://*.s3.eu-central-1.amazonaws.com https://*.s3.eu-west-1.amazonaws.com https://*.s3.eu-west-2.amazonaws.com https://*.s3.eu-south-1.amazonaws.com https://*.s3.eu-west-3.amazonaws.com https://*.s3.eu-north-1.amazonaws.com https://*.s3.sa-east-1.amazonaws.com https://*.s3.me-south-1.amazonaws.com https://*.s3.us-gov-east-1.amazonaws.com https://*.s3.us-gov-west-1.amazonaws.com https://api.github.com"; set $csp_font "font-src 'self' data: https://cdn.jsdelivr.net https://fonts.gstatic.com https://rsms.me https://maxcdn.bootstrapcdn.com https://js.intercomcdn.com https://fonts.intercomcdn.com"; set $csp_frame "frame-src 'self' https:"; set $csp_img "img-src http: https: data: blob:"; set $csp_manifest "manifest-src 'self'"; - set $csp_media "media-src 'self' https://js.intercomcdn.com"; + set $csp_media "media-src 'self' https://js.intercomcdn.com https://cdn.budi.live"; set $csp_worker "worker-src 'none'"; error_page 502 503 504 /error.html; diff --git a/lerna.json b/lerna.json index 9d38656ba7..0b9b91a9f2 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.3.21-alpha.2", + "version": "2.4.3", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index 8b94e4eaf2..9a6ed6fd89 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "2.3.21-alpha.2", + "version": "2.4.3", "description": "Budibase backend core libraries used in server and worker", "main": "dist/src/index.js", "types": "dist/src/index.d.ts", @@ -24,7 +24,7 @@ "dependencies": { "@budibase/nano": "10.1.2", "@budibase/pouchdb-replication-stream": "1.2.10", - "@budibase/types": "2.3.21-alpha.2", + "@budibase/types": "^2.4.3", "@shopify/jest-koa-mocks": "5.0.1", "@techpass/passport-openidconnect": "0.3.2", "aws-cloudfront-sign": "2.2.0", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 75b3b677b7..dd74ac16a5 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": "2.3.21-alpha.2", + "version": "2.4.3", "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": "2.3.21-alpha.2", + "@budibase/string-templates": "^2.4.3", "@spectrum-css/accordion": "3.0.24", "@spectrum-css/actionbutton": "1.0.1", "@spectrum-css/actiongroup": "1.0.1", diff --git a/packages/builder/package.json b/packages/builder/package.json index 73027503c2..14945e03cb 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "2.3.21-alpha.2", + "version": "2.4.3", "license": "GPL-3.0", "private": true, "scripts": { @@ -58,10 +58,10 @@ } }, "dependencies": { - "@budibase/bbui": "2.3.21-alpha.2", - "@budibase/client": "2.3.21-alpha.2", - "@budibase/frontend-core": "2.3.21-alpha.2", - "@budibase/string-templates": "2.3.21-alpha.2", + "@budibase/bbui": "^2.4.3", + "@budibase/client": "^2.4.3", + "@budibase/frontend-core": "^2.4.3", + "@budibase/string-templates": "^2.4.3", "@fortawesome/fontawesome-svg-core": "^6.2.1", "@fortawesome/free-brands-svg-icons": "^6.2.1", "@fortawesome/free-solid-svg-icons": "^6.2.1", diff --git a/packages/builder/src/components/design/settings/controls/ColumnEditor/ColumnEditor.svelte b/packages/builder/src/components/design/settings/controls/ColumnEditor/ColumnEditor.svelte index 36cc9f619d..098a8f7ed7 100644 --- a/packages/builder/src/components/design/settings/controls/ColumnEditor/ColumnEditor.svelte +++ b/packages/builder/src/components/design/settings/controls/ColumnEditor/ColumnEditor.svelte @@ -8,6 +8,7 @@ getSchemaForDatasource, } from "builderStore/dataBinding" import { currentAsset } from "builderStore" + import { getFields } from "helpers/searchFields" export let componentInstance export let value = [] @@ -21,9 +22,14 @@ $: datasource = getDatasourceForProvider($currentAsset, componentInstance) $: schema = getSchema($currentAsset, datasource) - $: options = Object.keys(schema || {}) + $: options = allowCellEditing + ? Object.keys(schema || {}) + : enrichedSchemaFields?.map(field => field.name) $: sanitisedValue = getValidColumns(value, options) $: updateBoundValue(sanitisedValue) + $: enrichedSchemaFields = getFields(Object.values(schema) || [], { + allowLinks: true, + }) const getSchema = (asset, datasource) => { const schema = getSchemaForDatasource(asset, datasource).schema diff --git a/packages/builder/src/components/integration/RestQueryViewer.svelte b/packages/builder/src/components/integration/RestQueryViewer.svelte index 0ba232cbdb..1f21ae897e 100644 --- a/packages/builder/src/components/integration/RestQueryViewer.svelte +++ b/packages/builder/src/components/integration/RestQueryViewer.svelte @@ -120,7 +120,7 @@ const cleanUrl = inputUrl => url - ?.replace(/(http)|(https)|[{}:]/g, "") + ?.replace(/(https)|(http)|[{}:]/g, "") ?.replaceAll(".", "_") ?.replaceAll("/", " ") ?.trim() || inputUrl diff --git a/packages/builder/src/pages/builder/app/[application]/_components/BuilderSidePanel.svelte b/packages/builder/src/pages/builder/app/[application]/_components/BuilderSidePanel.svelte index a28489eb91..cd0b549d5d 100644 --- a/packages/builder/src/pages/builder/app/[application]/_components/BuilderSidePanel.svelte +++ b/packages/builder/src/pages/builder/app/[application]/_components/BuilderSidePanel.svelte @@ -671,6 +671,7 @@ align-items: center; gap: var(--spacing-m); color: var(--spectrum-global-color-gray-900); + overflow: hidden; } .auth-entity .user-email { @@ -751,11 +752,11 @@ } .builder-side-panel-header { - height: 58px; display: flex; flex-direction: row; justify-content: space-between; align-items: center; + flex: 0 0 58px; } .invite-header { diff --git a/packages/cli/package.json b/packages/cli/package.json index 15accb2886..2d8ed4e834 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "2.3.21-alpha.2", + "version": "2.4.3", "description": "Budibase CLI, for developers, self hosting and migrations.", "main": "dist/index.js", "bin": { @@ -29,14 +29,14 @@ "outputPath": "build" }, "dependencies": { - "@budibase/backend-core": "2.3.21-alpha.2", - "@budibase/string-templates": "2.3.21-alpha.2", - "@budibase/types": "2.3.21-alpha.2", + "@budibase/backend-core": "^2.4.3", + "@budibase/string-templates": "^2.4.3", + "@budibase/types": "^2.4.3", "axios": "0.21.2", "chalk": "4.1.0", "cli-progress": "3.11.2", "commander": "7.1.0", - "docker-compose": "0.23.6", + "docker-compose": "0.23.12", "dotenv": "16.0.1", "download": "8.0.0", "find-free-port": "^2.0.0", diff --git a/packages/cli/yarn.lock b/packages/cli/yarn.lock index 89e1f7c5cb..dddb04137b 100644 --- a/packages/cli/yarn.lock +++ b/packages/cli/yarn.lock @@ -1235,10 +1235,12 @@ dir-glob@^3.0.1: dependencies: path-type "^4.0.0" -docker-compose@0.23.6: - version "0.23.6" - resolved "https://registry.yarnpkg.com/docker-compose/-/docker-compose-0.23.6.tgz#bd21e17d599f17fcf7a4b5d607cff0358a9c378b" - integrity sha512-y3Q8MkwG862rNqkvEQG59/7Fi2/fzs3NYDCvqUAAD+z0WGs2qcJ9hRcn34hWgWv9ouPkFqe3Vwca0h+4bIIRWw== +docker-compose@0.23.12: + version "0.23.12" + resolved "https://registry.yarnpkg.com/docker-compose/-/docker-compose-0.23.12.tgz#fa883b98be08f6926143d06bf9e522ef7ed3210c" + integrity sha512-KFbSMqQBuHjTGZGmYDOCO0L4SaML3BsWTId5oSUyaBa22vALuFHNv+UdDWs3HcMylHWKsxCbLB7hnM/nCosWZw== + dependencies: + yaml "^1.10.2" doctrine@^3.0.0: version "3.0.0" @@ -3689,6 +3691,11 @@ yallist@^4.0.0: resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== +yaml@^1.10.2: + version "1.10.2" + resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b" + integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg== + yaml@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.1.1.tgz#1e06fb4ca46e60d9da07e4f786ea370ed3c3cfec" diff --git a/packages/client/package.json b/packages/client/package.json index 16ddfa7e86..0aed94f14d 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "2.3.21-alpha.2", + "version": "2.4.3", "license": "MPL-2.0", "module": "dist/budibase-client.js", "main": "dist/budibase-client.js", @@ -19,9 +19,9 @@ "dev:builder": "rollup -cw" }, "dependencies": { - "@budibase/bbui": "2.3.21-alpha.2", - "@budibase/frontend-core": "2.3.21-alpha.2", - "@budibase/string-templates": "2.3.21-alpha.2", + "@budibase/bbui": "^2.4.3", + "@budibase/frontend-core": "^2.4.3", + "@budibase/string-templates": "^2.4.3", "@spectrum-css/button": "^3.0.3", "@spectrum-css/card": "^3.0.3", "@spectrum-css/divider": "^1.0.3", diff --git a/packages/client/src/components/app/dynamic-filter/FilterModal.svelte b/packages/client/src/components/app/dynamic-filter/FilterModal.svelte index 5bc3e500a1..3b397761cc 100644 --- a/packages/client/src/components/app/dynamic-filter/FilterModal.svelte +++ b/packages/client/src/components/app/dynamic-filter/FilterModal.svelte @@ -57,6 +57,9 @@ const onFieldChange = (expression, field) => { // Update the field type expression.type = schemaFields.find(x => x.name === field)?.type + expression.externalType = schemaFields.find( + x => x.name === field + )?.externalType // Ensure a valid operator is set const validOperators = LuceneUtils.getValidOperatorsForType( diff --git a/packages/client/src/components/app/embedded-map/EmbeddedMap.svelte b/packages/client/src/components/app/embedded-map/EmbeddedMap.svelte index 2cfe3f497f..3bb7d5606d 100644 --- a/packages/client/src/components/app/embedded-map/EmbeddedMap.svelte +++ b/packages/client/src/components/app/embedded-map/EmbeddedMap.svelte @@ -283,27 +283,32 @@ if (mapInstance) { mapInstance.remove() } - mapInstance = L.map(embeddedMapId, mapOptions) - mapMarkerGroup.addTo(mapInstance) - candidateMarkerGroup.addTo(mapInstance) - // Add attribution - const cleanAttribution = sanitizeHtml(attribution, { - allowedTags: ["a"], - allowedAttributes: { - a: ["href", "target"], - }, - }) - L.tileLayer(tileURL, { - attribution: "© " + cleanAttribution, - zoom, - }).addTo(mapInstance) + try { + mapInstance = L.map(embeddedMapId, mapOptions) + mapMarkerGroup.addTo(mapInstance) + candidateMarkerGroup.addTo(mapInstance) - // Add click handler - mapInstance.on("click", handleMapClick) + // Add attribution + const cleanAttribution = sanitizeHtml(attribution, { + allowedTags: ["a"], + allowedAttributes: { + a: ["href", "target"], + }, + }) + L.tileLayer(tileURL, { + attribution: "© " + cleanAttribution, + zoom, + }).addTo(mapInstance) - // Reset view - resetView() + // Add click handler + mapInstance.on("click", handleMapClick) + + // Reset view + resetView() + } catch (e) { + console.log("There was a problem with the map", e) + } } const handleMapClick = e => { diff --git a/packages/client/src/utils/schema.js b/packages/client/src/utils/schema.js index 433a1c5fee..e450c516d7 100644 --- a/packages/client/src/utils/schema.js +++ b/packages/client/src/utils/schema.js @@ -81,6 +81,7 @@ export const getRelationshipSchemaAdditions = async schema => { Object.keys(linkSchema || {}).forEach(linkKey => { relationshipAdditions[`${fieldKey}.${linkKey}`] = { type: linkSchema[linkKey].type, + externalType: linkSchema[linkKey].externalType, } }) } diff --git a/packages/frontend-core/package.json b/packages/frontend-core/package.json index 7c0c16891e..7fc6397697 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "2.3.21-alpha.2", + "version": "2.4.3", "description": "Budibase frontend core libraries used in builder and client", "author": "Budibase", "license": "MPL-2.0", "svelte": "src/index.js", "dependencies": { - "@budibase/bbui": "2.3.21-alpha.2", + "@budibase/bbui": "^2.4.3", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/frontend-core/src/api/user.js b/packages/frontend-core/src/api/user.js index cb8a8f6555..d8723a649c 100644 --- a/packages/frontend-core/src/api/user.js +++ b/packages/frontend-core/src/api/user.js @@ -194,8 +194,7 @@ export const buildUserEndpoints = API => ({ }, /** - * Retrieves the invitation associated with a provided code. - * @param code The unique code for the target invite + * Retrieves all user invitations for the current tenant. */ getUserInvites: async () => { return await API.get({ diff --git a/packages/sdk/package.json b/packages/sdk/package.json index d47483d529..bfffc58fb4 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/sdk", - "version": "2.3.21-alpha.2", + "version": "2.4.3", "description": "Budibase Public API SDK", "author": "Budibase", "license": "MPL-2.0", diff --git a/packages/server/package.json b/packages/server/package.json index d857477240..14bf586f55 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "2.3.21-alpha.2", + "version": "2.4.3", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -43,11 +43,11 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "10.0.3", - "@budibase/backend-core": "2.3.21-alpha.2", - "@budibase/client": "2.3.21-alpha.2", - "@budibase/pro": "2.3.21-alpha.2", - "@budibase/string-templates": "2.3.21-alpha.2", - "@budibase/types": "2.3.21-alpha.2", + "@budibase/backend-core": "^2.4.3", + "@budibase/client": "^2.4.3", + "@budibase/pro": "2.4.3", + "@budibase/string-templates": "^2.4.3", + "@budibase/types": "^2.4.3", "@bull-board/api": "3.7.0", "@bull-board/koa": "3.9.4", "@elastic/elasticsearch": "7.10.0", diff --git a/packages/server/src/integrations/tests/googlesheets.spec.ts b/packages/server/src/integrations/tests/googlesheets.spec.ts index 1e28be33c6..5d7c184abd 100644 --- a/packages/server/src/integrations/tests/googlesheets.spec.ts +++ b/packages/server/src/integrations/tests/googlesheets.spec.ts @@ -35,6 +35,10 @@ describe("Google Sheets Integration", () => { let integration: any, config = new TestConfiguration() + beforeAll(() => { + config.setGoogleAuth("test") + }) + beforeEach(async () => { integration = new GoogleSheetsIntegration.integration({ spreadsheetId: "randomId", diff --git a/packages/server/src/integrations/utils.ts b/packages/server/src/integrations/utils.ts index 4681cd4f2a..356a08f4a0 100644 --- a/packages/server/src/integrations/utils.ts +++ b/packages/server/src/integrations/utils.ts @@ -223,14 +223,15 @@ function shouldCopySpecialColumn( column: { type: string }, fetchedColumn: { type: string } | undefined ) { + const isFormula = column.type === FieldTypes.FORMULA const specialTypes = [ FieldTypes.OPTIONS, FieldTypes.LONGFORM, FieldTypes.ARRAY, FieldTypes.FORMULA, ] - // column has been deleted, remove - if (column && !fetchedColumn) { + // column has been deleted, remove - formulas will never exist, always copy + if (!isFormula && column && !fetchedColumn) { return false } const fetchedIsNumber = diff --git a/packages/server/src/tests/utilities/TestConfiguration.ts b/packages/server/src/tests/utilities/TestConfiguration.ts index e9b770229f..9aab76ba4d 100644 --- a/packages/server/src/tests/utilities/TestConfiguration.ts +++ b/packages/server/src/tests/utilities/TestConfiguration.ts @@ -181,6 +181,13 @@ class TestConfiguration { coreEnv._set("SELF_HOSTED", value) } + setGoogleAuth = (value: string) => { + env._set("GOOGLE_CLIENT_ID", value) + env._set("GOOGLE_CLIENT_SECRET", value) + coreEnv._set("GOOGLE_CLIENT_ID", value) + coreEnv._set("GOOGLE_CLIENT_SECRET", value) + } + modeCloud = () => { this.setSelfHosted(false) } diff --git a/packages/server/src/utilities/global.ts b/packages/server/src/utilities/global.ts index c9161aa426..45e58c8419 100644 --- a/packages/server/src/utilities/global.ts +++ b/packages/server/src/utilities/global.ts @@ -35,8 +35,6 @@ export function updateAppRole( user.roleId = roles.BUILTIN_ROLE_IDS.ADMIN } else if (!user.roleId && !user?.userGroups?.length) { user.roleId = roles.BUILTIN_ROLE_IDS.PUBLIC - } else if (user?.userGroups?.length) { - user.roleId = undefined } delete user.roles diff --git a/packages/server/yarn.lock b/packages/server/yarn.lock index 1f8a071df9..84913ada03 100644 --- a/packages/server/yarn.lock +++ b/packages/server/yarn.lock @@ -1278,14 +1278,14 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@2.3.21-alpha.2": - version "2.3.21-alpha.2" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.3.21-alpha.2.tgz#474a2f19a0aee2362c442710ca74d06208009f8d" - integrity sha512-66N1Xtr4WeVbxOZs+5clRMcdDUb3CvM45v63LA2x+Zck0ghzy8tTxfcgBVslB7O36GMFqNJ65TBTOB7CaGjeyw== +"@budibase/backend-core@2.4.3": + version "2.4.3" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.4.3.tgz#e1d1cbf4dc27ed78a82aed7523ee0ab012ad8ecc" + integrity sha512-230oKJPpsMWuM0R82B2HB57/1z/jMqhyNNvxZ5XQSozX/qKmcWzFtvcXIp/UIHwe4s/Bq9PCc0imia8EasrAmg== dependencies: "@budibase/nano" "10.1.2" "@budibase/pouchdb-replication-stream" "1.2.10" - "@budibase/types" "2.3.21-alpha.2" + "@budibase/types" "^2.4.3" "@shopify/jest-koa-mocks" "5.0.1" "@techpass/passport-openidconnect" "0.3.2" aws-cloudfront-sign "2.2.0" @@ -1417,14 +1417,14 @@ pouchdb-promise "^6.0.4" through2 "^2.0.0" -"@budibase/pro@2.3.21-alpha.2": - version "2.3.21-alpha.2" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.3.21-alpha.2.tgz#e00642bbf40d26a25a5af6cbd63c77506a01bcc0" - integrity sha512-UczIW3NIs3zR7abfiFXwOJ6rh2WvnTUNbduk77HPQDy/zPSTsqUSs/wnewZa3qyPdfStrTVt9ZL1gtX1IoZccw== +"@budibase/pro@2.4.3": + version "2.4.3" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.4.3.tgz#4bc1c21d25573d562960f372d21564e782ab7078" + integrity sha512-MKbpEW8zXZ3yrU6kz0wt5auNWibfLRDKMOvh/epmJcrirtrtFboij5VZ+kt+A7KD5cmNJKCKYdfrJQjz46cf+w== dependencies: - "@budibase/backend-core" "2.3.21-alpha.2" + "@budibase/backend-core" "2.4.3" "@budibase/string-templates" "2.3.20" - "@budibase/types" "2.3.21-alpha.2" + "@budibase/types" "2.4.3" "@koa/router" "8.0.8" bull "4.10.1" joi "17.6.0" @@ -1463,10 +1463,10 @@ lodash "^4.17.20" vm2 "^3.9.4" -"@budibase/types@2.3.21-alpha.2": - version "2.3.21-alpha.2" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.3.21-alpha.2.tgz#1d9e6dfc839fdde9d3801cfbdeedb2f49ded146d" - integrity sha512-tlNT5qd9+2pNl1WkLGeUFOb/2QiO6Ny/tWzALP9nmKRhVgEuwzGAbj/HixG3TjpzhOIQZAMD4+t19GDqlVecug== +"@budibase/types@2.4.3", "@budibase/types@^2.4.3": + version "2.4.3" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.4.3.tgz#7990ea96b97d0237254a75365c115940f076bdaf" + integrity sha512-mKMa7IV3JF9OV8K3A2JEABhPXNMy9yQ65XP+Bf8hb0oG1T9DApMsEX+6gIBwQHSs2F2zCMKjtQ0rMyk7mFewQg== "@bull-board/api@3.7.0": version "3.7.0" diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index 1819a50dce..30ea9c0087 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "2.3.21-alpha.2", + "version": "2.4.3", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/types/package.json b/packages/types/package.json index 6d3a7da982..13381ebd56 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/types", - "version": "2.3.21-alpha.2", + "version": "2.4.3", "description": "Budibase types", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/worker/package.json b/packages/worker/package.json index e818906d55..d9f0c5be24 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "2.3.21-alpha.2", + "version": "2.4.3", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -36,10 +36,10 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "2.3.21-alpha.2", - "@budibase/pro": "2.3.21-alpha.2", - "@budibase/string-templates": "2.3.21-alpha.2", - "@budibase/types": "2.3.21-alpha.2", + "@budibase/backend-core": "^2.4.3", + "@budibase/pro": "2.4.3", + "@budibase/string-templates": "^2.4.3", + "@budibase/types": "^2.4.3", "@koa/router": "8.0.8", "@sentry/node": "6.17.7", "@techpass/passport-openidconnect": "0.3.2", diff --git a/packages/worker/src/api/controllers/global/users.ts b/packages/worker/src/api/controllers/global/users.ts index d68e726e71..921f99fa31 100644 --- a/packages/worker/src/api/controllers/global/users.ts +++ b/packages/worker/src/api/controllers/global/users.ts @@ -341,7 +341,7 @@ export const getUserInvites = async (ctx: any) => { let invites try { // Restricted to the currently authenticated tenant - invites = await getInviteCodes([ctx.user.tenantId]) + invites = await getInviteCodes() } catch (e) { ctx.throw(400, "There was a problem fetching invites") } diff --git a/packages/worker/src/utilities/redis.ts b/packages/worker/src/utilities/redis.ts index 7b3f251c0e..d77e44cd9f 100644 --- a/packages/worker/src/utilities/redis.ts +++ b/packages/worker/src/utilities/redis.ts @@ -1,4 +1,5 @@ -import { redis, utils } from "@budibase/backend-core" +import { redis, utils, tenancy } from "@budibase/backend-core" +import env from "../environment" function getExpirySecondsForDB(db: string) { switch (db) { @@ -129,10 +130,9 @@ export async function checkInviteCode( } /** - Get all currently available user invitations. - @return {Object[]} A list of all objects containing invite metadata + Get all currently available user invitations for the current tenant. **/ -export async function getInviteCodes(tenantIds?: string[]) { +export async function getInviteCodes() { const client = await getClient(redis.utils.Databases.INVITATIONS) const invites: any[] = await client.scan() @@ -142,12 +142,9 @@ export async function getInviteCodes(tenantIds?: string[]) { code: invite.key, } }) - return results.reduce((acc, invite) => { - if (tenantIds?.length && tenantIds.includes(invite.info.tenantId)) { - acc.push(invite) - } else { - acc.push(invite) - } - return acc - }, []) + if (!env.MULTI_TENANCY) { + return results + } + const tenantId = tenancy.getTenantId() + return results.filter(invite => tenantId === invite.info.tenantId) } diff --git a/packages/worker/yarn.lock b/packages/worker/yarn.lock index 468aa4c89d..ed3316b722 100644 --- a/packages/worker/yarn.lock +++ b/packages/worker/yarn.lock @@ -475,14 +475,14 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@2.3.21-alpha.2": - version "2.3.21-alpha.2" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.3.21-alpha.2.tgz#474a2f19a0aee2362c442710ca74d06208009f8d" - integrity sha512-66N1Xtr4WeVbxOZs+5clRMcdDUb3CvM45v63LA2x+Zck0ghzy8tTxfcgBVslB7O36GMFqNJ65TBTOB7CaGjeyw== +"@budibase/backend-core@2.4.3": + version "2.4.3" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.4.3.tgz#e1d1cbf4dc27ed78a82aed7523ee0ab012ad8ecc" + integrity sha512-230oKJPpsMWuM0R82B2HB57/1z/jMqhyNNvxZ5XQSozX/qKmcWzFtvcXIp/UIHwe4s/Bq9PCc0imia8EasrAmg== dependencies: "@budibase/nano" "10.1.2" "@budibase/pouchdb-replication-stream" "1.2.10" - "@budibase/types" "2.3.21-alpha.2" + "@budibase/types" "^2.4.3" "@shopify/jest-koa-mocks" "5.0.1" "@techpass/passport-openidconnect" "0.3.2" aws-cloudfront-sign "2.2.0" @@ -564,14 +564,14 @@ pouchdb-promise "^6.0.4" through2 "^2.0.0" -"@budibase/pro@2.3.21-alpha.2": - version "2.3.21-alpha.2" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.3.21-alpha.2.tgz#e00642bbf40d26a25a5af6cbd63c77506a01bcc0" - integrity sha512-UczIW3NIs3zR7abfiFXwOJ6rh2WvnTUNbduk77HPQDy/zPSTsqUSs/wnewZa3qyPdfStrTVt9ZL1gtX1IoZccw== +"@budibase/pro@2.4.3": + version "2.4.3" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.4.3.tgz#4bc1c21d25573d562960f372d21564e782ab7078" + integrity sha512-MKbpEW8zXZ3yrU6kz0wt5auNWibfLRDKMOvh/epmJcrirtrtFboij5VZ+kt+A7KD5cmNJKCKYdfrJQjz46cf+w== dependencies: - "@budibase/backend-core" "2.3.21-alpha.2" + "@budibase/backend-core" "2.4.3" "@budibase/string-templates" "2.3.20" - "@budibase/types" "2.3.21-alpha.2" + "@budibase/types" "2.4.3" "@koa/router" "8.0.8" bull "4.10.1" joi "17.6.0" @@ -592,10 +592,10 @@ lodash "^4.17.20" vm2 "^3.9.4" -"@budibase/types@2.3.21-alpha.2": - version "2.3.21-alpha.2" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.3.21-alpha.2.tgz#1d9e6dfc839fdde9d3801cfbdeedb2f49ded146d" - integrity sha512-tlNT5qd9+2pNl1WkLGeUFOb/2QiO6Ny/tWzALP9nmKRhVgEuwzGAbj/HixG3TjpzhOIQZAMD4+t19GDqlVecug== +"@budibase/types@2.4.3", "@budibase/types@^2.4.3": + version "2.4.3" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.4.3.tgz#7990ea96b97d0237254a75365c115940f076bdaf" + integrity sha512-mKMa7IV3JF9OV8K3A2JEABhPXNMy9yQ65XP+Bf8hb0oG1T9DApMsEX+6gIBwQHSs2F2zCMKjtQ0rMyk7mFewQg== "@cspotcode/source-map-support@^0.8.0": version "0.8.1"