From d290e3cc0d4f2c45943ca5d9c29afc4f8235df29 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Fri, 28 Jul 2023 17:53:11 +0200 Subject: [PATCH 001/116] Revert "Don't modify production pipelines" This reverts commit 7c48b9f538ff290fb17054910839a177f6340cf7. --- .github/workflows/release-master.yml | 2 +- .github/workflows/release-selfhost.yml | 4 ++-- .github/workflows/release-singleimage.yml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release-master.yml b/.github/workflows/release-master.yml index 7f8b8f1d55..db2723cdfe 100644 --- a/.github/workflows/release-master.yml +++ b/.github/workflows/release-master.yml @@ -36,7 +36,7 @@ jobs: - uses: actions/setup-node@v1 with: - node-version: 14.x + node-version: 18.x - run: yarn install --frozen-lockfile - name: Update versions diff --git a/.github/workflows/release-selfhost.yml b/.github/workflows/release-selfhost.yml index 39ee812726..ddfe202465 100644 --- a/.github/workflows/release-selfhost.yml +++ b/.github/workflows/release-selfhost.yml @@ -28,10 +28,10 @@ jobs: exit 1 fi - - name: Use Node.js 14.x + - name: Use Node.js 18.x uses: actions/setup-node@v1 with: - node-version: 14.x + node-version: 18.x - name: Get the latest budibase release version id: version diff --git a/.github/workflows/release-singleimage.yml b/.github/workflows/release-singleimage.yml index 5b75c20d29..25be68feb0 100644 --- a/.github/workflows/release-singleimage.yml +++ b/.github/workflows/release-singleimage.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node-version: [14.x] + node-version: [18.x] steps: - name: Fail if not a tag run: | From 17980d4bcc57f2aaa444cdb64583b5fbc7d45381 Mon Sep 17 00:00:00 2001 From: jvcalderon Date: Mon, 31 Jul 2023 16:09:45 +0200 Subject: [PATCH 002/116] Merge account-portal-auth-api-testing --- packages/backend-core/src/constants/misc.ts | 2 + qa-core/src/account-api/api/apis/AuthAPI.ts | 44 ++++++++++++++++++ .../accounts/accounts.cloud.internal.spec.ts | 5 +- .../tests/accounts/accounts.cloud.spec.ts | 5 +- .../account-api/tests/auth/auth.cloud.spec.ts | 46 +++++++++++++++++++ yarn.lock | 20 ++------ 6 files changed, 104 insertions(+), 18 deletions(-) create mode 100644 qa-core/src/account-api/tests/auth/auth.cloud.spec.ts diff --git a/packages/backend-core/src/constants/misc.ts b/packages/backend-core/src/constants/misc.ts index 0c68798164..8ef34196ed 100644 --- a/packages/backend-core/src/constants/misc.ts +++ b/packages/backend-core/src/constants/misc.ts @@ -22,6 +22,8 @@ export enum Header { TENANT_ID = "x-budibase-tenant-id", VERIFICATION_CODE = "x-budibase-verification-code", RETURN_VERIFICATION_CODE = "x-budibase-return-verification-code", + RESET_PASSWORD_CODE = "x-budibase-reset-password-code", + RETURN_RESET_PASSWORD_CODE = "x-budibase-return-reset-password-code", TOKEN = "x-budibase-token", CSRF_TOKEN = "x-csrf-token", CORRELATION_ID = "x-budibase-correlation-id", diff --git a/qa-core/src/account-api/api/apis/AuthAPI.ts b/qa-core/src/account-api/api/apis/AuthAPI.ts index 50345c891b..ba5a73f586 100644 --- a/qa-core/src/account-api/api/apis/AuthAPI.ts +++ b/qa-core/src/account-api/api/apis/AuthAPI.ts @@ -2,6 +2,7 @@ import { Response } from "node-fetch" import AccountInternalAPIClient from "../AccountInternalAPIClient" import { APIRequestOpts } from "../../../types" import BaseAPI from "./BaseAPI" +import { Header } from "@budibase/backend-core" export default class AuthAPI extends BaseAPI { client: AccountInternalAPIClient @@ -27,4 +28,47 @@ export default class AuthAPI extends BaseAPI { return [res, cookie] }, opts) } + + async logout(opts: APIRequestOpts = { status: 200 }) { + return this.doRequest(() => { + return this.client.post(`/api/auth/logout`) + }, opts) + } + + async resetPassword( + email: string, + opts: APIRequestOpts = { status: 200 } + ): Promise<[Response, string]> { + return this.doRequest(async () => { + const [response] = await this.client.post(`/api/auth/reset`, { + body: { email }, + headers: { + [Header.RETURN_RESET_PASSWORD_CODE]: "1", + }, + }) + const code = response.headers.get(Header.RESET_PASSWORD_CODE) + return [response, code] + }, opts) + } + + async resetPasswordUpdate( + resetCode: string, + password: string, + opts: APIRequestOpts = { status: 200 } + ) { + return this.doRequest(() => { + return this.client.post(`/api/auth/reset/update`, { + body: { + resetCode: resetCode, + password: password, + }, + }) + }, opts) + } + + async self(opts: APIRequestOpts = { status: 200 }) { + return this.doRequest(() => { + return this.client.get(`/api/auth/self`) + }, opts) + } } diff --git a/qa-core/src/account-api/tests/accounts/accounts.cloud.internal.spec.ts b/qa-core/src/account-api/tests/accounts/accounts.cloud.internal.spec.ts index 6c1d7eacac..56f9110322 100644 --- a/qa-core/src/account-api/tests/accounts/accounts.cloud.internal.spec.ts +++ b/qa-core/src/account-api/tests/accounts/accounts.cloud.internal.spec.ts @@ -1,6 +1,7 @@ import TestConfiguration from "../../config/TestConfiguration" import * as fixtures from "../../fixtures" import { generator } from "../../../shared" +import { Hosting } from "@budibase/types" describe("Account Internal Operations", () => { const config = new TestConfiguration() @@ -20,7 +21,9 @@ describe("Account Internal Operations", () => { // Create new account const [_, account] = await config.api.accounts.create({ - ...fixtures.accounts.generateAccount(), + ...fixtures.accounts.generateAccount({ + hosting: Hosting.CLOUD, + }), }) // New account can be deleted diff --git a/qa-core/src/account-api/tests/accounts/accounts.cloud.spec.ts b/qa-core/src/account-api/tests/accounts/accounts.cloud.spec.ts index e3a4d4eacf..9455bf4b19 100644 --- a/qa-core/src/account-api/tests/accounts/accounts.cloud.spec.ts +++ b/qa-core/src/account-api/tests/accounts/accounts.cloud.spec.ts @@ -1,6 +1,7 @@ import TestConfiguration from "../../config/TestConfiguration" import * as fixtures from "../../fixtures" import { generator } from "../../../shared" +import { Hosting } from "@budibase/types" describe("Accounts", () => { const config = new TestConfiguration() @@ -16,7 +17,9 @@ describe("Accounts", () => { it("performs signup and deletion flow", async () => { await config.doInNewState(async () => { // Create account - const createAccountRequest = fixtures.accounts.generateAccount() + const createAccountRequest = fixtures.accounts.generateAccount({ + hosting: Hosting.CLOUD, + }) const email = createAccountRequest.email const tenantId = createAccountRequest.tenantId diff --git a/qa-core/src/account-api/tests/auth/auth.cloud.spec.ts b/qa-core/src/account-api/tests/auth/auth.cloud.spec.ts new file mode 100644 index 0000000000..3a5e291063 --- /dev/null +++ b/qa-core/src/account-api/tests/auth/auth.cloud.spec.ts @@ -0,0 +1,46 @@ +import TestConfiguration from "../../config/TestConfiguration" +import * as fixtures from "../../fixtures" +import { generator } from "../../../shared" +import { Hosting } from "@budibase/types" + +describe("Accounts", () => { + const config = new TestConfiguration() + + beforeAll(async () => { + await config.beforeAll() + }) + + afterAll(async () => { + await config.afterAll() + }) + + it("performs password reset flow", async () => { + // Create account + const createAccountRequest = fixtures.accounts.generateAccount({ + hosting: Hosting.CLOUD, + }) + await config.api.accounts.create(createAccountRequest, { autoVerify: true }) + + // Request password reset to get code + const [_, code] = await config.api.auth.resetPassword( + createAccountRequest.email + ) + + // Change password using code + const password = generator.string() + await config.api.auth.resetPasswordUpdate(code, password) + + // Login using the new password + await config.api.auth.login(createAccountRequest.email, password) + + // Logout of account + await config.api.auth.logout() + + // Cannot log in using old password + await config.api.auth.login( + createAccountRequest.email, + createAccountRequest.password, + { status: 403 } + ) + }) +}) diff --git a/yarn.lock b/yarn.lock index d1f22e7699..ef3e9acbc4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -15494,10 +15494,10 @@ jest-snapshot@^29.6.2: pretty-format "^29.6.2" semver "^7.5.3" -jest-util@^29.0.0: - version "29.6.1" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.6.1.tgz#c9e29a87a6edbf1e39e6dee2b4689b8a146679cb" - integrity sha512-NRFCcjc+/uO3ijUVyNOQJluf8PtGCe/W6cix36+M3cTFgiYqFOOW5MgN4JOOcvbUhcKTYVd1CvHz/LWi8d16Mg== +jest-util@^29.0.0, jest-util@^29.6.2: + version "29.6.2" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.6.2.tgz#8a052df8fff2eebe446769fd88814521a517664d" + integrity sha512-3eX1qb6L88lJNCFlEADKOkjpXJQyZRiavX1INZ4tRnrBVr2COd3RgcTLyUiEXMNBlDU/cgYq6taUS0fExrWW4w== dependencies: "@jest/types" "^29.6.1" "@types/node" "*" @@ -15518,18 +15518,6 @@ jest-util@^29.4.3: graceful-fs "^4.2.9" picomatch "^2.2.3" -jest-util@^29.6.2: - version "29.6.2" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.6.2.tgz#8a052df8fff2eebe446769fd88814521a517664d" - integrity sha512-3eX1qb6L88lJNCFlEADKOkjpXJQyZRiavX1INZ4tRnrBVr2COd3RgcTLyUiEXMNBlDU/cgYq6taUS0fExrWW4w== - dependencies: - "@jest/types" "^29.6.1" - "@types/node" "*" - chalk "^4.0.0" - ci-info "^3.2.0" - graceful-fs "^4.2.9" - picomatch "^2.2.3" - jest-validate@^29.6.2: version "29.6.2" resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-29.6.2.tgz#25d972af35b2415b83b1373baf1a47bb266c1082" From fe9dded2ab96150b25c64f3e99126d0412f5b6a5 Mon Sep 17 00:00:00 2001 From: Mitch-Budibase Date: Mon, 31 Jul 2023 17:45:45 +0100 Subject: [PATCH 003/116] Updating Describe text It previously said 'Accounts' but 'Password Management' is more accurate for the test --- qa-core/src/account-api/tests/auth/auth.cloud.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qa-core/src/account-api/tests/auth/auth.cloud.spec.ts b/qa-core/src/account-api/tests/auth/auth.cloud.spec.ts index 3a5e291063..075a52bef4 100644 --- a/qa-core/src/account-api/tests/auth/auth.cloud.spec.ts +++ b/qa-core/src/account-api/tests/auth/auth.cloud.spec.ts @@ -3,7 +3,7 @@ import * as fixtures from "../../fixtures" import { generator } from "../../../shared" import { Hosting } from "@budibase/types" -describe("Accounts", () => { +describe("Password Management", () => { const config = new TestConfiguration() beforeAll(async () => { From 2e827bcc8e9ce8ba127ee399195325e6451f0e6b Mon Sep 17 00:00:00 2001 From: Mitch-Budibase Date: Mon, 31 Jul 2023 18:01:40 +0100 Subject: [PATCH 004/116] Moving 'self' function from AuthAPI to AccountAPI This function will be used within Account testing --- qa-core/src/account-api/api/apis/AccountAPI.ts | 6 ++++++ qa-core/src/account-api/api/apis/AuthAPI.ts | 6 ------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/qa-core/src/account-api/api/apis/AccountAPI.ts b/qa-core/src/account-api/api/apis/AccountAPI.ts index 33e64da7ad..13c7e1709d 100644 --- a/qa-core/src/account-api/api/apis/AccountAPI.ts +++ b/qa-core/src/account-api/api/apis/AccountAPI.ts @@ -114,4 +114,10 @@ export default class AccountAPI extends BaseAPI { }) }, opts) } + + async self(opts: APIRequestOpts = { status: 200 }) { + return this.doRequest(() => { + return this.client.get(`/api/auth/self`) + }, opts) + } } diff --git a/qa-core/src/account-api/api/apis/AuthAPI.ts b/qa-core/src/account-api/api/apis/AuthAPI.ts index ba5a73f586..304b13db57 100644 --- a/qa-core/src/account-api/api/apis/AuthAPI.ts +++ b/qa-core/src/account-api/api/apis/AuthAPI.ts @@ -65,10 +65,4 @@ export default class AuthAPI extends BaseAPI { }) }, opts) } - - async self(opts: APIRequestOpts = { status: 200 }) { - return this.doRequest(() => { - return this.client.get(`/api/auth/self`) - }, opts) - } } From 3c3dd9c95a7e64c0ace24ae69290b2cd3d8ef8d5 Mon Sep 17 00:00:00 2001 From: Mitch-Budibase Date: Tue, 1 Aug 2023 16:46:11 +0100 Subject: [PATCH 005/116] Updating test - performs signup and deletion flow Including two more steps within this test. - Verify the self response is unauthorized - Verify the self response matches the account This will cover the '/api/auth/self' endpoint --- .../src/account-api/tests/accounts/accounts.cloud.spec.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/qa-core/src/account-api/tests/accounts/accounts.cloud.spec.ts b/qa-core/src/account-api/tests/accounts/accounts.cloud.spec.ts index 9455bf4b19..a0b5198f03 100644 --- a/qa-core/src/account-api/tests/accounts/accounts.cloud.spec.ts +++ b/qa-core/src/account-api/tests/accounts/accounts.cloud.spec.ts @@ -45,9 +45,15 @@ describe("Accounts", () => { // Send the verification request await config.accountsApi.accounts.verifyAccount(code!) + // Verify self response is unauthorized + await config.api.accounts.self({ status: 403 }) + // Can now log in to the account await config.loginAsAccount(createAccountRequest) + // Verify self response matches account + await config.api.accounts.self() + // Delete account await config.api.accounts.deleteCurrentAccount() From 35d349de9e1e3440a27a13843f590da8c116412c Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Wed, 9 Aug 2023 18:00:44 +0100 Subject: [PATCH 006/116] self host banner --- packages/client/src/components/ClientApp.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/client/src/components/ClientApp.svelte b/packages/client/src/components/ClientApp.svelte index ff9f58691e..8b7646bc61 100644 --- a/packages/client/src/components/ClientApp.svelte +++ b/packages/client/src/components/ClientApp.svelte @@ -206,7 +206,7 @@ {/if} - {#if !$builderStore.inBuilder && licensing.logoEnabled() && $environmentStore.cloud} + {#if !$builderStore.inBuilder && licensing.logoEnabled()} {/if} From 9c5ff69213beae406f58bbd2f0c7f18558593f2d Mon Sep 17 00:00:00 2001 From: melohagan <101575380+melohagan@users.noreply.github.com> Date: Mon, 21 Aug 2023 12:45:26 +0100 Subject: [PATCH 007/116] Return the actual objects (#11570) --- packages/bbui/src/Table/Table.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/bbui/src/Table/Table.svelte b/packages/bbui/src/Table/Table.svelte index 3a86295178..529d1144ee 100644 --- a/packages/bbui/src/Table/Table.svelte +++ b/packages/bbui/src/Table/Table.svelte @@ -215,7 +215,7 @@ const nameA = getDisplayName(a) const nameB = getDisplayName(b) if (orderA !== orderB) { - return orderA < orderB ? orderA : orderB + return orderA < orderB ? a : b } return nameA < nameB ? a : b }) From 27bd653b02753900c58bf59cb387078f9c9fde50 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Mon, 21 Aug 2023 11:45:46 +0000 Subject: [PATCH 008/116] Bump version to 2.9.30 --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index c3c9741bd0..1af0927e16 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.9.29", + "version": "2.9.30", "npmClient": "yarn", "packages": [ "packages/*" From 826255dfe213fccf9dd1b3659091bd111e1328c0 Mon Sep 17 00:00:00 2001 From: Jonny McCullagh Date: Thu, 24 Aug 2023 13:52:17 +0100 Subject: [PATCH 009/116] trigger a feature branch on pull request (#11584) trigger a feature branch on pull request --- .github/workflows/deploy-featurebranch.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/deploy-featurebranch.yml diff --git a/.github/workflows/deploy-featurebranch.yml b/.github/workflows/deploy-featurebranch.yml new file mode 100644 index 0000000000..9057d32c4c --- /dev/null +++ b/.github/workflows/deploy-featurebranch.yml @@ -0,0 +1,19 @@ +name: deploy-featurebranch + +on: + pull_request: + branches: + - develop + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: passeidireto/trigger-external-workflow-action@main + env: + BRANCH: ${{ github.head_ref }} + with: + repository: budibase/budibase-deploys + event: featurebranch-qa-deploy + github_pat: ${{ secrets.GH_ACCESS_TOKEN }} From fec20e526e4a2b82652787df8b0a50a6046f4427 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Thu, 24 Aug 2023 12:52:39 +0000 Subject: [PATCH 010/116] Bump version to 2.9.31 --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index 1af0927e16..27d07555d4 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.9.30", + "version": "2.9.31", "npmClient": "yarn", "packages": [ "packages/*" From ee058a4c26a1f2031190a78dfc80bd012141918a Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Thu, 24 Aug 2023 14:05:10 +0000 Subject: [PATCH 011/116] Bump version to 2.9.32 --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index 27d07555d4..3d6bf559b8 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.9.31", + "version": "2.9.32", "npmClient": "yarn", "packages": [ "packages/*" From 2eb78fb23dd847fc66373b7489b28772f69b483d Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Thu, 24 Aug 2023 17:12:48 +0100 Subject: [PATCH 012/116] don't recreate secret after first deploy, bump vm2 deps --- charts/budibase/templates/secrets.yaml | 3 +++ packages/server/package.json | 2 +- packages/string-templates/package.json | 2 +- yarn.lock | 16 ++++------------ 4 files changed, 9 insertions(+), 14 deletions(-) diff --git a/charts/budibase/templates/secrets.yaml b/charts/budibase/templates/secrets.yaml index 1c0a914ed3..e42a276f1d 100644 --- a/charts/budibase/templates/secrets.yaml +++ b/charts/budibase/templates/secrets.yaml @@ -1,4 +1,6 @@ {{- if .Values.globals.createSecrets -}} +{{- $existingSecret := lookup "v1" "Secret" .Release.Namespace (include "budibase.fullname" .) -}} +{{- if not $existingSecret -}} apiVersion: v1 kind: Secret metadata: @@ -15,3 +17,4 @@ data: objectStoreAccess: {{ template "budibase.defaultsecret" .Values.services.objectStore.accessKey }} objectStoreSecret: {{ template "budibase.defaultsecret" .Values.services.objectStore.secretKey }} {{- end -}} +{{- end -}} \ No newline at end of file diff --git a/packages/server/package.json b/packages/server/package.json index 7d0d8f5feb..c2eea18068 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -122,7 +122,7 @@ "to-json-schema": "0.2.5", "uuid": "3.3.2", "validate.js": "0.13.1", - "vm2": "3.9.17", + "vm2": "^3.9.19", "worker-farm": "1.7.0", "xml2js": "0.5.0", "yargs": "13.2.4" diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index 4dc4c17ad8..242edc83a9 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -30,7 +30,7 @@ "handlebars": "^4.7.6", "handlebars-utils": "^1.0.6", "lodash": "^4.17.20", - "vm2": "^3.9.15" + "vm2": "^3.9.19" }, "devDependencies": { "@rollup/plugin-commonjs": "^17.1.0", diff --git a/yarn.lock b/yarn.lock index 827c94a176..a4f0e91e31 100644 --- a/yarn.lock +++ b/yarn.lock @@ -24984,18 +24984,10 @@ vlq@^0.2.2: resolved "https://registry.yarnpkg.com/vlq/-/vlq-0.2.3.tgz#8f3e4328cf63b1540c0d67e1b2778386f8975b26" integrity sha512-DRibZL6DsNhIgYQ+wNdWDL2SL3bKPlVrRiBqV5yuMm++op8W4kGFtaQfCs4KEJn0wBZcHVHJ3eoywX8983k1ow== -vm2@3.9.17: - version "3.9.17" - resolved "https://registry.yarnpkg.com/vm2/-/vm2-3.9.17.tgz#251b165ff8a0e034942b5181057305e39570aeab" - integrity sha512-AqwtCnZ/ERcX+AVj9vUsphY56YANXxRuqMb7GsDtAr0m0PcQX3u0Aj3KWiXM0YAHy7i6JEeHrwOnwXbGYgRpAw== - dependencies: - acorn "^8.7.0" - acorn-walk "^8.2.0" - -vm2@^3.9.15: - version "3.9.16" - resolved "https://registry.yarnpkg.com/vm2/-/vm2-3.9.16.tgz#0fbc2a265f7bf8b837cea6f4a908f88a3f93b8e6" - integrity sha512-3T9LscojNTxdOyG+e8gFeyBXkMlOBYDoF6dqZbj+MPVHi9x10UfiTAJIobuchRCp3QvC+inybTbMJIUrLsig0w== +vm2@^3.9.19: + version "3.9.19" + resolved "https://registry.yarnpkg.com/vm2/-/vm2-3.9.19.tgz#be1e1d7a106122c6c492b4d51c2e8b93d3ed6a4a" + integrity sha512-J637XF0DHDMV57R6JyVsTak7nIL8gy5KH4r1HiwWLf/4GBbb5MKL5y7LpmF4A8E2nR6XmzpmMFQ7V7ppPTmUQg== dependencies: acorn "^8.7.0" acorn-walk "^8.2.0" From 3265042025c5e2471b8e223491dc90a8b34814eb Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Tue, 29 Aug 2023 14:27:39 +0100 Subject: [PATCH 013/116] Revert "Merge branch 'develop' into master" This reverts commit 99adc2039b9ed97a605a6a3885f29e7a48cfd328, reversing changes made to fec20e526e4a2b82652787df8b0a50a6046f4427. --- .github/workflows/budibase_ci.yml | 114 +-- .../workflows/check_unreleased_changes.yml | 29 - .github/workflows/release-develop.yml | 2 +- .nvmrc | 2 +- .tool-versions | 4 +- .vscode/launch.json | 71 +- docs/CONTRIBUTING.md | 2 +- hosting/{tests => dependencies}/Dockerfile | 0 hosting/{tests => dependencies}/README.md | 0 hosting/{tests => dependencies}/runner.sh | 0 hosting/docker-compose.test.yaml | 47 ++ hosting/single/Dockerfile | 4 +- jestTestcontainersConfigGenerator.js | 17 +- package.json | 4 +- packages/backend-core/src/cache/user.ts | 14 - packages/backend-core/src/db/lucene.ts | 26 +- .../backend-core/src/db/tests/lucene.spec.ts | 72 +- .../src/{features => featureFlags}/index.ts | 1 - .../tests/featureFlags.spec.ts | 0 .../backend-core/src/features/installation.ts | 17 - packages/backend-core/src/index.ts | 3 +- .../src/middleware/builderOnly.ts | 11 +- .../src/middleware/builderOrAdmin.ts | 11 +- .../backend-core/src/security/permissions.ts | 4 + packages/backend-core/src/users/db.ts | 38 +- .../tests/core/utilities/mocks/licenses.ts | 8 - .../core/utilities/testContainerUtils.ts | 21 +- .../bbui/src/Actions/position_dropdown.js | 3 +- .../bbui/src/ColorPicker/ColorPicker.svelte | 75 +- packages/bbui/src/Popover/Popover.svelte | 8 - packages/builder/src/builderStore/index.js | 10 +- .../src/builderStore/store/frontend.js | 29 +- .../DataTable/modals/CreateEditColumn.svelte | 67 +- .../commandPalette/CommandPalette.svelte | 4 +- .../src/components/common/NavItem.svelte | 17 +- .../src/components/design/Panel.svelte | 9 +- .../actions/ChangeFormStep.svelte | 10 +- .../controls/ColumnEditor/CellDrawer.svelte | 2 + .../controls/FilterEditor/FilterDrawer.svelte | 41 +- packages/builder/src/helpers/urlStateSync.js | 5 - .../_components/Navigation/index.svelte | 225 ------ .../_components/Screen/ThemePanel.svelte | 78 --- .../_components/Screen/index.svelte | 51 -- .../[screenId]/[componentId]/_layout.svelte | 52 -- .../[screenId]/[componentId]/index.svelte | 1 - .../[screenId]/_components/AppPanel.svelte | 47 +- .../[screenId]/_components/AppPreview.svelte | 57 +- .../_components/ComponentList/index.svelte | 163 ----- .../[screenId]/_components/LeftPanel.svelte | 21 - .../_components/ScreenList/index.svelte | 304 -------- .../design/[screenId]/_fallback.svelte | 5 + .../design/[screenId]/_layout.svelte | 78 ++- .../navigation}/ComponentDropdownMenu.svelte | 0 .../navigation}/ComponentKeyHandler.svelte | 20 +- .../navigation/ComponentListPanel.svelte | 90 +++ .../navigation}/ComponentScrollWrapper.svelte | 6 +- .../navigation}/ComponentTree.svelte | 3 +- .../navigation}/DNDPositionIndicator.svelte | 0 .../navigation}/ScreenslotDropdownMenu.svelte | 0 .../_components/navigation}/dndStore.js | 0 .../settings}/ComponentInfoSection.svelte | 0 .../settings}/ComponentSettingsPanel.svelte | 0 .../settings}/ComponentSettingsSection.svelte | 0 .../settings}/ConditionalUIDrawer.svelte | 0 .../settings}/ConditionalUISection.svelte | 0 .../settings}/CustomStylesSection.svelte | 0 .../settings}/DesignSection.svelte | 0 .../_components/settings}/StyleSection.svelte | 0 .../_components/settings}/componentStyles.js | 0 .../components/[componentId]/_layout.svelte | 41 ++ .../components/[componentId]/index.svelte | 4 + .../new/_components/NewComponentPanel.svelte | 4 - .../new/_components/componentStructure.json | 0 .../[componentId]/new/index.svelte | 0 .../design/[screenId]/components/index.svelte | 18 + .../design/[screenId]/index.svelte | 3 +- .../_components/LayoutDropdownMenu.svelte | 41 ++ .../_components/LayoutListPanel.svelte | 29 + .../_components/LayoutSettingsPanel.svelte | 53 ++ .../layouts/[layoutId]/_layout.svelte | 20 + .../layouts/[layoutId]/index.svelte | 7 + .../design/[screenId]/layouts/_layout.svelte | 12 + .../design/[screenId]/layouts/index.svelte | 12 + .../_components/NavigationInfoPanel.svelte | 33 + .../_components/NavigationLinksDrawer.svelte} | 0 .../_components/NavigationLinksEditor.svelte} | 10 +- .../NavigationSettingsPanel.svelte | 110 +++ .../design/[screenId]/navigation/index.svelte | 7 + .../_components}/RoleIndicator.svelte | 8 +- .../_components/ScreenDropdownMenu.svelte} | 2 +- .../_components/ScreenListPanel.svelte | 75 ++ .../_components/ScreenSettingsPanel.svelte} | 68 +- .../design/[screenId]/screens/index.svelte | 12 + .../_components}/AppThemeSelect.svelte | 0 .../_components}/ButtonRoundnessSelect.svelte | 0 .../theme/_components/ThemeInfoPanel.svelte | 12 + .../_components/ThemeSettingsPanel.svelte | 55 ++ .../design/[screenId]/theme/index.svelte | 7 + .../{NewScreen => }/CreateScreenModal.svelte | 15 +- .../{NewScreen => }/DatasourceModal.svelte | 0 .../design/_components/NewScreen/index.svelte | 105 --- .../{NewScreen => }/ScreenRoleModal.svelte | 0 .../{_components/NewScreen => }/blank.png | Bin .../app/[application]/design/new.svelte | 113 ++- .../{_components/NewScreen => }/table.png | Bin .../_components/StatusRenderer.svelte | 10 +- .../settings/automation-history/index.svelte | 4 +- packages/cli/tsconfig.build.json | 16 +- packages/client/manifest.json | 9 - .../client/src/components/Component.svelte | 12 +- packages/client/src/components/Screen.svelte | 2 +- .../client/src/components/app/Layout.svelte | 37 +- .../src/components/app/forms/Form.svelte | 11 +- .../src/components/app/forms/InnerForm.svelte | 2 +- .../src/components/preview/SettingsBar.svelte | 6 +- packages/client/src/stores/builder.js | 3 + .../grid/layout/NewColumnButton.svelte | 2 +- packages/pro | 2 +- packages/server/Dockerfile | 4 +- packages/server/jest.config.ts | 1 - packages/server/package.json | 17 +- packages/server/scripts/test.sh | 5 +- packages/server/specs/openapi.json | 213 +----- packages/server/specs/openapi.yaml | 160 +---- packages/server/specs/resources/index.ts | 2 - packages/server/specs/resources/roles.ts | 65 -- packages/server/specs/resources/user.ts | 8 +- .../server/src/api/controllers/application.ts | 7 +- packages/server/src/api/controllers/auth.ts | 9 +- .../src/api/controllers/deploy/index.ts | 17 +- .../server/src/api/controllers/permission.ts | 27 +- .../api/controllers/public/applications.ts | 18 +- .../api/controllers/public/mapping/types.ts | 4 - .../src/api/controllers/public/queries.ts | 6 +- .../src/api/controllers/public/roles.ts | 33 - .../server/src/api/controllers/public/rows.ts | 13 +- .../src/api/controllers/public/tables.ts | 13 +- .../src/api/controllers/public/users.ts | 30 +- .../server/src/api/controllers/query/index.ts | 4 +- .../src/api/controllers/row/external.ts | 22 +- .../server/src/api/controllers/row/index.ts | 7 +- .../src/api/controllers/row/internal.ts | 23 +- .../server/src/api/controllers/row/utils.ts | 17 +- .../server/src/api/controllers/row/views.ts | 78 ++- .../src/api/controllers/table/external.ts | 20 +- .../server/src/api/controllers/table/index.ts | 4 +- .../src/api/controllers/table/internal.ts | 35 +- .../server/src/api/controllers/table/utils.ts | 2 +- .../server/src/api/routes/public/roles.ts | 56 -- .../src/api/routes/public/tests/users.spec.js | 38 + .../src/api/routes/public/tests/users.spec.ts | 126 ---- packages/server/src/api/routes/row.ts | 170 +++-- ...ermissions.spec.ts => permissions.spec.js} | 109 +-- .../server/src/api/routes/tests/role.spec.js | 5 +- .../server/src/api/routes/tests/row.spec.ts | 656 +++++++++--------- .../src/api/routes/tests/viewV2.spec.ts | 18 +- packages/server/src/api/routes/view.ts | 2 +- packages/server/src/app.ts | 129 +++- packages/server/src/automations/index.ts | 4 - .../server/src/automations/steps/queryRows.ts | 17 +- .../tests/{filter.spec.ts => filter.spec.js} | 23 +- packages/server/src/automations/utils.ts | 13 +- packages/server/src/db/utils.ts | 17 +- packages/server/src/definitions/openapi.ts | 113 +-- packages/server/src/environment.ts | 2 - packages/server/src/features.ts | 24 - .../src/integration-test/postgres.spec.ts | 22 +- .../src/integrations/microsoftSqlServer.ts | 12 +- packages/server/src/integrations/mysql.ts | 66 +- packages/server/src/koa.ts | 102 --- packages/server/src/middleware/noViewData.ts | 9 + .../src/middleware/tests/noViewData.spec.ts | 83 +++ .../middleware/tests/trimViewRowInfo.spec.ts | 27 +- .../server/src/middleware/trimViewRowInfo.ts | 33 +- .../server/src/sdk/app/permissions/index.ts | 37 - .../app/permissions/tests/permissions.spec.ts | 52 -- packages/server/src/sdk/app/rows/search.ts | 16 +- .../src/sdk/app/rows/search/external.ts | 3 +- .../src/sdk/app/rows/search/internal.ts | 4 +- .../app/rows/search/tests/external.spec.ts | 11 +- .../app/rows/search/tests/internal.spec.ts | 3 +- packages/server/src/sdk/app/views/index.ts | 49 +- .../src/sdk/app/views/tests/views.spec.ts | 383 ++-------- packages/server/src/sdk/index.ts | 2 - packages/server/src/startup.ts | 5 +- .../src/tests/utilities/TestConfiguration.ts | 16 +- .../server/src/tests/utilities/api/index.ts | 3 - .../src/tests/utilities/api/permission.ts | 52 -- .../server/src/tests/utilities/api/row.ts | 37 +- .../server/src/tests/utilities/api/viewV2.ts | 74 +- packages/server/src/threads/automation.ts | 6 +- packages/server/src/threads/definitions.ts | 6 - packages/server/src/threads/query.ts | 8 +- packages/server/src/utilities/global.ts | 86 ++- packages/server/src/utilities/security.ts | 8 +- packages/server/src/utilities/users.ts | 17 +- .../server/src/utilities/workerRequests.ts | 31 +- packages/shared-core/package.json | 11 - packages/shared-core/src/filters.ts | 97 ++- packages/shared-core/tsconfig.build.json | 2 +- packages/shared-core/tsconfig.json | 6 - packages/types/src/api/web/app/rows.ts | 13 +- packages/types/src/api/web/app/table.ts | 12 +- packages/types/src/api/web/index.ts | 1 - packages/types/src/api/web/searchFilter.ts | 54 -- .../types/src/documents/app/automation.ts | 5 +- packages/types/src/documents/app/view.ts | 7 +- packages/types/src/documents/document.ts | 6 - .../types/src/documents/global/userGroup.ts | 4 - packages/types/src/sdk/datasources.ts | 6 - packages/types/src/sdk/index.ts | 1 - packages/types/src/sdk/licensing/feature.ts | 2 - packages/types/src/sdk/permissions.ts | 1 + packages/types/src/sdk/row.ts | 16 - packages/types/src/sdk/search.ts | 6 - packages/types/tsconfig.build.json | 2 +- packages/worker/Dockerfile | 2 +- packages/worker/package.json | 15 - .../worker/src/api/controllers/global/self.ts | 4 +- .../src/api/controllers/global/users.ts | 8 +- .../routes/global/tests/appBuilder.spec.ts | 4 +- .../src/api/routes/global/tests/scim.spec.ts | 2 - packages/worker/src/environment.ts | 2 - packages/worker/src/features.ts | 13 - packages/worker/src/tests/jestEnv.ts | 2 +- .../validators/dynamodb.integration.spec.ts | 4 +- scripts/build.js | 6 +- yarn.lock | 30 +- 228 files changed, 2643 insertions(+), 4345 deletions(-) delete mode 100644 .github/workflows/check_unreleased_changes.yml rename hosting/{tests => dependencies}/Dockerfile (100%) rename hosting/{tests => dependencies}/README.md (100%) rename hosting/{tests => dependencies}/runner.sh (100%) create mode 100644 hosting/docker-compose.test.yaml rename packages/backend-core/src/{features => featureFlags}/index.ts (98%) rename packages/backend-core/src/{features => featureFlags}/tests/featureFlags.spec.ts (100%) delete mode 100644 packages/backend-core/src/features/installation.ts delete mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_components/Navigation/index.svelte delete mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_components/Screen/ThemePanel.svelte delete mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_components/Screen/index.svelte delete mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_layout.svelte delete mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/index.svelte delete mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/ComponentList/index.svelte delete mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/LeftPanel.svelte delete mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/ScreenList/index.svelte create mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/_fallback.svelte rename packages/builder/src/pages/builder/app/[application]/design/[screenId]/{_components/ComponentList => components/[componentId]/_components/navigation}/ComponentDropdownMenu.svelte (100%) rename packages/builder/src/pages/builder/app/[application]/design/[screenId]/{_components/ComponentList => components/[componentId]/_components/navigation}/ComponentKeyHandler.svelte (90%) create mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/_components/navigation/ComponentListPanel.svelte rename packages/builder/src/pages/builder/app/[application]/design/[screenId]/{_components/ComponentList => components/[componentId]/_components/navigation}/ComponentScrollWrapper.svelte (93%) rename packages/builder/src/pages/builder/app/[application]/design/[screenId]/{_components/ComponentList => components/[componentId]/_components/navigation}/ComponentTree.svelte (98%) rename packages/builder/src/pages/builder/app/[application]/design/[screenId]/{_components/ComponentList => components/[componentId]/_components/navigation}/DNDPositionIndicator.svelte (100%) rename packages/builder/src/pages/builder/app/[application]/design/[screenId]/{_components/ComponentList => components/[componentId]/_components/navigation}/ScreenslotDropdownMenu.svelte (100%) rename packages/builder/src/pages/builder/app/[application]/design/[screenId]/{_components/ComponentList => components/[componentId]/_components/navigation}/dndStore.js (100%) rename packages/builder/src/pages/builder/app/[application]/design/[screenId]/{[componentId]/_components/Component => components/[componentId]/_components/settings}/ComponentInfoSection.svelte (100%) rename packages/builder/src/pages/builder/app/[application]/design/[screenId]/{[componentId]/_components/Component => components/[componentId]/_components/settings}/ComponentSettingsPanel.svelte (100%) rename packages/builder/src/pages/builder/app/[application]/design/[screenId]/{[componentId]/_components/Component => components/[componentId]/_components/settings}/ComponentSettingsSection.svelte (100%) rename packages/builder/src/pages/builder/app/[application]/design/[screenId]/{[componentId]/_components/Component => components/[componentId]/_components/settings}/ConditionalUIDrawer.svelte (100%) rename packages/builder/src/pages/builder/app/[application]/design/[screenId]/{[componentId]/_components/Component => components/[componentId]/_components/settings}/ConditionalUISection.svelte (100%) rename packages/builder/src/pages/builder/app/[application]/design/[screenId]/{[componentId]/_components/Component => components/[componentId]/_components/settings}/CustomStylesSection.svelte (100%) rename packages/builder/src/pages/builder/app/[application]/design/[screenId]/{[componentId]/_components/Component => components/[componentId]/_components/settings}/DesignSection.svelte (100%) rename packages/builder/src/pages/builder/app/[application]/design/[screenId]/{[componentId]/_components/Component => components/[componentId]/_components/settings}/StyleSection.svelte (100%) rename packages/builder/src/pages/builder/app/[application]/design/[screenId]/{[componentId]/_components/Component => components/[componentId]/_components/settings}/componentStyles.js (100%) create mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/_layout.svelte create mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/index.svelte rename packages/builder/src/pages/builder/app/[application]/design/[screenId]/{ => components}/[componentId]/new/_components/NewComponentPanel.svelte (98%) rename packages/builder/src/pages/builder/app/[application]/design/[screenId]/{ => components}/[componentId]/new/_components/componentStructure.json (100%) rename packages/builder/src/pages/builder/app/[application]/design/[screenId]/{ => components}/[componentId]/new/index.svelte (100%) create mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/index.svelte create mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/[layoutId]/_components/LayoutDropdownMenu.svelte create mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/[layoutId]/_components/LayoutListPanel.svelte create mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/[layoutId]/_components/LayoutSettingsPanel.svelte create mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/[layoutId]/_layout.svelte create mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/[layoutId]/index.svelte create mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/_layout.svelte create mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/index.svelte create mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/navigation/_components/NavigationInfoPanel.svelte rename packages/builder/src/pages/builder/app/[application]/design/[screenId]/{[componentId]/_components/Navigation/LinksDrawer.svelte => navigation/_components/NavigationLinksDrawer.svelte} (100%) rename packages/builder/src/pages/builder/app/[application]/design/[screenId]/{[componentId]/_components/Navigation/LinksEditor.svelte => navigation/_components/NavigationLinksEditor.svelte} (75%) create mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/navigation/_components/NavigationSettingsPanel.svelte create mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/navigation/index.svelte rename packages/builder/src/pages/builder/app/[application]/design/[screenId]/{_components/ScreenList => screens/_components}/RoleIndicator.svelte (87%) rename packages/builder/src/pages/builder/app/[application]/design/[screenId]/{_components/ScreenList/DropdownMenu.svelte => screens/_components/ScreenDropdownMenu.svelte} (97%) create mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/screens/_components/ScreenListPanel.svelte rename packages/builder/src/pages/builder/app/[application]/design/[screenId]/{[componentId]/_components/Screen/GeneralPanel.svelte => screens/_components/ScreenSettingsPanel.svelte} (72%) create mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/screens/index.svelte rename packages/builder/src/pages/builder/app/[application]/design/[screenId]/{[componentId]/_components/Screen => theme/_components}/AppThemeSelect.svelte (100%) rename packages/builder/src/pages/builder/app/[application]/design/[screenId]/{[componentId]/_components/Screen => theme/_components}/ButtonRoundnessSelect.svelte (100%) create mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/theme/_components/ThemeInfoPanel.svelte create mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/theme/_components/ThemeSettingsPanel.svelte create mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/theme/index.svelte rename packages/builder/src/pages/builder/app/[application]/design/_components/{NewScreen => }/CreateScreenModal.svelte (94%) rename packages/builder/src/pages/builder/app/[application]/design/_components/{NewScreen => }/DatasourceModal.svelte (100%) delete mode 100644 packages/builder/src/pages/builder/app/[application]/design/_components/NewScreen/index.svelte rename packages/builder/src/pages/builder/app/[application]/design/_components/{NewScreen => }/ScreenRoleModal.svelte (100%) rename packages/builder/src/pages/builder/app/[application]/design/{_components/NewScreen => }/blank.png (100%) rename packages/builder/src/pages/builder/app/[application]/design/{_components/NewScreen => }/table.png (100%) delete mode 100644 packages/server/specs/resources/roles.ts delete mode 100644 packages/server/src/api/controllers/public/roles.ts delete mode 100644 packages/server/src/api/routes/public/roles.ts create mode 100644 packages/server/src/api/routes/public/tests/users.spec.js delete mode 100644 packages/server/src/api/routes/public/tests/users.spec.ts rename packages/server/src/api/routes/tests/{permissions.spec.ts => permissions.spec.js} (57%) rename packages/server/src/automations/tests/{filter.spec.ts => filter.spec.js} (76%) delete mode 100644 packages/server/src/features.ts delete mode 100644 packages/server/src/koa.ts create mode 100644 packages/server/src/middleware/noViewData.ts create mode 100644 packages/server/src/middleware/tests/noViewData.spec.ts delete mode 100644 packages/server/src/sdk/app/permissions/index.ts delete mode 100644 packages/server/src/sdk/app/permissions/tests/permissions.spec.ts delete mode 100644 packages/server/src/tests/utilities/api/permission.ts delete mode 100644 packages/types/src/api/web/searchFilter.ts delete mode 100644 packages/types/src/sdk/row.ts delete mode 100644 packages/worker/src/features.ts diff --git a/.github/workflows/budibase_ci.yml b/.github/workflows/budibase_ci.yml index 3e4b2221d2..9da52f8bc0 100644 --- a/.github/workflows/budibase_ci.yml +++ b/.github/workflows/budibase_ci.yml @@ -18,8 +18,6 @@ env: BRANCH: ${{ github.event.pull_request.head.ref }} BASE_BRANCH: ${{ github.event.pull_request.base.ref}} PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} - NX_BASE_BRANCH: origin/${{ github.base_ref }} - USE_NX_AFFECTED: ${{ github.event_name == 'pull_request' && github.base_ref != 'master'}} jobs: lint: @@ -27,20 +25,20 @@ jobs: steps: - name: Checkout repo and submodules uses: actions/checkout@v3 - if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'Budibase/budibase' + if: github.repository == 'Budibase/budibase' with: submodules: true token: ${{ secrets.PERSONAL_ACCESS_TOKEN || github.token }} - name: Checkout repo only uses: actions/checkout@v3 - if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != 'Budibase/budibase' + if: github.repository != 'Budibase/budibase' - - name: Use Node.js 18.x + - name: Use Node.js 14.x uses: actions/setup-node@v3 with: - node-version: 18.x + node-version: 14.x cache: "yarn" - - run: yarn --frozen-lockfile + - run: yarn - run: yarn lint build: @@ -48,66 +46,45 @@ jobs: steps: - name: Checkout repo and submodules uses: actions/checkout@v3 - if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'Budibase/budibase' + if: github.repository == 'Budibase/budibase' with: submodules: true token: ${{ secrets.PERSONAL_ACCESS_TOKEN || github.token }} - fetch-depth: 0 - name: Checkout repo only uses: actions/checkout@v3 - if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != 'Budibase/budibase' - with: - fetch-depth: 0 + if: github.repository != 'Budibase/budibase' - - name: Use Node.js 18.x + - name: Use Node.js 14.x uses: actions/setup-node@v3 with: - node-version: 18.x + node-version: 14.x cache: "yarn" - - run: yarn --frozen-lockfile - + - run: yarn # Run build all the projects - - name: Build - run: | - yarn build + - run: yarn build # Check the types of the projects built via esbuild - - name: Check types - run: | - if ${{ env.USE_NX_AFFECTED }}; then - yarn check:types --since=${{ env.NX_BASE_BRANCH }} - else - yarn check:types - fi + - run: yarn check:types test-libraries: runs-on: ubuntu-latest steps: - name: Checkout repo and submodules uses: actions/checkout@v3 - if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'Budibase/budibase' + if: github.repository == 'Budibase/budibase' with: submodules: true token: ${{ secrets.PERSONAL_ACCESS_TOKEN || github.token }} - fetch-depth: 0 - name: Checkout repo only uses: actions/checkout@v3 - if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != 'Budibase/budibase' - with: - fetch-depth: 0 + if: github.repository != 'Budibase/budibase' - - name: Use Node.js 18.x + - name: Use Node.js 14.x uses: actions/setup-node@v3 with: - node-version: 18.x + node-version: 14.x cache: "yarn" - - run: yarn --frozen-lockfile - - name: Test - run: | - if ${{ env.USE_NX_AFFECTED }}; then - yarn test --ignore=@budibase/worker --ignore=@budibase/server --ignore=@budibase/pro --since=${{ env.NX_BASE_BRANCH }} - else - yarn test --ignore=@budibase/worker --ignore=@budibase/server --ignore=@budibase/pro - fi + - run: yarn + - run: yarn test --ignore=@budibase/worker --ignore=@budibase/server --ignore=@budibase/pro - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos @@ -119,31 +96,21 @@ jobs: steps: - name: Checkout repo and submodules uses: actions/checkout@v3 - if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'Budibase/budibase' + if: github.repository == 'Budibase/budibase' with: submodules: true token: ${{ secrets.PERSONAL_ACCESS_TOKEN || github.token }} - fetch-depth: 0 - name: Checkout repo only uses: actions/checkout@v3 - if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != 'Budibase/budibase' - with: - fetch-depth: 0 + if: github.repository != 'Budibase/budibase' - - name: Use Node.js 18.x + - name: Use Node.js 14.x uses: actions/setup-node@v3 with: - node-version: 18.x + node-version: 14.x cache: "yarn" - - run: yarn --frozen-lockfile - - name: Test worker and server - run: | - if ${{ env.USE_NX_AFFECTED }}; then - yarn test --scope=@budibase/worker --scope=@budibase/server --since=${{ env.NX_BASE_BRANCH }} - else - yarn test --scope=@budibase/worker --scope=@budibase/server - fi - + - run: yarn + - run: yarn test --scope=@budibase/worker --scope=@budibase/server - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN || github.token }} # not required for public repos @@ -152,50 +119,42 @@ jobs: test-pro: runs-on: ubuntu-latest - if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'Budibase/budibase' + if: github.repository == 'Budibase/budibase' steps: - name: Checkout repo and submodules uses: actions/checkout@v3 with: submodules: true token: ${{ secrets.PERSONAL_ACCESS_TOKEN || github.token }} - fetch-depth: 0 - - name: Use Node.js 18.x + - name: Use Node.js 14.x uses: actions/setup-node@v3 with: - node-version: 18.x + node-version: 14.x cache: "yarn" - - run: yarn --frozen-lockfile - - name: Test - run: | - if ${{ env.USE_NX_AFFECTED }}; then - yarn test --scope=@budibase/pro --since=${{ env.NX_BASE_BRANCH }} - else - yarn test --scope=@budibase/pro - fi + - run: yarn + - run: yarn test --scope=@budibase/pro integration-test: runs-on: ubuntu-latest steps: - name: Checkout repo and submodules uses: actions/checkout@v3 - if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'Budibase/budibase' + if: github.repository == 'Budibase/budibase' with: submodules: true token: ${{ secrets.PERSONAL_ACCESS_TOKEN || github.token }} - name: Checkout repo only uses: actions/checkout@v3 - if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != 'Budibase/budibase' + if: github.repository != 'Budibase/budibase' - - name: Use Node.js 18.x + - name: Use Node.js 14.x uses: actions/setup-node@v3 with: - node-version: 18.x + node-version: 14.x cache: "yarn" - - run: yarn --frozen-lockfile - - name: Build packages - run: yarn build --scope @budibase/server --scope @budibase/worker --scope @budibase/client --scope @budibase/backend-core + - run: yarn + - run: yarn build --projects=@budibase/server,@budibase/worker,@budibase/client - name: Run tests run: | cd qa-core @@ -207,12 +166,13 @@ jobs: check-pro-submodule: runs-on: ubuntu-latest - if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'Budibase/budibase' + if: github.repository == 'Budibase/budibase' steps: - name: Checkout repo and submodules uses: actions/checkout@v3 with: submodules: true + fetch-depth: 0 token: ${{ secrets.PERSONAL_ACCESS_TOKEN || github.token }} - name: Check pro commit diff --git a/.github/workflows/check_unreleased_changes.yml b/.github/workflows/check_unreleased_changes.yml deleted file mode 100644 index d558330545..0000000000 --- a/.github/workflows/check_unreleased_changes.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: check_unreleased_changes - -on: - pull_request: - branches: - - master - -jobs: - check_unreleased: - runs-on: ubuntu-latest - steps: - - name: Check for unreleased changes - env: - REPO: "Budibase/budibase" - TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - RELEASE_TIMESTAMP=$(curl -s -H "Authorization: token $TOKEN" \ - "https://api.github.com/repos/$REPO/releases/latest" | \ - jq -r .published_at) - COMMIT_TIMESTAMP=$(curl -s -H "Authorization: token $TOKEN" \ - "https://api.github.com/repos/$REPO/commits/master" | \ - jq -r .commit.committer.date) - RELEASE_SECONDS=$(date --date="$RELEASE_TIMESTAMP" "+%s") - COMMIT_SECONDS=$(date --date="$COMMIT_TIMESTAMP" "+%s") - if (( COMMIT_SECONDS > RELEASE_SECONDS )); then - echo "There are unreleased changes. Please release these changes before merging." - exit 1 - fi - echo "No unreleased changes detected." diff --git a/.github/workflows/release-develop.yml b/.github/workflows/release-develop.yml index bd727b7865..61cb283e28 100644 --- a/.github/workflows/release-develop.yml +++ b/.github/workflows/release-develop.yml @@ -44,7 +44,7 @@ jobs: - uses: actions/setup-node@v1 with: - node-version: 18.x + node-version: 14.x - run: yarn install --frozen-lockfile - name: Update versions diff --git a/.nvmrc b/.nvmrc index 7950a44576..835d07c442 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -v18.17.0 +v14.20.1 diff --git a/.tool-versions b/.tool-versions index a909d60941..9f2ea77b14 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1,3 +1,3 @@ -nodejs 18.17.0 +nodejs 14.21.3 python 3.10.0 -yarn 1.22.19 +yarn 1.22.19 \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json index cfd8d7b155..8cb49d5825 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,31 +1,42 @@ - { - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "name": "Budibase Server", - "type": "node", - "request": "launch", - "runtimeArgs": ["--nolazy", "-r", "ts-node/register/transpile-only"], - "args": ["${workspaceFolder}/packages/server/src/index.ts"], - "cwd": "${workspaceFolder}/packages/server" - }, - { - "name": "Budibase Worker", - "type": "node", - "request": "launch", - "runtimeArgs": ["--nolazy", "-r", "ts-node/register/transpile-only"], - "args": ["${workspaceFolder}/packages/worker/src/index.ts"], - "cwd": "${workspaceFolder}/packages/worker" - } - ], - "compounds": [ - { - "name": "Start Budibase", - "configurations": ["Budibase Server", "Budibase Worker"] - } - ] -} + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Budibase Server", + "type": "node", + "request": "launch", + "runtimeArgs": [ + "--nolazy", + "-r", + "ts-node/register/transpile-only" + ], + "args": [ + "${workspaceFolder}/packages/server/src/index.ts" + ], + "cwd": "${workspaceFolder}/packages/server" + }, + { + "name": "Budibase Worker", + "type": "node", + "request": "launch", + "runtimeArgs": [ + "--nolazy", + "-r", + "ts-node/register/transpile-only" + ], + "args": [ + "${workspaceFolder}/packages/worker/src/index.ts" + ], + "cwd": "${workspaceFolder}/packages/worker" + }, + ], + "compounds": [ + { + "name": "Start Budibase", + "configurations": ["Budibase Server", "Budibase Worker"] + } + ] +} \ No newline at end of file diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 70f198a84c..2fb4c36fa8 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -90,7 +90,7 @@ Component libraries are collections of components as well as the definition of t #### 1. Prerequisites -- NodeJS version `18.x.x` +- NodeJS version `14.x.x` - Python version `3.x` ### Using asdf (recommended) diff --git a/hosting/tests/Dockerfile b/hosting/dependencies/Dockerfile similarity index 100% rename from hosting/tests/Dockerfile rename to hosting/dependencies/Dockerfile diff --git a/hosting/tests/README.md b/hosting/dependencies/README.md similarity index 100% rename from hosting/tests/README.md rename to hosting/dependencies/README.md diff --git a/hosting/tests/runner.sh b/hosting/dependencies/runner.sh similarity index 100% rename from hosting/tests/runner.sh rename to hosting/dependencies/runner.sh diff --git a/hosting/docker-compose.test.yaml b/hosting/docker-compose.test.yaml new file mode 100644 index 0000000000..f059173d2d --- /dev/null +++ b/hosting/docker-compose.test.yaml @@ -0,0 +1,47 @@ +version: "3" + +# optional ports are specified throughout for more advanced use cases. + +services: + minio-service: + restart: on-failure + # Last version that supports the "fs" backend + image: minio/minio:RELEASE.2022-10-24T18-35-07Z + ports: + - "9000" + - "9001" + environment: + MINIO_ACCESS_KEY: ${MINIO_ACCESS_KEY} + MINIO_SECRET_KEY: ${MINIO_SECRET_KEY} + command: server /data --console-address ":9001" + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"] + interval: 30s + timeout: 20s + retries: 3 + + couchdb-service: + # platform: linux/amd64 + restart: on-failure + image: budibase/couchdb + environment: + - COUCHDB_PASSWORD=${COUCH_DB_PASSWORD} + - COUCHDB_USER=${COUCH_DB_USER} + ports: + - "5984" + - "4369" + - "9100" + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:5984/_up"] + interval: 30s + timeout: 20s + retries: 3 + + redis-service: + restart: on-failure + image: redis + command: redis-server --requirepass ${REDIS_PASSWORD} + ports: + - "6379" + healthcheck: + test: ["CMD", "redis-cli", "ping"] \ No newline at end of file diff --git a/hosting/single/Dockerfile b/hosting/single/Dockerfile index 9fdf2449d1..e43e5ad10c 100644 --- a/hosting/single/Dockerfile +++ b/hosting/single/Dockerfile @@ -1,7 +1,7 @@ -FROM node:18-slim as build +FROM node:14-slim as build # install node-gyp dependencies -RUN apt-get update && apt-get upgrade -y && apt-get install -y --no-install-recommends apt-utils cron g++ make python3 +RUN apt-get update && apt-get upgrade -y && apt-get install -y --no-install-recommends apt-utils cron g++ make python # add pin script WORKDIR / diff --git a/jestTestcontainersConfigGenerator.js b/jestTestcontainersConfigGenerator.js index 1e39ed771f..4b94cf5016 100644 --- a/jestTestcontainersConfigGenerator.js +++ b/jestTestcontainersConfigGenerator.js @@ -1,16 +1,9 @@ module.exports = () => { return { - couchdb: { - image: "budibase/couchdb", - ports: [5984], - env: { - COUCHDB_PASSWORD: "budibase", - COUCHDB_USER: "budibase", - }, - wait: { - type: "ports", - timeout: 20000, - } - } + dockerCompose: { + composeFilePath: "../../hosting", + composeFile: "docker-compose.test.yaml", + startupTimeout: 10000, + }, } } diff --git a/package.json b/package.json index 4e4befb5f2..d27af2e27d 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "preinstall": "node scripts/syncProPackage.js", "setup": "git config submodule.recurse true && git submodule update && node ./hosting/scripts/setup.js && yarn && yarn build && yarn dev", "bootstrap": "./scripts/link-dependencies.sh && echo '***BOOTSTRAP ONLY REQUIRED FOR USE WITH ACCOUNT PORTAL***'", - "build": "lerna run build --stream", + "build": "yarn nx run-many -t=build", "build:dev": "lerna run --stream prebuild && yarn nx run-many --target=build --output-style=dynamic --watch --preserveWatchOutput", "check:types": "lerna run check:types", "backend:bootstrap": "./scripts/scopeBackend.sh && yarn run bootstrap", @@ -109,7 +109,7 @@ "@budibase/types": "0.0.0" }, "engines": { - "node": ">=18.0.0 <19.0.0" + "node": ">=14.0.0 <15.0.0" }, "dependencies": {} } diff --git a/packages/backend-core/src/cache/user.ts b/packages/backend-core/src/cache/user.ts index e2af78adfd..8281bfca62 100644 --- a/packages/backend-core/src/cache/user.ts +++ b/packages/backend-core/src/cache/user.ts @@ -4,8 +4,6 @@ import * as context from "../context" import * as platform from "../platform" import env from "../environment" import * as accounts from "../accounts" -import { UserDB } from "../users" -import { sdk } from "@budibase/shared-core" const EXPIRY_SECONDS = 3600 @@ -62,18 +60,6 @@ export async function getUser( // make sure the tenant ID is always correct/set user.tenantId = tenantId } - // if has groups, could have builder permissions granted by a group - if (user.userGroups && !sdk.users.isGlobalBuilder(user)) { - await context.doInTenant(tenantId, async () => { - const appIds = await UserDB.getGroupBuilderAppIds(user) - if (appIds.length) { - const existing = user.builder?.apps || [] - user.builder = { - apps: [...new Set(existing.concat(appIds))], - } - } - }) - } return user } diff --git a/packages/backend-core/src/db/lucene.ts b/packages/backend-core/src/db/lucene.ts index 7451d581b5..a491451a62 100644 --- a/packages/backend-core/src/db/lucene.ts +++ b/packages/backend-core/src/db/lucene.ts @@ -1,6 +1,7 @@ import fetch from "node-fetch" import { getCouchInfo } from "./couch" -import { SearchFilters, Row, EmptyFilterOption } from "@budibase/types" +import { SearchFilters, Row } from "@budibase/types" +import { createUserIndex } from "./searchIndexes/searchIndexes" const QUERY_START_REGEX = /\d[0-9]*:/g @@ -64,7 +65,6 @@ export class QueryBuilder { this.#index = index this.#query = { allOr: false, - onEmptyFilter: EmptyFilterOption.RETURN_ALL, string: {}, fuzzy: {}, range: {}, @@ -218,10 +218,6 @@ export class QueryBuilder { this.#query.allOr = true } - setOnEmptyFilter(value: EmptyFilterOption) { - this.#query.onEmptyFilter = value - } - handleSpaces(input: string) { if (this.#noEscaping) { return input @@ -293,9 +289,8 @@ export class QueryBuilder { const builder = this let allOr = this.#query && this.#query.allOr let query = allOr ? "" : "*:*" - let allFiltersEmpty = true const allPreProcessingOpts = { escape: true, lowercase: true, wrap: true } - let tableId: string = "" + let tableId if (this.#query.equal!.tableId) { tableId = this.#query.equal!.tableId delete this.#query.equal!.tableId @@ -310,7 +305,7 @@ export class QueryBuilder { } const contains = (key: string, value: any, mode = "AND") => { - if (!value || (Array.isArray(value) && value.length === 0)) { + if (Array.isArray(value) && value.length === 0) { return null } if (!Array.isArray(value)) { @@ -389,12 +384,6 @@ export class QueryBuilder { built += ` ${mode} ` } built += expression - if ( - (typeof value !== "string" && value != null) || - (typeof value === "string" && value !== tableId && value !== "") - ) { - allFiltersEmpty = false - } } if (opts?.returnBuilt) { return built @@ -474,13 +463,6 @@ export class QueryBuilder { allOr = false build({ tableId }, equal) } - if (allFiltersEmpty) { - if (this.#query.onEmptyFilter === EmptyFilterOption.RETURN_NONE) { - return "" - } else if (this.#query?.allOr) { - return query.replace("()", "(*:*)") - } - } return query } diff --git a/packages/backend-core/src/db/tests/lucene.spec.ts b/packages/backend-core/src/db/tests/lucene.spec.ts index 7716661d88..a82828d8f2 100644 --- a/packages/backend-core/src/db/tests/lucene.spec.ts +++ b/packages/backend-core/src/db/tests/lucene.spec.ts @@ -1,6 +1,6 @@ import { newid } from "../../docIds/newid" import { getDB } from "../db" -import { Database, EmptyFilterOption } from "@budibase/types" +import { Database } from "@budibase/types" import { QueryBuilder, paginatedSearch, fullSearch } from "../lucene" const INDEX_NAME = "main" @@ -156,76 +156,6 @@ describe("lucene", () => { expect(resp.rows.length).toBe(2) }) - describe("empty filters behaviour", () => { - it("should return all rows by default", async () => { - const builder = new QueryBuilder(dbName, INDEX_NAME) - builder.addEqual("property", "") - builder.addEqual("number", null) - builder.addString("property", "") - builder.addFuzzy("property", "") - builder.addNotEqual("number", undefined) - builder.addOneOf("number", null) - builder.addContains("array", undefined) - builder.addNotContains("array", null) - builder.addContainsAny("array", null) - - const resp = await builder.run() - expect(resp.rows.length).toBe(3) - }) - - it("should return all rows when onEmptyFilter is ALL", async () => { - const builder = new QueryBuilder(dbName, INDEX_NAME) - builder.setOnEmptyFilter(EmptyFilterOption.RETURN_ALL) - builder.setAllOr() - builder.addEqual("property", "") - builder.addEqual("number", null) - builder.addString("property", "") - builder.addFuzzy("property", "") - builder.addNotEqual("number", undefined) - builder.addOneOf("number", null) - builder.addContains("array", undefined) - builder.addNotContains("array", null) - builder.addContainsAny("array", null) - - const resp = await builder.run() - expect(resp.rows.length).toBe(3) - }) - - it("should return no rows when onEmptyFilter is NONE", async () => { - const builder = new QueryBuilder(dbName, INDEX_NAME) - builder.setOnEmptyFilter(EmptyFilterOption.RETURN_NONE) - builder.addEqual("property", "") - builder.addEqual("number", null) - builder.addString("property", "") - builder.addFuzzy("property", "") - builder.addNotEqual("number", undefined) - builder.addOneOf("number", null) - builder.addContains("array", undefined) - builder.addNotContains("array", null) - builder.addContainsAny("array", null) - - const resp = await builder.run() - expect(resp.rows.length).toBe(0) - }) - - it("should return all matching rows when onEmptyFilter is NONE, but a filter value is provided", async () => { - const builder = new QueryBuilder(dbName, INDEX_NAME) - builder.setOnEmptyFilter(EmptyFilterOption.RETURN_NONE) - builder.addEqual("property", "") - builder.addEqual("number", 1) - builder.addString("property", "") - builder.addFuzzy("property", "") - builder.addNotEqual("number", undefined) - builder.addOneOf("number", null) - builder.addContains("array", undefined) - builder.addNotContains("array", null) - builder.addContainsAny("array", null) - - const resp = await builder.run() - expect(resp.rows.length).toBe(1) - }) - }) - describe("skip", () => { const skipDbName = `db-${newid()}` let docs: { diff --git a/packages/backend-core/src/features/index.ts b/packages/backend-core/src/featureFlags/index.ts similarity index 98% rename from packages/backend-core/src/features/index.ts rename to packages/backend-core/src/featureFlags/index.ts index 8f5c903e05..877cd60e1a 100644 --- a/packages/backend-core/src/features/index.ts +++ b/packages/backend-core/src/featureFlags/index.ts @@ -1,6 +1,5 @@ import env from "../environment" import * as context from "../context" -export * from "./installation" /** * Read the TENANT_FEATURE_FLAGS env var and return an array of features flags for each tenant. diff --git a/packages/backend-core/src/features/tests/featureFlags.spec.ts b/packages/backend-core/src/featureFlags/tests/featureFlags.spec.ts similarity index 100% rename from packages/backend-core/src/features/tests/featureFlags.spec.ts rename to packages/backend-core/src/featureFlags/tests/featureFlags.spec.ts diff --git a/packages/backend-core/src/features/installation.ts b/packages/backend-core/src/features/installation.ts deleted file mode 100644 index defc8bf987..0000000000 --- a/packages/backend-core/src/features/installation.ts +++ /dev/null @@ -1,17 +0,0 @@ -export function processFeatureEnvVar( - fullList: string[], - featureList?: string -) { - let list - if (!featureList) { - list = fullList - } else { - list = featureList.split(",") - } - for (let feature of list) { - if (!fullList.includes(feature)) { - throw new Error(`Feature: ${feature} is not an allowed option`) - } - } - return list as unknown as T[] -} diff --git a/packages/backend-core/src/index.ts b/packages/backend-core/src/index.ts index ffffd8240a..7b98674788 100644 --- a/packages/backend-core/src/index.ts +++ b/packages/backend-core/src/index.ts @@ -6,8 +6,7 @@ export * as roles from "./security/roles" export * as permissions from "./security/permissions" export * as accounts from "./accounts" export * as installation from "./installation" -export * as featureFlags from "./features" -export * as features from "./features/installation" +export * as featureFlags from "./featureFlags" export * as sessions from "./security/sessions" export * as platform from "./platform" export * as auth from "./auth" diff --git a/packages/backend-core/src/middleware/builderOnly.ts b/packages/backend-core/src/middleware/builderOnly.ts index fafcc524cc..8c1c54a44c 100644 --- a/packages/backend-core/src/middleware/builderOnly.ts +++ b/packages/backend-core/src/middleware/builderOnly.ts @@ -5,12 +5,11 @@ import env from "../environment" export default async (ctx: UserCtx, next: any) => { const appId = getAppId() - const builderFn = - env.isWorker() || !appId - ? hasBuilderPermissions - : env.isApps() - ? isBuilder - : undefined + const builderFn = env.isWorker() + ? hasBuilderPermissions + : env.isApps() + ? isBuilder + : undefined if (!builderFn) { throw new Error("Service name unknown - middleware inactive.") } diff --git a/packages/backend-core/src/middleware/builderOrAdmin.ts b/packages/backend-core/src/middleware/builderOrAdmin.ts index 4b8badec15..c03e856233 100644 --- a/packages/backend-core/src/middleware/builderOrAdmin.ts +++ b/packages/backend-core/src/middleware/builderOrAdmin.ts @@ -5,12 +5,11 @@ import env from "../environment" export default async (ctx: UserCtx, next: any) => { const appId = getAppId() - const builderFn = - env.isWorker() || !appId - ? hasBuilderPermissions - : env.isApps() - ? isBuilder - : undefined + const builderFn = env.isWorker() + ? hasBuilderPermissions + : env.isApps() + ? isBuilder + : undefined if (!builderFn) { throw new Error("Service name unknown - middleware inactive.") } diff --git a/packages/backend-core/src/security/permissions.ts b/packages/backend-core/src/security/permissions.ts index aa0b20a30c..70dae57ae6 100644 --- a/packages/backend-core/src/security/permissions.ts +++ b/packages/backend-core/src/security/permissions.ts @@ -78,6 +78,7 @@ export const BUILTIN_PERMISSIONS = { permissions: [ new Permission(PermissionType.QUERY, PermissionLevel.READ), new Permission(PermissionType.TABLE, PermissionLevel.READ), + new Permission(PermissionType.VIEW, PermissionLevel.READ), ], }, WRITE: { @@ -86,6 +87,7 @@ export const BUILTIN_PERMISSIONS = { permissions: [ new Permission(PermissionType.QUERY, PermissionLevel.WRITE), new Permission(PermissionType.TABLE, PermissionLevel.WRITE), + new Permission(PermissionType.VIEW, PermissionLevel.READ), new Permission(PermissionType.AUTOMATION, PermissionLevel.EXECUTE), ], }, @@ -96,6 +98,7 @@ export const BUILTIN_PERMISSIONS = { new Permission(PermissionType.TABLE, PermissionLevel.WRITE), new Permission(PermissionType.USER, PermissionLevel.READ), new Permission(PermissionType.AUTOMATION, PermissionLevel.EXECUTE), + new Permission(PermissionType.VIEW, PermissionLevel.READ), new Permission(PermissionType.WEBHOOK, PermissionLevel.READ), ], }, @@ -106,6 +109,7 @@ export const BUILTIN_PERMISSIONS = { new Permission(PermissionType.TABLE, PermissionLevel.ADMIN), new Permission(PermissionType.USER, PermissionLevel.ADMIN), new Permission(PermissionType.AUTOMATION, PermissionLevel.ADMIN), + new Permission(PermissionType.VIEW, PermissionLevel.ADMIN), new Permission(PermissionType.WEBHOOK, PermissionLevel.READ), new Permission(PermissionType.QUERY, PermissionLevel.ADMIN), ], diff --git a/packages/backend-core/src/users/db.ts b/packages/backend-core/src/users/db.ts index c288540f35..55cc97bb1c 100644 --- a/packages/backend-core/src/users/db.ts +++ b/packages/backend-core/src/users/db.ts @@ -1,32 +1,30 @@ import env from "../environment" import * as eventHelpers from "./events" import * as accounts from "../accounts" -import * as accountSdk from "../accounts" import * as cache from "../cache" -import { getGlobalDB, getIdentity, getTenantId } from "../context" +import { getIdentity, getTenantId, getGlobalDB } from "../context" import * as dbUtils from "../db" import { EmailUnavailableError, HTTPError } from "../errors" import * as platform from "../platform" import * as sessions from "../security/sessions" import * as usersCore from "./users" import { - Account, AllDocsResponse, BulkUserCreated, BulkUserDeleted, - isSSOAccount, - isSSOUser, RowResponse, SaveUserOpts, User, + Account, + isSSOUser, + isSSOAccount, UserStatus, - UserGroup, - ContextUser, } from "@budibase/types" +import * as accountSdk from "../accounts" import { + validateUniqueUser, getAccountHolderFromUserIds, isAdmin, - validateUniqueUser, } from "./utils" import { searchExistingEmails } from "./lookup" import { hash } from "../utils" @@ -34,14 +32,8 @@ import { hash } from "../utils" type QuotaUpdateFn = (change: number, cb?: () => Promise) => Promise type GroupUpdateFn = (groupId: string, userIds: string[]) => Promise type FeatureFn = () => Promise -type GroupGetFn = (ids: string[]) => Promise -type GroupBuildersFn = (user: User) => Promise type QuotaFns = { addUsers: QuotaUpdateFn; removeUsers: QuotaUpdateFn } -type GroupFns = { - addUsers: GroupUpdateFn - getBulk: GroupGetFn - getGroupBuilderAppIds: GroupBuildersFn -} +type GroupFns = { addUsers: GroupUpdateFn } type FeatureFns = { isSSOEnforced: FeatureFn; isAppBuildersEnabled: FeatureFn } const bulkDeleteProcessing = async (dbUser: User) => { @@ -187,14 +179,6 @@ export class UserDB { return user } - static async bulkGet(userIds: string[]) { - return await usersCore.bulkGetGlobalUsersById(userIds) - } - - static async bulkUpdate(users: User[]) { - return await usersCore.bulkUpdateGlobalUsers(users) - } - static async save(user: User, opts: SaveUserOpts = {}): Promise { // default booleans to true if (opts.hashPassword == null) { @@ -473,12 +457,4 @@ export class UserDB { await cache.user.invalidateUser(userId) await sessions.invalidateSessions(userId, { reason: "deletion" }) } - - static async getGroups(groupIds: string[]) { - return await this.groups.getBulk(groupIds) - } - - static async getGroupBuilderAppIds(user: User) { - return await this.groups.getGroupBuilderAppIds(user) - } } diff --git a/packages/backend-core/tests/core/utilities/mocks/licenses.ts b/packages/backend-core/tests/core/utilities/mocks/licenses.ts index 309f0fd159..6747282040 100644 --- a/packages/backend-core/tests/core/utilities/mocks/licenses.ts +++ b/packages/backend-core/tests/core/utilities/mocks/licenses.ts @@ -86,10 +86,6 @@ export const useAuditLogs = () => { return useFeature(Feature.AUDIT_LOGS) } -export const usePublicApiUserRoles = () => { - return useFeature(Feature.USER_ROLE_PUBLIC_API) -} - export const useScimIntegration = () => { return useFeature(Feature.SCIM) } @@ -102,10 +98,6 @@ export const useAppBuilders = () => { return useFeature(Feature.APP_BUILDERS) } -export const useViewPermissions = () => { - return useFeature(Feature.VIEW_PERMISSIONS) -} - // QUOTAS export const setAutomationLogsQuota = (value: number) => { diff --git a/packages/backend-core/tests/core/utilities/testContainerUtils.ts b/packages/backend-core/tests/core/utilities/testContainerUtils.ts index 7da6cbc777..f6c702f7ef 100644 --- a/packages/backend-core/tests/core/utilities/testContainerUtils.ts +++ b/packages/backend-core/tests/core/utilities/testContainerUtils.ts @@ -32,8 +32,8 @@ function getTestContainerSettings( ): string | null { const entry = Object.entries(global).find( ([k]) => - k.includes(`${serverName.toUpperCase()}`) && - k.includes(`${key.toUpperCase()}`) + k.includes(`_${serverName.toUpperCase()}`) && + k.includes(`_${key.toUpperCase()}__`) ) if (!entry) { return null @@ -67,14 +67,27 @@ function getContainerInfo(containerName: string, port: number) { } function getCouchConfig() { - return getContainerInfo("couchdb", 5984) + return getContainerInfo("couchdb-service", 5984) +} + +function getMinioConfig() { + return getContainerInfo("minio-service", 9000) +} + +function getRedisConfig() { + return getContainerInfo("redis-service", 6379) } export function setupEnv(...envs: any[]) { - const couch = getCouchConfig() + const couch = getCouchConfig(), + minio = getCouchConfig(), + redis = getRedisConfig() const configs = [ { key: "COUCH_DB_PORT", value: couch.port }, { key: "COUCH_DB_URL", value: couch.url }, + { key: "MINIO_PORT", value: minio.port }, + { key: "MINIO_URL", value: minio.url }, + { key: "REDIS_URL", value: redis.url }, ] for (const config of configs.filter(x => !!x.value)) { diff --git a/packages/bbui/src/Actions/position_dropdown.js b/packages/bbui/src/Actions/position_dropdown.js index 4a5ef890bf..8fa02bb8f3 100644 --- a/packages/bbui/src/Actions/position_dropdown.js +++ b/packages/bbui/src/Actions/position_dropdown.js @@ -32,10 +32,11 @@ export default function positionDropdown(element, opts) { left: null, top: null, } + // Determine vertical styles if (align === "right-outside") { styles.top = anchorBounds.top - } else if (window.innerHeight - anchorBounds.bottom < (maxHeight || 100)) { + } else if (window.innerHeight - anchorBounds.bottom < 100) { styles.top = anchorBounds.top - elementBounds.height - offset styles.maxHeight = maxHeight || 240 } else { diff --git a/packages/bbui/src/ColorPicker/ColorPicker.svelte b/packages/bbui/src/ColorPicker/ColorPicker.svelte index 2ba5309860..9a70134fb6 100644 --- a/packages/bbui/src/ColorPicker/ColorPicker.svelte +++ b/packages/bbui/src/ColorPicker/ColorPicker.svelte @@ -1,8 +1,8 @@ -
{ - dropdown.toggle() - }} -> -
-
- - - -
+
+
(open = true)}> +
+
+ {#if open} +
{#each categories as category}
{category.label}
@@ -184,8 +187,8 @@
- - + {/if} +
diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_components/Screen/ThemePanel.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_components/Screen/ThemePanel.svelte deleted file mode 100644 index 13a008fae0..0000000000 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_components/Screen/ThemePanel.svelte +++ /dev/null @@ -1,78 +0,0 @@ - - -
- - These settings apply to all screens -
- - - - - - - update("buttonBorderRadius", e.detail)} - /> - - update("primaryColor", val)} - props={{ - spectrumTheme: $store.theme, - }} - /> - update("primaryColorHover", val)} - props={{ - spectrumTheme: $store.theme, - }} - /> - - - diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_components/Screen/index.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_components/Screen/index.svelte deleted file mode 100644 index 778fa303cc..0000000000 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_components/Screen/index.svelte +++ /dev/null @@ -1,51 +0,0 @@ - - - -
-
- {#each tabs as tab} - { - activeTab = tab - }} - > - {capitalise(tab)} - - {/each} -
-
- - {#if activeTab === "theme"} - - {:else} - - {/if} - -
- - diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_layout.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_layout.svelte deleted file mode 100644 index 19cb1d8dff..0000000000 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_layout.svelte +++ /dev/null @@ -1,52 +0,0 @@ - - -{#if routeComponentId === `${$store.selectedScreenId}-screen`} - -{:else if routeComponentId === `${$store.selectedScreenId}-navigation`} - -{:else} - -{/if} - diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/index.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/index.svelte deleted file mode 100644 index 0ff63d1ead..0000000000 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/index.svelte +++ /dev/null @@ -1 +0,0 @@ - diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/AppPanel.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/AppPanel.svelte index 09f97302fd..785b221239 100644 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/AppPanel.svelte +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/AppPanel.svelte @@ -1,16 +1,32 @@
- + -
- Screens -
-
- -
-
- -
-
-
- {#if filteredScreens?.length} - {#each filteredScreens as screen (screen._id)} - store.actions.screens.select(screen._id)} - rightAlignIcon - showTooltip - selectedBy={$userSelectedResourceMap[screen._id]} - > - -
- -
-
- {/each} - {:else} - -
- There aren't any screens matching that route -
-
- {/if} -
- -
screensHeight.set("210px")} - /> -
- - diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_fallback.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_fallback.svelte new file mode 100644 index 0000000000..00165e4ee9 --- /dev/null +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_fallback.svelte @@ -0,0 +1,5 @@ + diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_layout.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_layout.svelte index 0e630b4f39..8bc0dcc3e5 100644 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_layout.svelte +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_layout.svelte @@ -1,10 +1,14 @@ -{#if $selectedScreen} -
-
- - - -
+
+
+ + $goto("./screens")} + /> + $goto("./components")} + /> + $goto("./theme")} + /> + $goto("./navigation")} + /> + {#if $store.layouts?.length} + $goto("./layouts")} + /> + {/if} +
-{/if} + +
+ {#if $selectedScreen} + + + {/if} +
+
diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/ComponentList/ComponentDropdownMenu.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/_components/navigation/ComponentDropdownMenu.svelte similarity index 100% rename from packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/ComponentList/ComponentDropdownMenu.svelte rename to packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/_components/navigation/ComponentDropdownMenu.svelte diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/ComponentList/ComponentKeyHandler.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/_components/navigation/ComponentKeyHandler.svelte similarity index 90% rename from packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/ComponentList/ComponentKeyHandler.svelte rename to packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/_components/navigation/ComponentKeyHandler.svelte index b6957f64f3..4813757727 100644 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/ComponentList/ComponentKeyHandler.svelte +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/_components/navigation/ComponentKeyHandler.svelte @@ -5,6 +5,7 @@ import { goto, isActive } from "@roxi/routify" import { notifications } from "@budibase/bbui" import ConfirmDialog from "components/common/ConfirmDialog.svelte" + import { isBuilderInputFocused } from "helpers" let confirmDeleteDialog let confirmEjectDialog @@ -36,7 +37,7 @@ confirmEjectDialog.show() }, ["Ctrl+Enter"]: () => { - $goto(`./:componentId/new`) + $goto("./new") }, ["Delete"]: component => { // Don't show confirmation for the screen itself @@ -53,8 +54,8 @@ store.actions.components.selectNext() }, ["Escape"]: () => { - if ($isActive(`./:componentId/new`)) { - $goto(`./${$store.selectedComponentId}`) + if ($isActive("./new")) { + $goto("./") } }, } @@ -84,13 +85,10 @@ const handler = keyHandlers[key] if (!handler) { return false - } - - if (event && key !== "Escape") { + } else if (event) { event.preventDefault() event.stopPropagation() } - return await handler(component) } catch (error) { notifications.error(error || "Error handling key press") @@ -103,13 +101,7 @@ return } // Ignore events when typing - const activeTag = document.activeElement?.tagName.toLowerCase() - const inCodeEditor = - document.activeElement?.classList?.contains("cm-content") - if ( - (inCodeEditor || ["input", "textarea"].indexOf(activeTag) !== -1) && - e.key !== "Escape" - ) { + if (isBuilderInputFocused(e)) { return } // Key events are always for the selected component diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/_components/navigation/ComponentListPanel.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/_components/navigation/ComponentListPanel.svelte new file mode 100644 index 0000000000..9513753d76 --- /dev/null +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/_components/navigation/ComponentListPanel.svelte @@ -0,0 +1,90 @@ + + + +
+ +
+ +
    +
  • + { + $store.selectedComponentId = $selectedScreen?.props._id + }} + id={`component-${$selectedScreen?.props._id}`} + selectedBy={$userSelectedResourceMap[$selectedScreen?.props._id]} + > + + + + + + {#if $dndStore.dragging && $dndStore.valid} + + {#if $dndStore.dropPosition !== DropPosition.INSIDE} + + {/if} + {/if} +
  • +
+
+
+ + + diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/ComponentList/ComponentScrollWrapper.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/_components/navigation/ComponentScrollWrapper.svelte similarity index 93% rename from packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/ComponentList/ComponentScrollWrapper.svelte rename to packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/_components/navigation/ComponentScrollWrapper.svelte index 484b56f21c..15ba7acecf 100644 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/ComponentList/ComponentScrollWrapper.svelte +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/_components/navigation/ComponentScrollWrapper.svelte @@ -9,14 +9,14 @@ if (!bounds) { return } - const sidebarWidth = 310 + const sidebarWidth = 259 const navItemHeight = 32 const { scrollLeft, scrollTop, offsetHeight } = scrollRef let scrollBounds = scrollRef.getBoundingClientRect() let newOffsets = {} // Calculate left offset - const offsetX = bounds.left + bounds.width + scrollLeft + 16 + const offsetX = bounds.left + bounds.width + scrollLeft - 36 if (offsetX > sidebarWidth) { newOffsets.left = offsetX - sidebarWidth } else { @@ -64,7 +64,6 @@
div { + padding: var(--spacing-xl) 0; flex: 1 1 auto; overflow: auto; height: 0; diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/ComponentList/ComponentTree.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/_components/navigation/ComponentTree.svelte similarity index 98% rename from packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/ComponentList/ComponentTree.svelte rename to packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/_components/navigation/ComponentTree.svelte index 0e23f82946..18319e4b33 100644 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/ComponentList/ComponentTree.svelte +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/_components/navigation/ComponentTree.svelte @@ -107,7 +107,6 @@ id={`component-${component._id}`} > + import { syncURLToState } from "helpers/urlStateSync" + import { store, selectedScreen } from "builderStore" + import * as routify from "@roxi/routify" + import { onDestroy } from "svelte" + import { findComponent } from "builderStore/componentUtils" + import ComponentListPanel from "./_components/navigation/ComponentListPanel.svelte" + import ComponentSettingsPanel from "./_components/settings/ComponentSettingsPanel.svelte" + + $: componentId = $store.selectedComponentId + $: store.actions.websocket.selectResource(componentId) + + const cleanUrl = url => { + // Strip trailing slashes + if (url?.endsWith("/index")) { + url = url.replace("/index", "") + } + // Hide new component panel whenever component ID changes + if (url?.endsWith("/new")) { + url = url.replace("/new", "") + } + return { url } + } + + // Keep URL and state in sync for selected component ID + const stopSyncing = syncURLToState({ + urlParam: "componentId", + stateKey: "selectedComponentId", + validate: id => !!findComponent($selectedScreen.props, id), + fallbackUrl: "../", + store, + routify, + beforeNavigate: cleanUrl, + }) + + onDestroy(stopSyncing) + + + + + diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/index.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/index.svelte new file mode 100644 index 0000000000..9b5d05fe57 --- /dev/null +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/index.svelte @@ -0,0 +1,4 @@ + diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/new/_components/NewComponentPanel.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/new/_components/NewComponentPanel.svelte similarity index 98% rename from packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/new/_components/NewComponentPanel.svelte rename to packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/new/_components/NewComponentPanel.svelte index 248bbc8141..7dca5b792b 100644 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/new/_components/NewComponentPanel.svelte +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/new/_components/NewComponentPanel.svelte @@ -31,10 +31,6 @@ $: orderMap = createComponentOrderMap(componentList) const getAllowedComponents = (allComponents, screen, component) => { - // Default to using the root screen container if no component specified - if (!component) { - component = screen.props - } const path = findComponentPath(screen?.props, component?._id) if (!path?.length) { return [] diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/new/_components/componentStructure.json b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/new/_components/componentStructure.json similarity index 100% rename from packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/new/_components/componentStructure.json rename to packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/new/_components/componentStructure.json diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/new/index.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/new/index.svelte similarity index 100% rename from packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/new/index.svelte rename to packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/new/index.svelte diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/index.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/index.svelte new file mode 100644 index 0000000000..f8c4cc0868 --- /dev/null +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/index.svelte @@ -0,0 +1,18 @@ + diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/index.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/index.svelte index c4ed7d949c..f5e3806bd6 100644 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/index.svelte +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/index.svelte @@ -1,6 +1,5 @@ diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/[layoutId]/_components/LayoutDropdownMenu.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/[layoutId]/_components/LayoutDropdownMenu.svelte new file mode 100644 index 0000000000..cba68f899d --- /dev/null +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/[layoutId]/_components/LayoutDropdownMenu.svelte @@ -0,0 +1,41 @@ + + + +
+ +
+ Delete +
+ + + + diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/[layoutId]/_components/LayoutListPanel.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/[layoutId]/_components/LayoutListPanel.svelte new file mode 100644 index 0000000000..cc895317fd --- /dev/null +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/[layoutId]/_components/LayoutListPanel.svelte @@ -0,0 +1,29 @@ + + + +
+ {#each $store.layouts as layout (layout._id)} + store.actions.layouts.select(layout._id)} + > + + + {/each} +
+
+ + diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/[layoutId]/_components/LayoutSettingsPanel.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/[layoutId]/_components/LayoutSettingsPanel.svelte new file mode 100644 index 0000000000..bfc2f94f43 --- /dev/null +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/[layoutId]/_components/LayoutSettingsPanel.svelte @@ -0,0 +1,53 @@ + + + + + + Custom layouts are being deprecated. They will be removed in a future + release. + + + You can save the content of this layout by pressing the button below. + + + This will copy all components inside your layout, which you can then paste + into a screen. + + + + diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/[layoutId]/_layout.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/[layoutId]/_layout.svelte new file mode 100644 index 0000000000..c82fefab3e --- /dev/null +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/[layoutId]/_layout.svelte @@ -0,0 +1,20 @@ + + + diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/[layoutId]/index.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/[layoutId]/index.svelte new file mode 100644 index 0000000000..4d39403bc3 --- /dev/null +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/[layoutId]/index.svelte @@ -0,0 +1,7 @@ + + + + diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/_layout.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/_layout.svelte new file mode 100644 index 0000000000..1333c6afe3 --- /dev/null +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/_layout.svelte @@ -0,0 +1,12 @@ + + + diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/index.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/index.svelte new file mode 100644 index 0000000000..09d45f8fde --- /dev/null +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/index.svelte @@ -0,0 +1,12 @@ + diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/navigation/_components/NavigationInfoPanel.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/navigation/_components/NavigationInfoPanel.svelte new file mode 100644 index 0000000000..614e1eed80 --- /dev/null +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/navigation/_components/NavigationInfoPanel.svelte @@ -0,0 +1,33 @@ + + + + + {#if $selectedScreen.layoutId} + + You can't preview your navigation settings using this screen as it uses + a custom layout, which is deprecated + + {/if} + + Your navigation is configured for all the screens within your app. + + + You can hide and show your navigation for each screen in the screen + settings. + + + diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_components/Navigation/LinksDrawer.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/navigation/_components/NavigationLinksDrawer.svelte similarity index 100% rename from packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_components/Navigation/LinksDrawer.svelte rename to packages/builder/src/pages/builder/app/[application]/design/[screenId]/navigation/_components/NavigationLinksDrawer.svelte diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_components/Navigation/LinksEditor.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/navigation/_components/NavigationLinksEditor.svelte similarity index 75% rename from packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_components/Navigation/LinksEditor.svelte rename to packages/builder/src/pages/builder/app/[application]/design/[screenId]/navigation/_components/NavigationLinksEditor.svelte index b081ea6d72..895c82495d 100644 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_components/Navigation/LinksEditor.svelte +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/navigation/_components/NavigationLinksEditor.svelte @@ -1,6 +1,6 @@ - - + + Configure the links in your navigation bar. diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/navigation/_components/NavigationSettingsPanel.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/navigation/_components/NavigationSettingsPanel.svelte new file mode 100644 index 0000000000..c6d43984b2 --- /dev/null +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/navigation/_components/NavigationSettingsPanel.svelte @@ -0,0 +1,110 @@ + + + + + + + + + update("navigation", "Top")} + /> + update("navigation", "Left")} + /> + + + {#if $store.navigation.navigation === "Top"} + update("sticky", e.detail)} + /> + update("logoUrl", e.detail)} + placeholder="Add logo URL" + updateOnChange={false} + /> + {/if} + + + update("hideTitle", !e.detail)} + /> + {#if !$store.navigation.hideTitle} + update("title", e.detail)} + placeholder="Add title" + updateOnChange={false} + /> + {/if} + + + + update("navBackground", e.detail)} + /> + + + + update("navTextColor", e.detail)} + /> + + + diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/navigation/index.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/navigation/index.svelte new file mode 100644 index 0000000000..fc2e03d8e8 --- /dev/null +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/navigation/index.svelte @@ -0,0 +1,7 @@ + + + + diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/ScreenList/RoleIndicator.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/screens/_components/RoleIndicator.svelte similarity index 87% rename from packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/ScreenList/RoleIndicator.svelte rename to packages/builder/src/pages/builder/app/[application]/design/[screenId]/screens/_components/RoleIndicator.svelte index 694abe444a..2555b0b2a2 100644 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/ScreenList/RoleIndicator.svelte +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/screens/_components/RoleIndicator.svelte @@ -26,7 +26,7 @@ {#if showTooltip}
- +
{/if}
@@ -38,11 +38,13 @@ .tooltip { z-index: 1; position: absolute; - bottom: -5px; - left: 13px; + top: 50%; + left: calc(50% - 8px); + transform: translateX(-100%) translateY(-50%); display: flex; flex-direction: row; justify-content: flex-end; + width: 200px; pointer-events: none; } .tooltip :global(.spectrum-Tooltip) { diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/ScreenList/DropdownMenu.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/screens/_components/ScreenDropdownMenu.svelte similarity index 97% rename from packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/ScreenList/DropdownMenu.svelte rename to packages/builder/src/pages/builder/app/[application]/design/[screenId]/screens/_components/ScreenDropdownMenu.svelte index c117c7e9dd..fd5ddd9459 100644 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/ScreenList/DropdownMenu.svelte +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/screens/_components/ScreenDropdownMenu.svelte @@ -56,7 +56,7 @@ const deleteScreen = async () => { try { await store.actions.screens.delete(screen) - notifications.success("Deleted screen successfully") + notifications.success("Deleted screen successfully.") } catch (err) { notifications.error("Error deleting screen") } diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/screens/_components/ScreenListPanel.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/screens/_components/ScreenListPanel.svelte new file mode 100644 index 0000000000..6362af3073 --- /dev/null +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/screens/_components/ScreenListPanel.svelte @@ -0,0 +1,75 @@ + + + + + + (searchString = e.detail)} + /> + x.name} getOptionValue={x => x.key} diff --git a/packages/builder/src/constants/backend/index.js b/packages/builder/src/constants/backend/index.js index 2c07f8f431..ed0549eeca 100644 --- a/packages/builder/src/constants/backend/index.js +++ b/packages/builder/src/constants/backend/index.js @@ -287,3 +287,9 @@ export const DatasourceTypes = { GRAPH: "Graph", API: "API", } + +export const ROW_EXPORT_FORMATS = { + CSV: "csv", + JSON: "json", + JSON_WITH_SCHEMA: "jsonWithSchema", +} diff --git a/packages/client/src/components/app/forms/InnerForm.svelte b/packages/client/src/components/app/forms/InnerForm.svelte index c0b4b2b8a8..233ea79812 100644 --- a/packages/client/src/components/app/forms/InnerForm.svelte +++ b/packages/client/src/components/app/forms/InnerForm.svelte @@ -136,7 +136,7 @@ // Check arrays - remove any values not present in the field schema and // convert any values supplied to strings if (Array.isArray(value) && type === "array" && schema) { - const options = schema?.constraints.inclusion || [] + const options = schema?.constraints?.inclusion || [] return value.map(opt => String(opt)).filter(opt => options.includes(opt)) } return value diff --git a/packages/server/src/api/controllers/row/index.ts b/packages/server/src/api/controllers/row/index.ts index 7f6f494621..a3e8d55661 100644 --- a/packages/server/src/api/controllers/row/index.ts +++ b/packages/server/src/api/controllers/row/index.ts @@ -92,7 +92,7 @@ export async function fetchView(ctx: any) { () => sdk.rows.fetchView(tableId, viewName, { calculation, - group, + group: calculation ? group : null, field, }), { diff --git a/packages/server/src/api/controllers/view/exporters.ts b/packages/server/src/api/controllers/view/exporters.ts index ec0aca95a9..e707cad0cc 100644 --- a/packages/server/src/api/controllers/view/exporters.ts +++ b/packages/server/src/api/controllers/view/exporters.ts @@ -27,7 +27,7 @@ export function json(rows: Row[]) { export function jsonWithSchema(schema: TableSchema, rows: Row[]) { const newSchema: TableSchema = {} Object.values(schema).forEach(column => { - if (!column.autocolumn) { + if (!column.autocolumn && column.name) { newSchema[column.name] = column } }) From 2f36b2f805fdc3ccb3bd26b1b49ecdbfc0b40d03 Mon Sep 17 00:00:00 2001 From: Dean Date: Thu, 31 Aug 2023 08:51:00 +0100 Subject: [PATCH 020/116] Ensure the default export value is only set once --- .../src/components/backend/DataTable/modals/ExportModal.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/builder/src/components/backend/DataTable/modals/ExportModal.svelte b/packages/builder/src/components/backend/DataTable/modals/ExportModal.svelte index 0fc5fe96e0..09f76d3522 100644 --- a/packages/builder/src/components/backend/DataTable/modals/ExportModal.svelte +++ b/packages/builder/src/components/backend/DataTable/modals/ExportModal.svelte @@ -42,7 +42,7 @@ let exportFormat let filterLookup - $: if (options) { + $: if (options && !exportFormat) { exportFormat = Array.isArray(options) ? options[0]?.key : [] } From 5845884e774dd91122d8d0ffcda03476554692aa Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Fri, 1 Sep 2023 11:30:05 +0100 Subject: [PATCH 021/116] Revert "don't recreate secret after first deploy, bump vm2 deps" --- charts/budibase/templates/secrets.yaml | 3 --- packages/pro | 2 +- packages/server/package.json | 2 +- packages/string-templates/package.json | 2 +- yarn.lock | 16 ++++++++++++---- 5 files changed, 15 insertions(+), 10 deletions(-) diff --git a/charts/budibase/templates/secrets.yaml b/charts/budibase/templates/secrets.yaml index e42a276f1d..1c0a914ed3 100644 --- a/charts/budibase/templates/secrets.yaml +++ b/charts/budibase/templates/secrets.yaml @@ -1,6 +1,4 @@ {{- if .Values.globals.createSecrets -}} -{{- $existingSecret := lookup "v1" "Secret" .Release.Namespace (include "budibase.fullname" .) -}} -{{- if not $existingSecret -}} apiVersion: v1 kind: Secret metadata: @@ -17,4 +15,3 @@ data: objectStoreAccess: {{ template "budibase.defaultsecret" .Values.services.objectStore.accessKey }} objectStoreSecret: {{ template "budibase.defaultsecret" .Values.services.objectStore.secretKey }} {{- end -}} -{{- end -}} \ No newline at end of file diff --git a/packages/pro b/packages/pro index 02626390cd..b7815e099b 160000 --- a/packages/pro +++ b/packages/pro @@ -1 +1 @@ -Subproject commit 02626390cde905a248cb60729968667c9e49fae9 +Subproject commit b7815e099bbd5e1410185c464dbd54f7287e732f diff --git a/packages/server/package.json b/packages/server/package.json index c2eea18068..7d0d8f5feb 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -122,7 +122,7 @@ "to-json-schema": "0.2.5", "uuid": "3.3.2", "validate.js": "0.13.1", - "vm2": "^3.9.19", + "vm2": "3.9.17", "worker-farm": "1.7.0", "xml2js": "0.5.0", "yargs": "13.2.4" diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index 242edc83a9..4dc4c17ad8 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -30,7 +30,7 @@ "handlebars": "^4.7.6", "handlebars-utils": "^1.0.6", "lodash": "^4.17.20", - "vm2": "^3.9.19" + "vm2": "^3.9.15" }, "devDependencies": { "@rollup/plugin-commonjs": "^17.1.0", diff --git a/yarn.lock b/yarn.lock index a4f0e91e31..827c94a176 100644 --- a/yarn.lock +++ b/yarn.lock @@ -24984,10 +24984,18 @@ vlq@^0.2.2: resolved "https://registry.yarnpkg.com/vlq/-/vlq-0.2.3.tgz#8f3e4328cf63b1540c0d67e1b2778386f8975b26" integrity sha512-DRibZL6DsNhIgYQ+wNdWDL2SL3bKPlVrRiBqV5yuMm++op8W4kGFtaQfCs4KEJn0wBZcHVHJ3eoywX8983k1ow== -vm2@^3.9.19: - version "3.9.19" - resolved "https://registry.yarnpkg.com/vm2/-/vm2-3.9.19.tgz#be1e1d7a106122c6c492b4d51c2e8b93d3ed6a4a" - integrity sha512-J637XF0DHDMV57R6JyVsTak7nIL8gy5KH4r1HiwWLf/4GBbb5MKL5y7LpmF4A8E2nR6XmzpmMFQ7V7ppPTmUQg== +vm2@3.9.17: + version "3.9.17" + resolved "https://registry.yarnpkg.com/vm2/-/vm2-3.9.17.tgz#251b165ff8a0e034942b5181057305e39570aeab" + integrity sha512-AqwtCnZ/ERcX+AVj9vUsphY56YANXxRuqMb7GsDtAr0m0PcQX3u0Aj3KWiXM0YAHy7i6JEeHrwOnwXbGYgRpAw== + dependencies: + acorn "^8.7.0" + acorn-walk "^8.2.0" + +vm2@^3.9.15: + version "3.9.16" + resolved "https://registry.yarnpkg.com/vm2/-/vm2-3.9.16.tgz#0fbc2a265f7bf8b837cea6f4a908f88a3f93b8e6" + integrity sha512-3T9LscojNTxdOyG+e8gFeyBXkMlOBYDoF6dqZbj+MPVHi9x10UfiTAJIobuchRCp3QvC+inybTbMJIUrLsig0w== dependencies: acorn "^8.7.0" acorn-walk "^8.2.0" From 3d7a2d4ba942e371f597143b71a7ff27bdaced11 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 1 Sep 2023 11:49:46 +0100 Subject: [PATCH 022/116] Ensure resourceId is specified when creating default table datasources --- packages/builder/src/builderStore/store/frontend.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/builder/src/builderStore/store/frontend.js b/packages/builder/src/builderStore/store/frontend.js index f6cecb856c..5997c69151 100644 --- a/packages/builder/src/builderStore/store/frontend.js +++ b/packages/builder/src/builderStore/store/frontend.js @@ -627,6 +627,7 @@ export const getFrontendStore = () => { component[setting.key] = { label: defaultDS.name, tableId: defaultDS._id, + resourceId: defaultDS._id, type: "table", } } else if (setting.type === "dataProvider") { From fae3943ba8ceb243eb32f962888f5e85dde1dd6c Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Fri, 1 Sep 2023 10:56:59 +0000 Subject: [PATCH 023/116] Bump version to 2.9.35 --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index d85b8c732b..d9ba006b50 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.9.34", + "version": "2.9.35", "npmClient": "yarn", "packages": [ "packages/*" From 64af5493415144b14d0accf58d818cd58d9e5481 Mon Sep 17 00:00:00 2001 From: Rory Powell Date: Fri, 1 Sep 2023 15:12:23 +0100 Subject: [PATCH 024/116] Revert "Merge pull request #11489 from Budibase/fix/automation-disable" This reverts commit e6319cce675e7674c11df5dadbdc769d0f49bc0e, reversing changes made to 7c12280fe398bce4ef0b3e2c22ef852d344c0f69. --- .../backend-core/src/db/couch/DatabaseImpl.ts | 14 ---- .../server/src/api/controllers/application.ts | 4 +- .../server/src/api/controllers/automation.ts | 29 ++++---- packages/server/src/automations/triggers.ts | 4 +- packages/server/src/automations/utils.ts | 67 +++++++------------ .../src/sdk/app/automations/automations.ts | 38 ----------- .../server/src/sdk/app/automations/index.ts | 2 - packages/server/src/threads/automation.ts | 42 +++--------- .../types/src/documents/app/automation.ts | 5 -- packages/types/src/sdk/db.ts | 6 -- 10 files changed, 55 insertions(+), 156 deletions(-) delete mode 100644 packages/server/src/sdk/app/automations/automations.ts diff --git a/packages/backend-core/src/db/couch/DatabaseImpl.ts b/packages/backend-core/src/db/couch/DatabaseImpl.ts index 89f76769b3..29ca4123f5 100644 --- a/packages/backend-core/src/db/couch/DatabaseImpl.ts +++ b/packages/backend-core/src/db/couch/DatabaseImpl.ts @@ -8,7 +8,6 @@ import { DatabasePutOpts, DatabaseCreateIndexOpts, DatabaseDeleteIndexOpts, - DocExistsResponse, Document, isDocument, } from "@budibase/types" @@ -121,19 +120,6 @@ export class DatabaseImpl implements Database { return this.updateOutput(() => db.get(id)) } - async docExists(docId: string): Promise { - const db = await this.checkSetup() - let _rev, exists - try { - const { etag } = await db.head(docId) - _rev = etag - exists = true - } catch (err) { - exists = false - } - return { _rev, exists } - } - async remove(idOrDoc: string | Document, rev?: string) { const db = await this.checkSetup() let _id: string diff --git a/packages/server/src/api/controllers/application.ts b/packages/server/src/api/controllers/application.ts index f8b6bd6d16..c5556479fe 100644 --- a/packages/server/src/api/controllers/application.ts +++ b/packages/server/src/api/controllers/application.ts @@ -39,8 +39,9 @@ import { } from "../../db/defaultData/datasource_bb_default" import { removeAppFromUserRoles } from "../../utilities/workerRequests" import { stringToReadStream } from "../../utilities" -import { doesUserHaveLock } from "../../utilities/redis" +import { doesUserHaveLock, getLocksById } from "../../utilities/redis" import { cleanupAutomations } from "../../automations/utils" +import { checkAppMetadata } from "../../automations/logging" import { getUniqueRows } from "../../utilities/usageQuota/rows" import { groups, licensing, quotas } from "@budibase/pro" import { @@ -50,6 +51,7 @@ import { PlanType, Screen, UserCtx, + ContextUser, } from "@budibase/types" import { BASE_LAYOUT_PROP_IDS } from "../../constants/layouts" import sdk from "../../sdk" diff --git a/packages/server/src/api/controllers/automation.ts b/packages/server/src/api/controllers/automation.ts index c861782a02..a4697f99f2 100644 --- a/packages/server/src/api/controllers/automation.ts +++ b/packages/server/src/api/controllers/automation.ts @@ -20,7 +20,7 @@ import { Automation, AutomationActionStepId, AutomationResults, - Ctx, + BBContext, } from "@budibase/types" import { getActionDefinitions as actionDefs } from "../../automations/actions" import sdk from "../../sdk" @@ -73,7 +73,7 @@ function cleanAutomationInputs(automation: Automation) { return automation } -export async function create(ctx: Ctx) { +export async function create(ctx: BBContext) { const db = context.getAppDB() let automation = ctx.request.body automation.appId = ctx.appId @@ -142,7 +142,7 @@ export async function handleStepEvents( } } -export async function update(ctx: Ctx) { +export async function update(ctx: BBContext) { const db = context.getAppDB() let automation = ctx.request.body automation.appId = ctx.appId @@ -193,7 +193,7 @@ export async function update(ctx: Ctx) { builderSocket?.emitAutomationUpdate(ctx, automation) } -export async function fetch(ctx: Ctx) { +export async function fetch(ctx: BBContext) { const db = context.getAppDB() const response = await db.allDocs( getAutomationParams(null, { @@ -203,11 +203,12 @@ export async function fetch(ctx: Ctx) { ctx.body = response.rows.map(row => row.doc) } -export async function find(ctx: Ctx) { - ctx.body = await sdk.automations.get(ctx.params.id) +export async function find(ctx: BBContext) { + const db = context.getAppDB() + ctx.body = await db.get(ctx.params.id) } -export async function destroy(ctx: Ctx) { +export async function destroy(ctx: BBContext) { const db = context.getAppDB() const automationId = ctx.params.id const oldAutomation = await db.get(automationId) @@ -221,11 +222,11 @@ export async function destroy(ctx: Ctx) { builderSocket?.emitAutomationDeletion(ctx, automationId) } -export async function logSearch(ctx: Ctx) { +export async function logSearch(ctx: BBContext) { ctx.body = await automations.logs.logSearch(ctx.request.body) } -export async function clearLogError(ctx: Ctx) { +export async function clearLogError(ctx: BBContext) { const { automationId, appId } = ctx.request.body await context.doInAppContext(appId, async () => { const db = context.getProdAppDB() @@ -244,15 +245,15 @@ export async function clearLogError(ctx: Ctx) { }) } -export async function getActionList(ctx: Ctx) { +export async function getActionList(ctx: BBContext) { ctx.body = await getActionDefinitions() } -export async function getTriggerList(ctx: Ctx) { +export async function getTriggerList(ctx: BBContext) { ctx.body = getTriggerDefinitions() } -export async function getDefinitionList(ctx: Ctx) { +export async function getDefinitionList(ctx: BBContext) { ctx.body = { trigger: getTriggerDefinitions(), action: await getActionDefinitions(), @@ -265,7 +266,7 @@ export async function getDefinitionList(ctx: Ctx) { * * *********************/ -export async function trigger(ctx: Ctx) { +export async function trigger(ctx: BBContext) { const db = context.getAppDB() let automation = await db.get(ctx.params.id) @@ -310,7 +311,7 @@ function prepareTestInput(input: any) { return input } -export async function test(ctx: Ctx) { +export async function test(ctx: BBContext) { const db = context.getAppDB() let automation = await db.get(ctx.params.id) await setTestFlag(automation._id!) diff --git a/packages/server/src/automations/triggers.ts b/packages/server/src/automations/triggers.ts index 9cc8c6b077..922bc10343 100644 --- a/packages/server/src/automations/triggers.ts +++ b/packages/server/src/automations/triggers.ts @@ -6,11 +6,11 @@ import { isDevAppID } from "../db/utils" // need this to call directly, so we can get a response import { automationQueue } from "./bullboard" import { checkTestFlag } from "../utilities/redis" +import * as utils from "./utils" import env from "../environment" import { context, db as dbCore } from "@budibase/backend-core" import { Automation, Row, AutomationData, AutomationJob } from "@budibase/types" import { executeSynchronously } from "../threads/automation" -import sdk from "../sdk" export const TRIGGER_DEFINITIONS = definitions const JOB_OPTS = { @@ -142,7 +142,7 @@ export async function rebootTrigger() { let automations = await getAllAutomations() let rebootEvents = [] for (let automation of automations) { - if (sdk.automations.isReboot(automation)) { + if (utils.isRebootTrigger(automation)) { const job = { automation, event: { diff --git a/packages/server/src/automations/utils.ts b/packages/server/src/automations/utils.ts index 7b0ab4f2fd..194eff5b32 100644 --- a/packages/server/src/automations/utils.ts +++ b/packages/server/src/automations/utils.ts @@ -16,14 +16,13 @@ import { } from "@budibase/types" import sdk from "../sdk" +const REBOOT_CRON = "@reboot" const WH_STEP_ID = definitions.WEBHOOK.stepId +const CRON_STEP_ID = definitions.CRON.stepId const Runner = new Thread(ThreadType.AUTOMATION) -function loggingArgs( - job: AutomationJob, - timing?: { start: number; complete?: boolean } -) { - const logs: any[] = [ +function loggingArgs(job: AutomationJob) { + return [ { _logKey: "automation", trigger: job.data.automation.definition.trigger.event, @@ -33,53 +32,24 @@ function loggingArgs( jobId: job.id, }, ] - if (timing?.start) { - logs.push({ - _logKey: "startTime", - start: timing.start, - }) - } - if (timing?.start && timing?.complete) { - const end = new Date().getTime() - const duration = end - timing.start - logs.push({ - _logKey: "endTime", - end, - }) - logs.push({ - _logKey: "duration", - duration, - }) - } - return logs } export async function processEvent(job: AutomationJob) { const appId = job.data.event.appId! const automationId = job.data.automation._id! - const start = new Date().getTime() const task = async () => { try { // need to actually await these so that an error can be captured properly - console.log("automation running", ...loggingArgs(job, { start })) + console.log("automation running", ...loggingArgs(job)) const runFn = () => Runner.run(job) const result = await quotas.addAutomation(runFn, { automationId, }) - const end = new Date().getTime() - const duration = end - start - console.log( - "automation completed", - ...loggingArgs(job, { start, complete: true }) - ) + console.log("automation completed", ...loggingArgs(job)) return result } catch (err) { - console.error( - `automation was unable to run`, - err, - ...loggingArgs(job, { start, complete: true }) - ) + console.error(`automation was unable to run`, err, ...loggingArgs(job)) return { err } } } @@ -158,6 +128,19 @@ export async function clearMetadata() { await db.bulkDocs(automationMetadata) } +export function isCronTrigger(auto: Automation) { + return ( + auto && + auto.definition.trigger && + auto.definition.trigger.stepId === CRON_STEP_ID + ) +} + +export function isRebootTrigger(auto: Automation) { + const trigger = auto ? auto.definition.trigger : null + return isCronTrigger(auto) && trigger?.inputs.cron === REBOOT_CRON +} + /** * This function handles checking of any cron jobs that need to be enabled/updated. * @param {string} appId The ID of the app in which we are checking for webhooks @@ -165,13 +148,13 @@ export async function clearMetadata() { */ export async function enableCronTrigger(appId: any, automation: Automation) { const trigger = automation ? automation.definition.trigger : null - const validCron = sdk.automations.isCron(automation) && trigger?.inputs.cron - const needsCreated = - !sdk.automations.isReboot(automation) && - !sdk.automations.disabled(automation) // need to create cron job - if (validCron && needsCreated) { + if ( + isCronTrigger(automation) && + !isRebootTrigger(automation) && + trigger?.inputs.cron + ) { // make a job id rather than letting Bull decide, makes it easier to handle on way out const jobId = `${appId}_cron_${newid()}` const job: any = await automationQueue.add( diff --git a/packages/server/src/sdk/app/automations/automations.ts b/packages/server/src/sdk/app/automations/automations.ts deleted file mode 100644 index 80f84c90e2..0000000000 --- a/packages/server/src/sdk/app/automations/automations.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { context } from "@budibase/backend-core" -import { Automation, AutomationState, DocumentType } from "@budibase/types" -import { definitions } from "../../../automations/triggerInfo" - -const REBOOT_CRON = "@reboot" - -export async function exists(automationId: string) { - if (!automationId?.startsWith(DocumentType.AUTOMATION)) { - throw new Error("Invalid automation ID.") - } - const db = context.getAppDB() - return db.docExists(automationId) -} - -export async function get(automationId: string) { - const db = context.getAppDB() - return (await db.get(automationId)) as Automation -} - -export function disabled(automation: Automation) { - return automation.state === AutomationState.DISABLED || !hasSteps(automation) -} - -export function isCron(automation: Automation) { - return ( - automation?.definition.trigger && - automation?.definition.trigger.stepId === definitions.CRON.stepId - ) -} - -export function isReboot(automation: Automation) { - const trigger = automation?.definition.trigger - return isCron(automation) && trigger?.inputs.cron === REBOOT_CRON -} - -export function hasSteps(automation: Automation) { - return automation?.definition?.steps?.length > 0 -} diff --git a/packages/server/src/sdk/app/automations/index.ts b/packages/server/src/sdk/app/automations/index.ts index 540d5545fc..16530cf085 100644 --- a/packages/server/src/sdk/app/automations/index.ts +++ b/packages/server/src/sdk/app/automations/index.ts @@ -1,9 +1,7 @@ import * as webhook from "./webhook" import * as utils from "./utils" -import * as automations from "./automations" export default { webhook, utils, - ...automations, } diff --git a/packages/server/src/threads/automation.ts b/packages/server/src/threads/automation.ts index 8bf0b506fe..bc0629a939 100644 --- a/packages/server/src/threads/automation.ts +++ b/packages/server/src/threads/automation.ts @@ -2,9 +2,9 @@ import { default as threadUtils } from "./utils" import { Job } from "bull" threadUtils.threadSetup() import { + isRecurring, disableCronById, isErrorInOutput, - isRecurring, } from "../automations/utils" import * as actions from "../automations/actions" import * as automationUtils from "../automations/automationUtils" @@ -15,17 +15,17 @@ import { AutomationErrors, MAX_AUTOMATION_RECURRING_ERRORS } from "../constants" import { storeLog } from "../automations/logging" import { Automation, - AutomationData, - AutomationJob, - AutomationMetadata, - AutomationStatus, AutomationStep, + AutomationStatus, + AutomationMetadata, + AutomationJob, + AutomationData, } from "@budibase/types" import { - AutomationContext, - LoopInput, LoopStep, + LoopInput, TriggerOutput, + AutomationContext, } from "../definitions/automations" import { WorkerCallback } from "./definitions" import { context, logging } from "@budibase/backend-core" @@ -34,8 +34,6 @@ import { cloneDeep } from "lodash/fp" import { performance } from "perf_hooks" import * as sdkUtils from "../sdk/utils" import env from "../environment" -import sdk from "../sdk" - const FILTER_STEP_ID = actions.BUILTIN_ACTION_DEFINITIONS.FILTER.stepId const LOOP_STEP_ID = actions.BUILTIN_ACTION_DEFINITIONS.LOOP.stepId const CRON_STEP_ID = triggerDefs.CRON.stepId @@ -516,8 +514,7 @@ class Orchestrator { export function execute(job: Job, callback: WorkerCallback) { const appId = job.data.event.appId - const automation = job.data.automation - const automationId = automation._id + const automationId = job.data.automation._id if (!appId) { throw new Error("Unable to execute, event doesn't contain app ID.") } @@ -528,30 +525,10 @@ export function execute(job: Job, callback: WorkerCallback) { appId, automationId, task: async () => { - let automation = job.data.automation, - isCron = sdk.automations.isCron(job.data.automation), - notFound = false - try { - automation = await sdk.automations.get(automationId) - } catch (err: any) { - // automation no longer exists - notFound = err - } - const disabled = sdk.automations.disabled(automation) - const stopAutomation = disabled || notFound const envVars = await sdkUtils.getEnvironmentVariables() // put into automation thread for whole context await context.doInEnvironmentContext(envVars, async () => { const automationOrchestrator = new Orchestrator(job) - // hard stop on automations - if (isCron && stopAutomation) { - await automationOrchestrator.stopCron( - disabled ? "disabled" : "not_found" - ) - } - if (stopAutomation) { - return - } try { const response = await automationOrchestrator.execute() callback(null, response) @@ -580,10 +557,11 @@ export function executeSynchronously(job: Job) { // put into automation thread for whole context return context.doInEnvironmentContext(envVars, async () => { const automationOrchestrator = new Orchestrator(job) - return await Promise.race([ + const response = await Promise.race([ automationOrchestrator.execute(), timeoutPromise, ]) + return response }) }) } diff --git a/packages/types/src/documents/app/automation.ts b/packages/types/src/documents/app/automation.ts index 05ac76d5e9..d1dbbec21b 100644 --- a/packages/types/src/documents/app/automation.ts +++ b/packages/types/src/documents/app/automation.ts @@ -100,10 +100,6 @@ export const AutomationStepIdArray = [ ...Object.values(AutomationTriggerStepId), ] -export enum AutomationState { - DISABLED = "disabled", -} - export interface Automation extends Document { definition: { steps: AutomationStep[] @@ -116,7 +112,6 @@ export interface Automation extends Document { name: string internal?: boolean type?: string - state?: AutomationState } interface BaseIOStructure { diff --git a/packages/types/src/sdk/db.ts b/packages/types/src/sdk/db.ts index 9ac8ff26d4..e07cc82fd2 100644 --- a/packages/types/src/sdk/db.ts +++ b/packages/types/src/sdk/db.ts @@ -40,11 +40,6 @@ export type DatabasePutOpts = { force?: boolean } -export type DocExistsResponse = { - _rev?: string - exists: boolean -} - export type DatabaseCreateIndexOpts = { index: { fields: string[] @@ -95,7 +90,6 @@ export interface Database { exists(): Promise checkSetup(): Promise> get(id?: string): Promise - docExists(id: string): Promise remove( id: string | Document, rev?: string From 9444b01756b6b3b3ccf3aeff6a8c8f851c70f0d9 Mon Sep 17 00:00:00 2001 From: Rory Powell Date: Fri, 1 Sep 2023 15:23:47 +0100 Subject: [PATCH 025/116] Update pro ref --- packages/pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/pro b/packages/pro index b7815e099b..02626390cd 160000 --- a/packages/pro +++ b/packages/pro @@ -1 +1 @@ -Subproject commit b7815e099bbd5e1410185c464dbd54f7287e732f +Subproject commit 02626390cde905a248cb60729968667c9e49fae9 From 7e90fb9e24a56f20d1b7f24958effa9e1fdd2cc1 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Fri, 1 Sep 2023 14:37:21 +0000 Subject: [PATCH 026/116] Bump version to 2.9.36 --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index d9ba006b50..591cee8b09 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.9.35", + "version": "2.9.36", "npmClient": "yarn", "packages": [ "packages/*" From 18a159e91217eda10db2dca0bcbce1466936a1f3 Mon Sep 17 00:00:00 2001 From: Mitch-Budibase Date: Fri, 1 Sep 2023 15:43:07 +0100 Subject: [PATCH 027/116] Add assertion for self response We want to ensure that the self response contains the email of the created account --- qa-core/src/account-api/tests/accounts/accounts.cloud.spec.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qa-core/src/account-api/tests/accounts/accounts.cloud.spec.ts b/qa-core/src/account-api/tests/accounts/accounts.cloud.spec.ts index a0b5198f03..0969b72cf9 100644 --- a/qa-core/src/account-api/tests/accounts/accounts.cloud.spec.ts +++ b/qa-core/src/account-api/tests/accounts/accounts.cloud.spec.ts @@ -52,7 +52,8 @@ describe("Accounts", () => { await config.loginAsAccount(createAccountRequest) // Verify self response matches account - await config.api.accounts.self() + const [selfRes, selfBody] = await config.api.accounts.self() + expect(selfBody.email).toBe(email) // Delete account await config.api.accounts.deleteCurrentAccount() From 401c12732f394d36b76628c5063f9bb3398cdf50 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Mon, 4 Sep 2023 08:37:24 +0100 Subject: [PATCH 028/116] Fix datasource definitions to ensure they work with both tables and views, for both type datasource and type table, and fix bindings --- .../store/screenTemplates/rowListScreen.js | 10 +++---- .../settings/controls/TableSelect.svelte | 7 ++--- .../NewScreen/DatasourceModal.svelte | 26 +++++++------------ .../NewScreen/DatasourceTemplateRow.svelte | 2 +- 4 files changed, 20 insertions(+), 25 deletions(-) diff --git a/packages/builder/src/builderStore/store/screenTemplates/rowListScreen.js b/packages/builder/src/builderStore/store/screenTemplates/rowListScreen.js index 54dd38ac63..bbefe65fc8 100644 --- a/packages/builder/src/builderStore/store/screenTemplates/rowListScreen.js +++ b/packages/builder/src/builderStore/store/screenTemplates/rowListScreen.js @@ -8,7 +8,7 @@ export default function (datasources) { } return datasources.map(datasource => { return { - name: `${datasource.name} - List`, + name: `${datasource.label} - List`, create: () => createScreen(datasource), id: ROW_LIST_TEMPLATE, resourceId: datasource.resourceId, @@ -17,13 +17,13 @@ export default function (datasources) { } export const ROW_LIST_TEMPLATE = "ROW_LIST_TEMPLATE" -export const rowListUrl = datasource => sanitizeUrl(`/${datasource.name}`) +export const rowListUrl = datasource => sanitizeUrl(`/${datasource.label}`) const generateTableBlock = datasource => { const tableBlock = new Component("@budibase/standard-components/tableblock") tableBlock .customProps({ - title: datasource.name, + title: datasource.label, dataSource: datasource, sortOrder: "Ascending", size: "spectrum--medium", @@ -34,14 +34,14 @@ const generateTableBlock = datasource => { titleButtonText: "Create row", titleButtonClickBehaviour: "new", }) - .instanceName(`${datasource.name} - Table block`) + .instanceName(`${datasource.label} - Table block`) return tableBlock } const createScreen = datasource => { return new Screen() .route(rowListUrl(datasource)) - .instanceName(`${datasource.name} - List`) + .instanceName(`${datasource.label} - List`) .addChild(generateTableBlock(datasource)) .json() } diff --git a/packages/builder/src/components/design/settings/controls/TableSelect.svelte b/packages/builder/src/components/design/settings/controls/TableSelect.svelte index 4a6f33202b..da50ad8c2a 100644 --- a/packages/builder/src/components/design/settings/controls/TableSelect.svelte +++ b/packages/builder/src/components/design/settings/controls/TableSelect.svelte @@ -8,15 +8,16 @@ const dispatch = createEventDispatcher() $: tables = $tablesStore.list.map(table => ({ - ...table, type: "table", label: table.name, + tableId: table._id, resourceId: table._id, })) $: views = $viewsV2.list.map(view => ({ - ...view, type: "viewV2", + id: view.id, label: view.name, + tableId: view.tableId, resourceId: view.id, })) $: options = [...(tables || []), ...(views || [])] @@ -32,7 +33,7 @@ // Migrate old values before "resourceId" existed if (value && !value.resourceId) { const view = views.find(x => x.resourceId === value.id) - const table = tables.find(x => x.resourceId === value._id) + const table = tables.find(x => x.resourceId === value.tableId) dispatch("change", view || table) } }) diff --git a/packages/builder/src/pages/builder/app/[application]/design/_components/NewScreen/DatasourceModal.svelte b/packages/builder/src/pages/builder/app/[application]/design/_components/NewScreen/DatasourceModal.svelte index fc6601178a..a866cd23d4 100644 --- a/packages/builder/src/pages/builder/app/[application]/design/_components/NewScreen/DatasourceModal.svelte +++ b/packages/builder/src/pages/builder/app/[application]/design/_components/NewScreen/DatasourceModal.svelte @@ -75,43 +75,37 @@ {@const views = Object.values(table.views || {}).filter( view => view.version === 2 )} - {@const datasource = { - ...table, - // Legacy properties + {@const tableDS = { tableId: table._id, label: table.name, - // New consistent properties resourceId: table._id, - name: table.name, type: "table", }} {@const selected = selectedScreens.find( - screen => screen.resourceId === datasource.resourceId + screen => screen.resourceId === tableDS.resourceId )} toggleSelection(datasource)} + on:click={() => toggleSelection(tableDS)} {selected} - {datasource} + datasource={tableDS} /> {#each views as view} - {@const datasource = { - ...view, - // Legacy properties + {@const viewDS = { label: view.name, - // New consistent properties + id: view.id, resourceId: view.id, - name: view.name, + tableId: view.tableId, type: "viewV2", }} {@const selected = selectedScreens.find( - x => x.resourceId === datasource.resourceId + x => x.resourceId === viewDS.resourceId )} toggleSelection(datasource)} + on:click={() => toggleSelection(viewDS)} {selected} - {datasource} + datasource={viewDS} /> {/each} {/each} diff --git a/packages/builder/src/pages/builder/app/[application]/design/_components/NewScreen/DatasourceTemplateRow.svelte b/packages/builder/src/pages/builder/app/[application]/design/_components/NewScreen/DatasourceTemplateRow.svelte index 5a05c8d198..dac0aaed6e 100644 --- a/packages/builder/src/pages/builder/app/[application]/design/_components/NewScreen/DatasourceTemplateRow.svelte +++ b/packages/builder/src/pages/builder/app/[application]/design/_components/NewScreen/DatasourceTemplateRow.svelte @@ -8,7 +8,7 @@
- {datasource.name} + {datasource.label} {#if selected} From cf33680b1e6710bddbfbd78d7e2695bc2b20cc6a Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Mon, 4 Sep 2023 09:05:33 +0100 Subject: [PATCH 029/116] Fix crash when converting form fields with a schema that doesn't contain a certain field --- packages/builder/src/builderStore/dataBinding.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/builder/src/builderStore/dataBinding.js b/packages/builder/src/builderStore/dataBinding.js index d2f354a361..efd56e9d4b 100644 --- a/packages/builder/src/builderStore/dataBinding.js +++ b/packages/builder/src/builderStore/dataBinding.js @@ -955,7 +955,9 @@ export const buildFormSchema = (component, asset) => { const patched = convertOldFieldFormat(component.fields || []) patched?.forEach(({ field, active }) => { if (!active) return - schema[field] = { type: info?.schema[field].type } + if (info?.schema[field]) { + schema[field] = { type: info?.schema[field].type } + } }) } From 190e29e043f36dbcc11a3b4d357a2ca4f350612a Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Mon, 4 Sep 2023 09:36:48 +0100 Subject: [PATCH 030/116] fix issue with counting of groups and apps --- .../src/pages/builder/portal/users/groups/[groupId].svelte | 4 ++-- .../portal/users/users/_components/AppsTableRenderer.svelte | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/builder/src/pages/builder/portal/users/groups/[groupId].svelte b/packages/builder/src/pages/builder/portal/users/groups/[groupId].svelte index 793ba5c09f..4c1bb661fd 100644 --- a/packages/builder/src/pages/builder/portal/users/groups/[groupId].svelte +++ b/packages/builder/src/pages/builder/portal/users/groups/[groupId].svelte @@ -46,7 +46,7 @@ let loaded = false let editModal, deleteModal - $: console.log(group) + $: scimEnabled = $features.isScimEnabled $: readonly = !sdk.users.isAdmin($auth.user) || scimEnabled $: group = $groups.find(x => x._id === groupId) @@ -62,7 +62,7 @@ ? Constants.Roles.CREATOR : group?.roles?.[apps.getProdAppID(app.devId)], })) - $: console.log(groupApps) + $: { if (loaded && !group?._id) { $goto("./") diff --git a/packages/builder/src/pages/builder/portal/users/users/_components/AppsTableRenderer.svelte b/packages/builder/src/pages/builder/portal/users/users/_components/AppsTableRenderer.svelte index b7bb810aba..9dda0dbab2 100644 --- a/packages/builder/src/pages/builder/portal/users/users/_components/AppsTableRenderer.svelte +++ b/packages/builder/src/pages/builder/portal/users/users/_components/AppsTableRenderer.svelte @@ -5,7 +5,6 @@ export let value export let row - $: console.log(row) $: priviliged = sdk.users.isAdminOrBuilder(row) $: count = getCount(row) From 24abd91600d4bf963874f3de62cb98de0e265421 Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Mon, 4 Sep 2023 09:37:10 +0100 Subject: [PATCH 031/116] Fix issue around adding of admin users --- .../_components/BuilderSidePanel.svelte | 42 ++++++++++++++----- packages/frontend-core/src/api/user.js | 3 ++ .../src/api/controllers/global/users.ts | 11 +++-- 3 files changed, 43 insertions(+), 13 deletions(-) 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 3e6741e920..477083f822 100644 --- a/packages/builder/src/pages/builder/app/[application]/_components/BuilderSidePanel.svelte +++ b/packages/builder/src/pages/builder/app/[application]/_components/BuilderSidePanel.svelte @@ -366,18 +366,21 @@ const payload = [ { email: newUserEmail, - builder: !!creationRoleType === Constants.BudibaseRoles.Admin, - admin: !!creationRoleType === Constants.BudibaseRoles.Admin, + builder: creationRoleType === Constants.BudibaseRoles.Admin, + admin: creationRoleType === Constants.BudibaseRoles.Admin, }, ] - if (creationAccessType === Constants.Roles.CREATOR) { - payload[0].appBuilders = [prodAppId] - } else { - payload[0].apps = { - [prodAppId]: creationAccessType, + if (creationRoleType !== Constants.BudibaseRoles.Admin) { + if (creationAccessType === Constants.Roles.CREATOR) { + payload[0].appBuilders = [prodAppId] + } else { + payload[0].apps = { + [prodAppId]: creationAccessType, + } } } + let userInviteResponse try { userInviteResponse = await users.onboard(payload) @@ -494,6 +497,18 @@ } } + const getInviteRoleValue = invite => { + if (invite.info?.admin?.global && invite.info?.builder?.global) { + return Constants.Roles.ADMIN + } + + if (invite.info?.appBuilders?.includes(prodAppId)) { + return Constants.Roles.CREATOR + } + + return invite.info.apps?.[prodAppId] + } + const getRoleFooter = user => { if (user.group) { const role = $roles.find(role => role._id === user.role) @@ -600,6 +615,11 @@
Access
{#each filteredInvites as invite} + {@const user = { + isAdminOrGlobalBuilder: + invite.info?.admin?.global && invite.info?.builder?.global, + }} +
@@ -608,10 +628,9 @@
diff --git a/packages/frontend-core/src/api/user.js b/packages/frontend-core/src/api/user.js index 329e9cc499..98c2bc598a 100644 --- a/packages/frontend-core/src/api/user.js +++ b/packages/frontend-core/src/api/user.js @@ -153,10 +153,13 @@ export const buildUserEndpoints = API => ({ }, onboardUsers: async payload => { + console.log(payload) return await API.post({ url: "/api/global/users/onboard", body: payload.map(invite => { const { email, admin, builder, apps, appBuilders } = invite + console.log(admin) + console.log(builder) return { email, userInfo: { diff --git a/packages/worker/src/api/controllers/global/users.ts b/packages/worker/src/api/controllers/global/users.ts index 0ccf9a356f..eb14c13119 100644 --- a/packages/worker/src/api/controllers/global/users.ts +++ b/packages/worker/src/api/controllers/global/users.ts @@ -266,7 +266,9 @@ export const onboardUsers = async (ctx: Ctx) => { // Temp password to be passed to the user. createdPasswords[invite.email] = password - let builder: { global: boolean; apps?: string[] } = { global: false } + let builder: { global: boolean; apps?: string[] } = { + global: invite.userInfo.builder || false, + } if (invite.userInfo.appBuilders) { builder.apps = invite.userInfo.appBuilders } @@ -275,7 +277,7 @@ export const onboardUsers = async (ctx: Ctx) => { password, forceResetPassword: true, roles: invite.userInfo.apps, - admin: { global: false }, + admin: { global: invite.userInfo.admin || false }, builder, tenantId: tenancy.getTenantId(), } @@ -409,10 +411,13 @@ export const inviteAccept = async ( lastName, password, email, + admin: { global: info.admin || false }, roles: info.apps, tenantId: info.tenantId, } - let builder: { global: boolean; apps?: string[] } = { global: false } + let builder: { global: boolean; apps?: string[] } = { + global: info.builder || false, + } if (info.appBuilders) { builder.apps = info.appBuilders From 7ee0c0e3d32acb76e263c4d5dac3e6a24fe3ea96 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Mon, 4 Sep 2023 10:03:26 +0000 Subject: [PATCH 032/116] Bump version to 2.9.37 --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index 591cee8b09..f83e8e3dfe 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.9.36", + "version": "2.9.37", "npmClient": "yarn", "packages": [ "packages/*" From fc0ee3f462bf1eac4d257bef3bece8a74bf8c6a4 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Mon, 4 Sep 2023 13:23:21 +0200 Subject: [PATCH 033/116] Types --- packages/backend-core/src/db/db.ts | 6 +++++- packages/backend-core/src/security/roles.ts | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/backend-core/src/db/db.ts b/packages/backend-core/src/db/db.ts index f13eb9a965..9aae64b892 100644 --- a/packages/backend-core/src/db/db.ts +++ b/packages/backend-core/src/db/db.ts @@ -11,7 +11,11 @@ export function getDB(dbName?: string, opts?: any): Database { // we have to use a callback for this so that we can close // the DB when we're done, without this manual requests would // need to close the database when done with it to avoid memory leaks -export async function doWithDB(dbName: string, cb: any, opts = {}) { +export async function doWithDB( + dbName: string, + cb: (db: Database) => Promise, + opts = {} +) { const db = getDB(dbName, opts) // need this to be async so that we can correctly close DB after all // async operations have been completed diff --git a/packages/backend-core/src/security/roles.ts b/packages/backend-core/src/security/roles.ts index 081193b433..f17db380f1 100644 --- a/packages/backend-core/src/security/roles.ts +++ b/packages/backend-core/src/security/roles.ts @@ -253,7 +253,7 @@ export function checkForRoleResourceArray( * Given an app ID this will retrieve all of the roles that are currently within that app. * @return {Promise} An array of the role objects that were found. */ -export async function getAllRoles(appId?: string) { +export async function getAllRoles(appId?: string): Promise { if (appId) { return doWithDB(appId, internal) } else { From f6329e6a22959ef36a5d74732c1370fafd62db77 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Mon, 4 Sep 2023 14:12:37 +0200 Subject: [PATCH 034/116] Add tests --- .../server/src/api/routes/tests/row.spec.ts | 84 ++++++++++++++++++- 1 file changed, 83 insertions(+), 1 deletion(-) diff --git a/packages/server/src/api/routes/tests/row.spec.ts b/packages/server/src/api/routes/tests/row.spec.ts index f28b96b9d8..7c2e425980 100644 --- a/packages/server/src/api/routes/tests/row.spec.ts +++ b/packages/server/src/api/routes/tests/row.spec.ts @@ -1,11 +1,12 @@ import tk from "timekeeper" import { outputProcessing } from "../../../utilities/rowProcessor" import * as setup from "./utilities" -import { context, tenancy } from "@budibase/backend-core" +import { context, roles, tenancy } from "@budibase/backend-core" import { quotas } from "@budibase/pro" import { FieldType, MonthlyQuotaName, + PermissionLevel, QuotaUsageType, Row, SortOrder, @@ -16,6 +17,7 @@ import { import { expectAnyInternalColsAttributes, generator, + mocks, structures, } from "@budibase/backend-core/tests" @@ -37,6 +39,7 @@ describe("/rows", () => { }) beforeEach(async () => { + mocks.licenses.useCloudFree() table = await config.createTable() row = basicRow(table._id!) }) @@ -1314,6 +1317,85 @@ describe("/rows", () => { bookmark: expect.any(String), }) }) + + describe("permissions", () => { + let viewId: string + let tableId: string + + beforeAll(async () => { + const table = await config.createTable(userTable()) + const rows = [] + for (let i = 0; i < 10; i++) { + rows.push(await config.createRow({ tableId: table._id })) + } + + const createViewResponse = await config.api.viewV2.create() + + tableId = table._id! + viewId = createViewResponse.id + }) + + beforeEach(() => { + mocks.licenses.useViewPermissions() + }) + + it("does not allow public users to fetch by default", async () => { + await config.publish() + await config.api.viewV2.search(viewId, undefined, { + expectStatus: 403, + usePublicUser: true, + }) + }) + + it("allow public users to fetch when permissions are explicit", async () => { + await config.api.permission.set({ + roleId: roles.BUILTIN_ROLE_IDS.PUBLIC, + level: PermissionLevel.READ, + resourceId: viewId, + }) + await config.publish() + + const response = await config.api.viewV2.search(viewId, undefined, { + usePublicUser: true, + }) + + expect(response.body.rows).toHaveLength(10) + }) + + it("allow public users to fetch when permissions are inherited", async () => { + await config.api.permission.set({ + roleId: roles.BUILTIN_ROLE_IDS.PUBLIC, + level: PermissionLevel.READ, + resourceId: tableId, + }) + await config.publish() + + const response = await config.api.viewV2.search(viewId, undefined, { + usePublicUser: true, + }) + + expect(response.body.rows).toHaveLength(10) + }) + + it("respects inherited permissions, not allowing not public views from public tables", async () => { + await config.api.permission.set({ + roleId: roles.BUILTIN_ROLE_IDS.PUBLIC, + level: PermissionLevel.READ, + resourceId: tableId, + }) + await config.api.permission.set({ + roleId: roles.BUILTIN_ROLE_IDS.POWER, + level: PermissionLevel.READ, + resourceId: viewId, + }) + await config.publish() + + await config.api.viewV2.search(viewId, undefined, { + usePublicUser: true, + expectStatus: 403, + }) + }) + }) }) }) }) From ad8fb0165703ba15ca051339266a3ec249822229 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Mon, 4 Sep 2023 14:13:10 +0200 Subject: [PATCH 035/116] Use permissions sdk on authorized middleware --- packages/server/src/middleware/authorized.ts | 63 +++++++------------- 1 file changed, 22 insertions(+), 41 deletions(-) diff --git a/packages/server/src/middleware/authorized.ts b/packages/server/src/middleware/authorized.ts index 35d373efbf..b2ffeacaf8 100644 --- a/packages/server/src/middleware/authorized.ts +++ b/packages/server/src/middleware/authorized.ts @@ -6,11 +6,10 @@ import { users, } from "@budibase/backend-core" import { PermissionLevel, PermissionType, Role, UserCtx } from "@budibase/types" -import { features } from "@budibase/pro" import builderMiddleware from "./builder" import { isWebhookEndpoint } from "./utils" import { paramResource } from "./resourceId" -import { extractViewInfoFromID, isViewID } from "../db/utils" +import sdk from "../sdk" function hasResource(ctx: any) { return ctx.resourceId != null @@ -77,31 +76,6 @@ const checkAuthorizedResource = async ( } } -const resourceIdTranformers: Partial< - Record Promise> -> = { - [PermissionType.VIEW]: async ctx => { - const { resourceId } = ctx - if (!resourceId) { - ctx.throw(400, `Cannot obtain the view id`) - return - } - - if (!isViewID(resourceId)) { - ctx.throw(400, `"${resourceId}" is not a valid view id`) - return - } - - if (await features.isViewPermissionEnabled()) { - ctx.subResourceId = ctx.resourceId - ctx.resourceId = extractViewInfoFromID(resourceId).tableId - } else { - ctx.resourceId = extractViewInfoFromID(resourceId).tableId - delete ctx.subResourceId - } - }, -} - const authorized = ( permType: PermissionType, @@ -121,8 +95,8 @@ const authorized = } // get the resource roles - let resourceRoles: any = [] - let otherLevelRoles: any = [] + let resourceRoles: string[] = [] + let otherLevelRoles: string[] = [] const otherLevel = permLevel === PermissionLevel.READ ? PermissionLevel.WRITE @@ -133,21 +107,28 @@ const authorized = paramResource(resourcePath)(ctx, () => {}) } - if (resourceIdTranformers[permType]) { - await resourceIdTranformers[permType]!(ctx) - } - if (hasResource(ctx)) { const { resourceId, subResourceId } = ctx - resourceRoles = await roles.getRequiredResourceRole(permLevel!, { - resourceId, - subResourceId, - }) + + const permissions = await sdk.permissions.getResourcePerms(resourceId) + const subPermissions = + !!subResourceId && + (await sdk.permissions.getResourcePerms(subResourceId)) + + function getPermLevel(permLevel: string) { + let result: string[] = [] + if (permissions[permLevel]) { + result.push(permissions[permLevel].role) + } + if (subPermissions && subPermissions[permLevel]) { + result.push(subPermissions[permLevel].role) + } + return result + } + + resourceRoles = getPermLevel(permLevel!) if (opts && opts.schema) { - otherLevelRoles = await roles.getRequiredResourceRole(otherLevel, { - resourceId, - subResourceId, - }) + otherLevelRoles = getPermLevel(otherLevel!) } } From d16110ca7336d75d55d048a2dcc9878d7b152863 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Mon, 4 Sep 2023 15:49:58 +0200 Subject: [PATCH 036/116] Fix tests --- .../src/middleware/tests/authorized.spec.ts | 100 +++++------------- 1 file changed, 26 insertions(+), 74 deletions(-) diff --git a/packages/server/src/middleware/tests/authorized.spec.ts b/packages/server/src/middleware/tests/authorized.spec.ts index d47430e63f..0741f50e4d 100644 --- a/packages/server/src/middleware/tests/authorized.spec.ts +++ b/packages/server/src/middleware/tests/authorized.spec.ts @@ -1,28 +1,20 @@ -jest.mock("@budibase/backend-core", () => ({ - ...jest.requireActual("@budibase/backend-core"), - roles: { - ...jest.requireActual("@budibase/backend-core").roles, - getRequiredResourceRole: jest.fn().mockResolvedValue([]), - }, -})) -jest.mock("../../environment", () => ({ - prod: false, - isTest: () => true, - // @ts-ignore - isProd: () => this.prod, - _set: function (_key: string, value: string) { - this.prod = value === "production" - }, +jest.mock("../../sdk/app/permissions", () => ({ + ...jest.requireActual("../../sdk/app/permissions"), + getResourcePerms: jest.fn().mockResolvedValue([]), })) -import { PermissionType, PermissionLevel } from "@budibase/types" +import { + PermissionType, + PermissionLevel, + PermissionSource, +} from "@budibase/types" import authorizedMiddleware from "../authorized" import env from "../../environment" import { generateTableID, generateViewID } from "../../db/utils" -import { roles } from "@budibase/backend-core" -import { mocks } from "@budibase/backend-core/tests" +import { generator, mocks } from "@budibase/backend-core/tests" import { initProMocks } from "../../tests/utilities/mocks/pro" +import { getResourcePerms } from "../../sdk/app/permissions" const APP_ID = "" @@ -189,23 +181,26 @@ describe("Authorization middleware", () => { ) }) - describe("view type", () => { - const tableId = generateTableID() - const viewId = generateViewID(tableId) - - const mockedGetRequiredResourceRole = - roles.getRequiredResourceRole as jest.MockedFunction< - typeof roles.getRequiredResourceRole - > + describe("with resource", () => { + let resourceId: string + const mockedGetResourcePerms = getResourcePerms as jest.MockedFunction< + typeof getResourcePerms + > beforeEach(() => { config.setMiddlewareRequiredPermission( PermissionType.VIEW, PermissionLevel.READ ) - config.setResourceId(viewId) + resourceId = generator.guid() + config.setResourceId(resourceId) - mockedGetRequiredResourceRole.mockResolvedValue(["PUBLIC"]) + mockedGetResourcePerms.mockResolvedValue({ + [PermissionLevel.READ]: { + role: "PUBLIC", + type: PermissionSource.BASE, + }, + }) config.setUser({ _id: "user", @@ -215,57 +210,14 @@ describe("Authorization middleware", () => { }) }) - it("will ignore view permissions if flag is off", async () => { + it("will fetch resource permissions when resource is set", async () => { await config.executeMiddleware() expect(config.throw).not.toBeCalled() expect(config.next).toHaveBeenCalled() - expect(mockedGetRequiredResourceRole).toBeCalledTimes(1) - expect(mockedGetRequiredResourceRole).toBeCalledWith( - PermissionLevel.READ, - expect.objectContaining({ - resourceId: tableId, - subResourceId: undefined, - }) - ) - }) - - it("will use view permissions if flag is on", async () => { - mocks.licenses.useViewPermissions() - await config.executeMiddleware() - - expect(config.throw).not.toBeCalled() - expect(config.next).toHaveBeenCalled() - - expect(mockedGetRequiredResourceRole).toBeCalledTimes(1) - expect(mockedGetRequiredResourceRole).toBeCalledWith( - PermissionLevel.READ, - expect.objectContaining({ - resourceId: tableId, - subResourceId: viewId, - }) - ) - }) - - it("throw an exception if the resource id is not provided", async () => { - config.setResourceId(undefined) - await config.executeMiddleware() - expect(config.throw).toHaveBeenNthCalledWith( - 1, - 400, - "Cannot obtain the view id" - ) - }) - - it("throw an exception if the resource id is not a valid view id", async () => { - config.setResourceId(tableId) - await config.executeMiddleware() - expect(config.throw).toHaveBeenNthCalledWith( - 1, - 400, - `"${tableId}" is not a valid view id` - ) + expect(mockedGetResourcePerms).toBeCalledTimes(1) + expect(mockedGetResourcePerms).toBeCalledWith(resourceId) }) }) }) From c5e061c9bfe248f940a963606adc9cbed31542db Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Mon, 4 Sep 2023 16:22:50 +0200 Subject: [PATCH 037/116] Fix types --- packages/server/src/sdk/app/backups/exports.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/server/src/sdk/app/backups/exports.ts b/packages/server/src/sdk/app/backups/exports.ts index 306918cf80..307cdf4015 100644 --- a/packages/server/src/sdk/app/backups/exports.ts +++ b/packages/server/src/sdk/app/backups/exports.ts @@ -60,7 +60,7 @@ function tarFilesToTmp(tmpDir: string, files: string[]) { export async function exportDB( dbName: string, opts: DBDumpOpts = {} -): Promise { +): Promise { const exportOpts = { filter: opts?.filter, batch_size: 1000, From be1d48e038cae713fc7aa7b8151db3647e65cbff Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Mon, 4 Sep 2023 14:34:06 +0000 Subject: [PATCH 038/116] Bump version to 2.9.33-alpha.14 --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index fd0738f18a..0ad0eaee4e 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.9.33-alpha.13", + "version": "2.9.33-alpha.14", "npmClient": "yarn", "packages": [ "packages/*" From 5ee4f6f6cc2a0f9763e5b8f8666eecb19dcfe96c Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Mon, 4 Sep 2023 17:03:25 +0200 Subject: [PATCH 039/116] Clean code --- packages/backend-core/src/security/roles.ts | 31 --------------------- 1 file changed, 31 deletions(-) diff --git a/packages/backend-core/src/security/roles.ts b/packages/backend-core/src/security/roles.ts index f17db380f1..05d536562b 100644 --- a/packages/backend-core/src/security/roles.ts +++ b/packages/backend-core/src/security/roles.ts @@ -312,37 +312,6 @@ export async function getAllRoles(appId?: string): Promise { } } -/** - * This retrieves the required role for a resource - * @param permLevel The level of request - * @param resourceId The resource being requested - * @param subResourceId The sub resource being requested - * @return {Promise<{permissions}|Object>} returns the permissions required to access. - */ -export async function getRequiredResourceRole( - permLevel: string, - { resourceId, subResourceId }: { resourceId?: string; subResourceId?: string } -) { - const roles = await getAllRoles() - let main = [], - sub = [] - for (let role of roles) { - // no permissions, ignore it - if (!role.permissions) { - continue - } - const mainRes = resourceId ? role.permissions[resourceId] : undefined - const subRes = subResourceId ? role.permissions[subResourceId] : undefined - if (mainRes && mainRes.indexOf(permLevel) !== -1) { - main.push(role._id) - } else if (subRes && subRes.indexOf(permLevel) !== -1) { - sub.push(role._id) - } - } - // for now just return the IDs - return main.concat(sub) -} - export class AccessController { userHierarchies: { [key: string]: string[] } constructor() { From fcab250bdaf790ed05102ff8c0bee672d16f0397 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Mon, 4 Sep 2023 15:11:50 +0000 Subject: [PATCH 040/116] Bump version to 2.9.33-alpha.15 --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index 0ad0eaee4e..5653cfedf1 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.9.33-alpha.14", + "version": "2.9.33-alpha.15", "npmClient": "yarn", "packages": [ "packages/*" From a234ae642643978976a54570480c426133884fdc Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Mon, 4 Sep 2023 17:19:04 +0100 Subject: [PATCH 041/116] ensure secrets are not replaced on every helm run --- charts/budibase/templates/secrets.yaml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/charts/budibase/templates/secrets.yaml b/charts/budibase/templates/secrets.yaml index 1c0a914ed3..263934187e 100644 --- a/charts/budibase/templates/secrets.yaml +++ b/charts/budibase/templates/secrets.yaml @@ -1,4 +1,5 @@ -{{- if .Values.globals.createSecrets -}} +{{- $existingSecret := lookup "v1" "Secret" .Release.Namespace (include "budibase.fullname" .) }} +{{- if .Values.globals.createSecrets }} apiVersion: v1 kind: Secret metadata: @@ -10,8 +11,15 @@ metadata: heritage: "{{ .Release.Service }}" type: Opaque data: + {{- if $existingSecret }} + internalApiKey: {{ index $existingSecret.data "internalApiKey" }} + jwtSecret: {{ index $existingSecret.data "jwtSecret" }} + objectStoreAccess: {{ index $existingSecret.data "objectStoreAccess" }} + objectStoreSecret: {{ index $existingSecret.data "objectStoreSecret" }} + {{- else }} internalApiKey: {{ template "budibase.defaultsecret" .Values.globals.internalApiKey }} jwtSecret: {{ template "budibase.defaultsecret" .Values.globals.jwtSecret }} objectStoreAccess: {{ template "budibase.defaultsecret" .Values.services.objectStore.accessKey }} objectStoreSecret: {{ template "budibase.defaultsecret" .Values.services.objectStore.secretKey }} -{{- end -}} + {{- end }} +{{- end }} From 668584cd0e5774f3528ef0089ca4a95fdb68a70b Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Mon, 4 Sep 2023 17:04:15 +0000 Subject: [PATCH 042/116] Bump version to 2.9.38 --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index f83e8e3dfe..8742093f39 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.9.37", + "version": "2.9.38", "npmClient": "yarn", "packages": [ "packages/*" From 6d3a7727ebb5ca18024d07fd6892d7ecbd58e029 Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Tue, 5 Sep 2023 09:25:06 +0100 Subject: [PATCH 043/116] fixes for perr app builder and refactoring based on comments --- .../_components/BuilderSidePanel.svelte | 28 ++++++++-------- packages/frontend-core/src/api/user.js | 17 ++++------ .../src/api/controllers/global/users.ts | 32 +++++++------------ 3 files changed, 32 insertions(+), 45 deletions(-) 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 477083f822..b0ab9edd04 100644 --- a/packages/builder/src/pages/builder/app/[application]/_components/BuilderSidePanel.svelte +++ b/packages/builder/src/pages/builder/app/[application]/_components/BuilderSidePanel.svelte @@ -150,13 +150,10 @@ } const sortInviteRoles = (a, b) => { - const aEmpty = - !a.info?.appBuilders?.length && Object.keys(a.info.apps).length === 0 - const bEmpty = - !b.info?.appBuilders?.length && Object.keys(b.info.apps).length === 0 + const aAppsEmpty = !a.info?.apps?.length && !a.info?.builder?.apps?.length + const bAppsEmpty = !b.info?.apps?.length && !b.info?.builder?.apps?.length - if (aEmpty && !bEmpty) return 1 - if (!aEmpty && bEmpty) return -1 + return aAppsEmpty && !bAppsEmpty ? 1 : !aAppsEmpty && bAppsEmpty ? -1 : 0 } const sortRoles = (a, b) => { @@ -366,14 +363,14 @@ const payload = [ { email: newUserEmail, - builder: creationRoleType === Constants.BudibaseRoles.Admin, - admin: creationRoleType === Constants.BudibaseRoles.Admin, + builder: { global: creationRoleType === Constants.BudibaseRoles.Admin }, + admin: { global: creationRoleType === Constants.BudibaseRoles.Admin }, }, ] if (creationRoleType !== Constants.BudibaseRoles.Admin) { if (creationAccessType === Constants.Roles.CREATOR) { - payload[0].appBuilders = [prodAppId] + payload[0].builder.apps = [prodAppId] } else { payload[0].apps = { [prodAppId]: creationAccessType, @@ -441,10 +438,11 @@ } if (role === Constants.Roles.CREATOR) { - updateBody.appBuilders = [...(updateBody.appBuilders ?? []), prodAppId] + updateBody.builder = updateBody.builder || {} + updateBody.builder.apps = [...(updateBody.builder.apps ?? []), prodAppId] delete updateBody?.apps?.[prodAppId] - } else if (role !== Constants.Roles.CREATOR && invite?.appBuilders) { - invite.appBuilders = [] + } else if (role !== Constants.Roles.CREATOR && invite?.builder?.apps) { + invite.builder.apps = [] } await users.updateInvite(updateBody) await filterInvites(query) @@ -502,7 +500,7 @@ return Constants.Roles.ADMIN } - if (invite.info?.appBuilders?.includes(prodAppId)) { + if (invite.info?.builder?.apps?.includes(prodAppId)) { return Constants.Roles.CREATOR } @@ -546,7 +544,9 @@ {invitingFlow ? "Invite new user" : "Users"}
- + {#if !invitingFlow} + + {/if} ({ body: { email, userInfo: { - admin: admin ? { global: true } : undefined, - builder: builder ? { global: true } : undefined, + admin: admin?.global ? { global: true } : undefined, + builder: builder?.global ? { global: true } : undefined, apps: apps ? apps : undefined, }, }, @@ -153,20 +153,16 @@ export const buildUserEndpoints = API => ({ }, onboardUsers: async payload => { - console.log(payload) return await API.post({ url: "/api/global/users/onboard", body: payload.map(invite => { - const { email, admin, builder, apps, appBuilders } = invite - console.log(admin) - console.log(builder) + const { email, admin, builder, apps } = invite return { email, userInfo: { - admin: admin ? { global: true } : undefined, - builder: builder ? { global: true } : undefined, + admin, + builder, apps: apps ? apps : undefined, - appBuilders, }, } }), @@ -179,12 +175,11 @@ export const buildUserEndpoints = API => ({ * @param invite the invite code sent in the email */ updateUserInvite: async invite => { - console.log(invite) await API.post({ url: `/api/global/users/invite/update/${invite.code}`, body: { apps: invite.apps, - appBuilders: invite.appBuilders, + builder: invite.builder, }, }) }, diff --git a/packages/worker/src/api/controllers/global/users.ts b/packages/worker/src/api/controllers/global/users.ts index eb14c13119..a084685dd3 100644 --- a/packages/worker/src/api/controllers/global/users.ts +++ b/packages/worker/src/api/controllers/global/users.ts @@ -266,19 +266,14 @@ export const onboardUsers = async (ctx: Ctx) => { // Temp password to be passed to the user. createdPasswords[invite.email] = password - let builder: { global: boolean; apps?: string[] } = { - global: invite.userInfo.builder || false, - } - if (invite.userInfo.appBuilders) { - builder.apps = invite.userInfo.appBuilders - } + return { email: invite.email, password, forceResetPassword: true, roles: invite.userInfo.apps, - admin: { global: invite.userInfo.admin || false }, - builder, + admin: invite.userInfo.admin, + builder: invite.userInfo.builder, tenantId: tenancy.getTenantId(), } }) @@ -373,13 +368,10 @@ export const updateInvite = async (ctx: any) => { ...invite, } - if (!updateBody?.appBuilders || !updateBody.appBuilders?.length) { - updated.info.appBuilders = [] - } else { - updated.info.appBuilders = [ - ...(invite.info.appBuilders ?? []), - ...updateBody.appBuilders, - ] + if (!updateBody?.builder?.apps && updated.info?.builder?.apps) { + updated.info.builder.apps = [] + } else if (updateBody?.builder) { + updated.info.builder = updateBody.builder } if (!updateBody?.apps || !Object.keys(updateBody?.apps).length) { @@ -411,18 +403,18 @@ export const inviteAccept = async ( lastName, password, email, - admin: { global: info.admin || false }, + admin: { global: info.admin.global || false }, roles: info.apps, tenantId: info.tenantId, } let builder: { global: boolean; apps?: string[] } = { - global: info.builder || false, + global: info.builder.global || false, } - if (info.appBuilders) { - builder.apps = info.appBuilders + if (info.builder.apps) { + builder.apps = info.builder.apps request.builder = builder - delete info.appBuilders + delete info.builder.apps } delete info.apps request = { From c16fd53b0a954f8d08d74fb8464f68c02fcb302b Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Tue, 5 Sep 2023 09:58:05 +0100 Subject: [PATCH 044/116] add developer label back and improve invite flow --- .../app/[application]/_components/BuilderSidePanel.svelte | 2 +- .../users/users/_components/RoleTableRenderer.svelte | 2 +- packages/builder/src/stores/portal/users.js | 7 +++++-- packages/frontend-core/src/constants.js | 5 +++++ packages/worker/src/api/controllers/global/users.ts | 6 +++--- 5 files changed, 15 insertions(+), 7 deletions(-) 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 b0ab9edd04..5f89762eac 100644 --- a/packages/builder/src/pages/builder/app/[application]/_components/BuilderSidePanel.svelte +++ b/packages/builder/src/pages/builder/app/[application]/_components/BuilderSidePanel.svelte @@ -120,7 +120,7 @@ await usersFetch.refresh() filteredUsers = $usersFetch.rows - .filter(user => !user?.admin?.global) // filter out global admins + .filter(user => user.email !== $auth.user.email) .map(user => { const isAdminOrGlobalBuilder = sdk.users.isAdminOrGlobalBuilder( user, diff --git a/packages/builder/src/pages/builder/portal/users/users/_components/RoleTableRenderer.svelte b/packages/builder/src/pages/builder/portal/users/users/_components/RoleTableRenderer.svelte index 8217c85c5e..43fe8cc1cc 100644 --- a/packages/builder/src/pages/builder/portal/users/users/_components/RoleTableRenderer.svelte +++ b/packages/builder/src/pages/builder/portal/users/users/_components/RoleTableRenderer.svelte @@ -10,7 +10,7 @@ admin: "Full access", } - $: role = Constants.BudibaseRoleOptions.find( + $: role = Constants.BudibaseRoleOptionsOld.find( x => x.value === users.getUserRole(row) ) $: value = role?.label || "Not available" diff --git a/packages/builder/src/stores/portal/users.js b/packages/builder/src/stores/portal/users.js index 996a94013b..3ee0516544 100644 --- a/packages/builder/src/stores/portal/users.js +++ b/packages/builder/src/stores/portal/users.js @@ -121,8 +121,11 @@ export function createUsersStore() { } const getUserRole = user => - sdk.users.isAdminOrGlobalBuilder(user) ? "admin" : "appUser" - + sdk.users.isAdmin(user) + ? "admin" + : sdk.users.isBuilder(user) + ? "developer" + : "appUser" const refreshUsage = fn => async (...args) => { diff --git a/packages/frontend-core/src/constants.js b/packages/frontend-core/src/constants.js index 198d88196b..cfaaaea81b 100644 --- a/packages/frontend-core/src/constants.js +++ b/packages/frontend-core/src/constants.js @@ -23,6 +23,11 @@ export const BudibaseRoles = { Admin: "admin", } +export const BudibaseRoleOptionsOld = [ + { label: "Developer", value: BudibaseRoles.Developer }, + { label: "Member", value: BudibaseRoles.AppUser }, + { label: "Admin", value: BudibaseRoles.Admin }, +] export const BudibaseRoleOptions = [ { label: "Member", value: BudibaseRoles.AppUser }, { label: "Admin", value: BudibaseRoles.Admin }, diff --git a/packages/worker/src/api/controllers/global/users.ts b/packages/worker/src/api/controllers/global/users.ts index a084685dd3..a73c4de8e7 100644 --- a/packages/worker/src/api/controllers/global/users.ts +++ b/packages/worker/src/api/controllers/global/users.ts @@ -403,15 +403,15 @@ export const inviteAccept = async ( lastName, password, email, - admin: { global: info.admin.global || false }, + admin: { global: info?.admin?.global || false }, roles: info.apps, tenantId: info.tenantId, } let builder: { global: boolean; apps?: string[] } = { - global: info.builder.global || false, + global: info?.builder?.global || false, } - if (info.builder.apps) { + if (info?.builder?.apps) { builder.apps = info.builder.apps request.builder = builder delete info.builder.apps From 9c30d79093c4094bcd18ebd938260d40a6f1d72e Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Tue, 5 Sep 2023 10:13:23 +0100 Subject: [PATCH 045/116] formatting --- .../users/users/_components/AppsTableRenderer.svelte | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/builder/src/pages/builder/portal/users/users/_components/AppsTableRenderer.svelte b/packages/builder/src/pages/builder/portal/users/users/_components/AppsTableRenderer.svelte index 9dda0dbab2..32e50ef05f 100644 --- a/packages/builder/src/pages/builder/portal/users/users/_components/AppsTableRenderer.svelte +++ b/packages/builder/src/pages/builder/portal/users/users/_components/AppsTableRenderer.svelte @@ -13,10 +13,10 @@ return $apps.length } else { return sdk.users.hasAppBuilderPermissions(row) - ? row.builder.apps.length + - Object.keys(row.roles || {}).filter(appId => - row.builder.apps.includes(appId) - ).length + ? row?.builder?.apps?.length + + Object.keys(row.roles || {}).filter(appId => { + row?.builder?.apps?.includes(appId) + }).length : value?.length || 0 } } From cfde7c3e58d7463f2131a920553ea387361990de Mon Sep 17 00:00:00 2001 From: Rory Powell Date: Tue, 5 Sep 2023 11:07:18 +0100 Subject: [PATCH 046/116] Move bootstrap to account-portal --- .github/workflows/README.md | 75 +----------------------------- docs/DEV-SETUP-WINDOWS.md | 2 +- package.json | 6 +-- scripts/link-dependencies.sh | 89 ------------------------------------ 4 files changed, 4 insertions(+), 168 deletions(-) delete mode 100755 scripts/link-dependencies.sh diff --git a/.github/workflows/README.md b/.github/workflows/README.md index f77323d85a..7e4172e602 100644 --- a/.github/workflows/README.md +++ b/.github/workflows/README.md @@ -115,77 +115,4 @@ This job is responsible for deploying to our production, cloud kubernetes enviro ### Rollback A Bad Cloud Deployment - Kick off cloud deploy job - Ensure you are running off master -- Enter the version number of the last known good version of budibase. For example `1.0.0` - -## Pro - -| **NOTE**: When developing for both pro / budibase repositories, your branch names need to match, or else the correct pro doesn't get run within your CI job. - -### Installing Pro - -The pro package is always installed from source in our CI jobs. - -This is done to prevent pro needing to be published prior to CI runs in budiabse. This is required for two reasons: -- To reduce developer need to manually bump versions, i.e: - - release pro, bump pro dep in budibase, now ci can run successfully -- The cyclic dependency on backend-core, i.e: - - pro depends on backend-core - - server depends on pro - - backend-core lives in the monorepo, so it can't be released independently to be used in pro - - therefore the only option is to pull pro from source and release it as a part of the monorepo release, as if it were a mono package - -The install is performed using the same steps as local development, via the `yarn bootstrap` command, see the [Contributing Guide#Pro](../../docs/CONTRIBUTING.md#pro) - -The branch to install pro from can vary depending on ref of the commit that triggered the budibase CI job. This is done to enable branches which have changes in both the monorepo and the pro repo to have their CI pass successfully. - -This is done using the [pro/install.sh](../../scripts/pro/install.sh) script. The script will: -- Clone pro to it's default branch (`develop`) -- Check if the clone worked, on forked versions of budibase this will fail due to no access - - This is fine as the `yarn` command will install the version from NPM - - Community PRs should never touch pro so this will always work -- Checkout the `BRANCH` argument, if this fails fallback to `BASE_BRANCH` - - This enables the more complex case of a feature branch being merged to another feature branch, e.g. - - I am working on a branch `epic/stonks` which exists on budibase and pro. - - I want to merge a change to this branch in budibase from `feature/stonks-ui`, which only exists in budibase - - The base branch ensures that `epic/stonks` in pro will still be checked out for the CI run, rather than falling back to `develop` -- Run `yarn setup` to build and install dependencies - - `yarn` - - `yarn bootstrap` - - `yarn build` - - The will build .ts files, and also update the `main` and `types` of `package.json` to point to `dist` rather than src - - The build command will only ever work in CI, it is prevented in local dev - -#### `BRANCH` and `BASE_BRANCH` arguments -These arguments are supplied by the various budibase build and release pipelines -- `budibase_ci` - - `BRANCH: ${{ github.event.pull_request.head.ref }}` -> The branch being merged - - `BASE_BRANCH: ${{ github.event.pull_request.base.ref}}` -> The base branch -- `release-develop` - - `BRANCH: develop` -> always use the `develop` branch in pro -- `release` - - `BRANCH: master` -> always use the `master` branch in pro - - -### Releasing Pro -After budibase dependencies have been released we will release the new version of pro to match the release version of budibase dependencies. This is to ensure that we are always keeping the version of `backend-core` in sync in the pro package and in budibase packages. Without this we could run into scenarios where different versions are being used when installed via `yarn` inside the docker images, creating very difficult to debug cases. - -Pro is released using the [pro/release.sh](../../scripts/pro/release.sh) script. The script will: -- Inspect the `VERSION` from the `lerna.json` file in budibase -- Determine whether to use the `latest` or `develop` tag based on the command argument -- Go to pro directory - - install npm creds - - update the version of `backend-core` to be `VERSION`, the version just released by lerna - - publish to npm. Uses a `lerna publish` command, pro itself is a mono repo. - - force the version to be the same as `VERSION` to keep pro and budibase in sync - - reverts the changes to `main` and `types` in `package.json` that were made by the build step, to point back to source - - commit & push: `Prep next development iteration` -- Go to budibase - - Update to the new version of pro in `server` and `worker` so the latest pro version is used in the docker builds - - commit & push: `Update pro version to $VERSION` - - -#### `COMMAND` argument -This argument is supplied by the existing `release` and `release:develop` budibase commands, which invoke the pro release -- `release` will supply no command and default to use `latest` -- `release:develop` will supply `develop` - +- Enter the version number of the last known good version of budibase. For example `1.0.0` \ No newline at end of file diff --git a/docs/DEV-SETUP-WINDOWS.md b/docs/DEV-SETUP-WINDOWS.md index 176e0700d7..f26a5a0882 100644 --- a/docs/DEV-SETUP-WINDOWS.md +++ b/docs/DEV-SETUP-WINDOWS.md @@ -74,7 +74,7 @@ yarn setup The yarn setup command runs several build steps i.e. ``` -node ./hosting/scripts/setup.js && yarn && yarn bootstrap && yarn build && yarn dev +node ./hosting/scripts/setup.js && yarn && yarn build && yarn dev ``` So this command will actually run the application in dev mode. It creates .env files under `./packages/server` and `./packages/worker` and runs docker containers for each service via docker-compose. diff --git a/package.json b/package.json index 4e4befb5f2..82fdc73e05 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,6 @@ "scripts": { "preinstall": "node scripts/syncProPackage.js", "setup": "git config submodule.recurse true && git submodule update && node ./hosting/scripts/setup.js && yarn && yarn build && yarn dev", - "bootstrap": "./scripts/link-dependencies.sh && echo '***BOOTSTRAP ONLY REQUIRED FOR USE WITH ACCOUNT PORTAL***'", "build": "lerna run build --stream", "build:dev": "lerna run --stream prebuild && yarn nx run-many --target=build --output-style=dynamic --watch --preserveWatchOutput", "check:types": "lerna run check:types", @@ -43,11 +42,11 @@ "deps:circular": "madge packages/server/dist/index.js packages/worker/src/index.ts packages/backend-core/dist/src/index.js packages/cli/src/index.js --circular", "release": "lerna publish from-package --yes --force-publish --no-git-tag-version --no-push --no-git-reset", "release:develop": "yarn release --dist-tag develop", - "restore": "yarn run clean && yarn run bootstrap && yarn run build", + "restore": "yarn run dep:clean && yarn && yarn run build", "nuke": "yarn run nuke:packages && yarn run nuke:docker", "nuke:packages": "yarn run restore", "nuke:docker": "lerna run --stream dev:stack:nuke", - "clean": "lerna clean", + "clean": "lerna clean -y", "kill-builder": "kill-port 3000", "kill-server": "kill-port 4001 4002", "kill-all": "yarn run kill-builder && yarn run kill-server", @@ -93,7 +92,6 @@ "mode:account": "yarn mode:cloud && yarn env:account:enable", "security:audit": "node scripts/audit.js", "postinstall": "husky install", - "dep:clean": "yarn clean -y && yarn bootstrap", "submodules:load": "git submodule init && git submodule update && yarn && yarn bootstrap", "submodules:unload": "git submodule deinit --all && yarn && yarn bootstrap" }, diff --git a/scripts/link-dependencies.sh b/scripts/link-dependencies.sh deleted file mode 100755 index 921e3be8f3..0000000000 --- a/scripts/link-dependencies.sh +++ /dev/null @@ -1,89 +0,0 @@ -echo "Linking backend-core" -cd packages/backend-core -yarn unlink -yarn link -cd - - -echo "Linking string-templates" -cd packages/string-templates -yarn unlink -yarn link -cd - - -echo "Linking types" -cd packages/types -yarn unlink -yarn link -cd - - -echo "Linking bbui" -cd packages/bbui -yarn unlink -yarn link -cd - - -echo "Linking frontend-core" -cd packages/frontend-core -yarn unlink -yarn link -cd - - -echo "Linking shared-core" -cd packages/shared-core -yarn unlink -yarn link -cd - - -if [ -d packages/pro/src ]; then - pro_loaded_locally=true -else - pro_loaded_locally=false -fi - -if [ $pro_loaded_locally = true ]; then - echo "Linking pro" - cd packages/pro - yarn unlink - yarn link - cd - -fi - -if [ -d "../account-portal" ]; then - cd ../account-portal - echo "Bootstrapping account-portal" - yarn bootstrap - - cd packages/server - echo "Linking backend-core to account-portal (server)" - yarn link "@budibase/backend-core" - - echo "Linking string-templates to account-portal (server)" - yarn link "@budibase/string-templates" - - echo "Linking types to account-portal (server)" - yarn link "@budibase/types" - - echo "Linking shared-core to account-portal (server)" - yarn link "@budibase/shared-core" - - if [ $pro_loaded_locally = true ]; then - echo "Linking pro to account-portal (server)" - yarn link "@budibase/pro" - fi - - cd ../ui - echo "Linking bbui to account-portal (ui)" - yarn link "@budibase/bbui" - - echo "Linking shared-core to account-portal (ui)" - yarn link "@budibase/shared-core" - - echo "Linking string-templates to account-portal (ui)" - yarn link "@budibase/string-templates" - - echo "Linking types to account-portal (ui)" - yarn link "@budibase/types" - - echo "Linking frontend-core to account-portal (ui)" - yarn link "@budibase/frontend-core" -fi From c6bd81ba210ba7a77cf93a1c4b57e92a364d7abe Mon Sep 17 00:00:00 2001 From: Dean Date: Tue, 5 Sep 2023 11:40:52 +0100 Subject: [PATCH 047/116] Fix for datasource reset on formblock. Added 'resetOn' to the manifest to trigger a clear when the configured field is cleared --- .../src/builderStore/store/frontend.js | 10 ++++++++ .../FieldConfiguration.svelte | 5 ++-- packages/client/manifest.json | 4 +++- .../app/blocks/form/InnerFormBlock.svelte | 24 ++++++++++--------- 4 files changed, 29 insertions(+), 14 deletions(-) diff --git a/packages/builder/src/builderStore/store/frontend.js b/packages/builder/src/builderStore/store/frontend.js index 5997c69151..5148afd13c 100644 --- a/packages/builder/src/builderStore/store/frontend.js +++ b/packages/builder/src/builderStore/store/frontend.js @@ -1246,6 +1246,16 @@ export const getFrontendStore = () => { const settings = getComponentSettings(component._component) const updatedSetting = settings.find(setting => setting.key === name) + const resetFields = settings.filter( + setting => name === setting.resetOn + ) + resetFields?.forEach(setting => { + console.log(setting.key, component) + if (component[setting.key]) { + component[setting.key] = null + } + }) + if ( updatedSetting?.type === "dataSource" || updatedSetting?.type === "table" diff --git a/packages/builder/src/components/design/settings/controls/FieldConfiguration/FieldConfiguration.svelte b/packages/builder/src/components/design/settings/controls/FieldConfiguration/FieldConfiguration.svelte index f12e8d27ae..e41b41642b 100644 --- a/packages/builder/src/components/design/settings/controls/FieldConfiguration/FieldConfiguration.svelte +++ b/packages/builder/src/components/design/settings/controls/FieldConfiguration/FieldConfiguration.svelte @@ -34,9 +34,10 @@ } $: datasource = getDatasourceForProvider($currentAsset, componentInstance) + $: resourceId = datasource.resourceId || datasource.tableId - $: if (!isEqual(value, cachedValue)) { - cachedValue = value + $: if (!isEqual(value, cachedValue) || resourceId) { + cachedValue = cloneDeep(value) schema = getSchema($currentAsset, datasource) } diff --git a/packages/client/manifest.json b/packages/client/manifest.json index 015d32ce2d..d91a71853e 100644 --- a/packages/client/manifest.json +++ b/packages/client/manifest.json @@ -4745,7 +4745,8 @@ "dependsOn": { "setting": "clickBehaviour", "value": "details" - } + }, + "resetOn": "dataSource" }, { "label": "Save button", @@ -5397,6 +5398,7 @@ "type": "fieldConfiguration", "key": "fields", "nested": true, + "resetOn": "dataSource", "selectAllFields": true }, { diff --git a/packages/client/src/components/app/blocks/form/InnerFormBlock.svelte b/packages/client/src/components/app/blocks/form/InnerFormBlock.svelte index bca6c21cdb..f2887e97ad 100644 --- a/packages/client/src/components/app/blocks/form/InnerFormBlock.svelte +++ b/packages/client/src/components/app/blocks/form/InnerFormBlock.svelte @@ -211,17 +211,19 @@ {/if} {/if} - - {#each fields as field, idx} - {#if getComponentForField(field) && field.active} - - {/if} - {/each} - + {#key fields} + + {#each fields as field, idx} + {#if getComponentForField(field) && field.active} + + {/if} + {/each} + + {/key} {:else} From b923d24d56b08fccf1b52c1509a90cb148db2188 Mon Sep 17 00:00:00 2001 From: Dean Date: Tue, 5 Sep 2023 11:56:23 +0100 Subject: [PATCH 048/116] Removed debugging console statement --- packages/builder/src/builderStore/store/frontend.js | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/builder/src/builderStore/store/frontend.js b/packages/builder/src/builderStore/store/frontend.js index 5148afd13c..106847ea0a 100644 --- a/packages/builder/src/builderStore/store/frontend.js +++ b/packages/builder/src/builderStore/store/frontend.js @@ -1250,7 +1250,6 @@ export const getFrontendStore = () => { setting => name === setting.resetOn ) resetFields?.forEach(setting => { - console.log(setting.key, component) if (component[setting.key]) { component[setting.key] = null } From 70c71c13bf07eb70e08c5c88db299f80492e8a0a Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Tue, 5 Sep 2023 12:20:39 +0100 Subject: [PATCH 049/116] remove redudant delete --- packages/worker/src/api/controllers/global/users.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/worker/src/api/controllers/global/users.ts b/packages/worker/src/api/controllers/global/users.ts index a73c4de8e7..6d3a13aa4e 100644 --- a/packages/worker/src/api/controllers/global/users.ts +++ b/packages/worker/src/api/controllers/global/users.ts @@ -414,7 +414,6 @@ export const inviteAccept = async ( if (info?.builder?.apps) { builder.apps = info.builder.apps request.builder = builder - delete info.builder.apps } delete info.apps request = { From 1997cb5d6bdcddf695d0ebc6f091e8c3243db0c1 Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Tue, 5 Sep 2023 12:28:03 +0100 Subject: [PATCH 050/116] readibility update --- .../_components/BuilderSidePanel.svelte | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) 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 5f89762eac..7c4d3db7ce 100644 --- a/packages/builder/src/pages/builder/app/[application]/_components/BuilderSidePanel.svelte +++ b/packages/builder/src/pages/builder/app/[application]/_components/BuilderSidePanel.svelte @@ -368,14 +368,12 @@ }, ] - if (creationRoleType !== Constants.BudibaseRoles.Admin) { - if (creationAccessType === Constants.Roles.CREATOR) { - payload[0].builder.apps = [prodAppId] - } else { - payload[0].apps = { - [prodAppId]: creationAccessType, - } - } + const notCreatingAdmin = creationRoleType !== Constants.BudibaseRoles.Admin + const isCreator = creationAccessType === Constants.Roles.CREATOR + if (notCreatingAdmin && isCreator) { + payload[0].builder.apps = [prodAppId] + } else if (notCreatingAdmin && !isCreator) { + payload[0].apps = { [prodAppId]: creationAccessType } } let userInviteResponse From d096f359d7b0a32792ca3d94288fb55f2c3530ed Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Tue, 5 Sep 2023 12:28:56 +0100 Subject: [PATCH 051/116] Revert "Revert "Merge branch 'develop' into master"" This reverts commit 3265042025c5e2471b8e223491dc90a8b34814eb. --- .github/workflows/budibase_ci.yml | 114 ++- .../workflows/check_unreleased_changes.yml | 29 + .github/workflows/release-develop.yml | 2 +- .nvmrc | 2 +- .tool-versions | 4 +- .vscode/launch.json | 71 +- docs/CONTRIBUTING.md | 2 +- hosting/docker-compose.test.yaml | 47 -- hosting/single/Dockerfile | 4 +- hosting/{dependencies => tests}/Dockerfile | 0 hosting/{dependencies => tests}/README.md | 0 hosting/{dependencies => tests}/runner.sh | 0 jestTestcontainersConfigGenerator.js | 17 +- package.json | 4 +- packages/backend-core/src/cache/user.ts | 14 + packages/backend-core/src/db/lucene.ts | 26 +- .../backend-core/src/db/tests/lucene.spec.ts | 72 +- .../src/{featureFlags => features}/index.ts | 1 + .../backend-core/src/features/installation.ts | 17 + .../tests/featureFlags.spec.ts | 0 packages/backend-core/src/index.ts | 3 +- .../src/middleware/builderOnly.ts | 11 +- .../src/middleware/builderOrAdmin.ts | 11 +- .../backend-core/src/security/permissions.ts | 4 - packages/backend-core/src/users/db.ts | 38 +- .../tests/core/utilities/mocks/licenses.ts | 8 + .../core/utilities/testContainerUtils.ts | 21 +- .../bbui/src/Actions/position_dropdown.js | 3 +- .../bbui/src/ColorPicker/ColorPicker.svelte | 75 +- packages/bbui/src/Popover/Popover.svelte | 8 + packages/builder/src/builderStore/index.js | 10 +- .../src/builderStore/store/frontend.js | 29 +- .../DataTable/modals/CreateEditColumn.svelte | 67 +- .../commandPalette/CommandPalette.svelte | 4 +- .../src/components/common/NavItem.svelte | 17 +- .../src/components/design/Panel.svelte | 9 +- .../actions/ChangeFormStep.svelte | 10 +- .../controls/ColumnEditor/CellDrawer.svelte | 2 - .../controls/FilterEditor/FilterDrawer.svelte | 41 +- packages/builder/src/helpers/urlStateSync.js | 5 + .../Component}/ComponentInfoSection.svelte | 0 .../Component}/ComponentSettingsPanel.svelte | 0 .../ComponentSettingsSection.svelte | 0 .../Component}/ConditionalUIDrawer.svelte | 0 .../Component}/ConditionalUISection.svelte | 0 .../Component}/CustomStylesSection.svelte | 0 .../Component}/DesignSection.svelte | 0 .../Component}/StyleSection.svelte | 0 .../_components/Component}/componentStyles.js | 0 .../Navigation/LinksDrawer.svelte} | 0 .../Navigation/LinksEditor.svelte} | 10 +- .../_components/Navigation/index.svelte | 225 ++++++ .../_components/Screen}/AppThemeSelect.svelte | 0 .../Screen}/ButtonRoundnessSelect.svelte | 0 .../_components/Screen/GeneralPanel.svelte} | 68 +- .../_components/Screen/ThemePanel.svelte | 78 +++ .../_components/Screen/index.svelte | 51 ++ .../[screenId]/[componentId]/_layout.svelte | 52 ++ .../[screenId]/[componentId]/index.svelte | 1 + .../new/_components/NewComponentPanel.svelte | 4 + .../new/_components/componentStructure.json | 0 .../[componentId]/new/index.svelte | 0 .../[screenId]/_components/AppPanel.svelte | 47 +- .../[screenId]/_components/AppPreview.svelte | 57 +- .../ComponentDropdownMenu.svelte | 0 .../ComponentList}/ComponentKeyHandler.svelte | 20 +- .../ComponentScrollWrapper.svelte | 6 +- .../ComponentList}/ComponentTree.svelte | 3 +- .../DNDPositionIndicator.svelte | 0 .../ScreenslotDropdownMenu.svelte | 0 .../ComponentList}/dndStore.js | 0 .../_components/ComponentList/index.svelte | 163 +++++ .../[screenId]/_components/LeftPanel.svelte | 21 + .../ScreenList/DropdownMenu.svelte} | 2 +- .../ScreenList}/RoleIndicator.svelte | 8 +- .../_components/ScreenList/index.svelte | 304 ++++++++ .../design/[screenId]/_fallback.svelte | 5 - .../design/[screenId]/_layout.svelte | 76 +- .../navigation/ComponentListPanel.svelte | 90 --- .../components/[componentId]/_layout.svelte | 41 -- .../components/[componentId]/index.svelte | 4 - .../design/[screenId]/components/index.svelte | 18 - .../design/[screenId]/index.svelte | 3 +- .../_components/LayoutDropdownMenu.svelte | 41 -- .../_components/LayoutListPanel.svelte | 29 - .../_components/LayoutSettingsPanel.svelte | 53 -- .../layouts/[layoutId]/_layout.svelte | 20 - .../layouts/[layoutId]/index.svelte | 7 - .../design/[screenId]/layouts/_layout.svelte | 12 - .../design/[screenId]/layouts/index.svelte | 12 - .../_components/NavigationInfoPanel.svelte | 33 - .../NavigationSettingsPanel.svelte | 110 --- .../design/[screenId]/navigation/index.svelte | 7 - .../_components/ScreenListPanel.svelte | 75 -- .../design/[screenId]/screens/index.svelte | 12 - .../theme/_components/ThemeInfoPanel.svelte | 12 - .../_components/ThemeSettingsPanel.svelte | 55 -- .../design/[screenId]/theme/index.svelte | 7 - .../{ => NewScreen}/CreateScreenModal.svelte | 15 +- .../{ => NewScreen}/DatasourceModal.svelte | 0 .../{ => NewScreen}/ScreenRoleModal.svelte | 0 .../{ => _components/NewScreen}/blank.png | Bin .../design/_components/NewScreen/index.svelte | 105 +++ .../{ => _components/NewScreen}/table.png | Bin .../app/[application]/design/new.svelte | 113 +-- .../_components/StatusRenderer.svelte | 10 +- .../settings/automation-history/index.svelte | 4 +- packages/cli/tsconfig.build.json | 16 +- packages/client/manifest.json | 9 + .../client/src/components/Component.svelte | 12 +- packages/client/src/components/Screen.svelte | 2 +- .../client/src/components/app/Layout.svelte | 37 +- .../src/components/app/forms/Form.svelte | 11 +- .../src/components/app/forms/InnerForm.svelte | 2 +- .../src/components/preview/SettingsBar.svelte | 6 +- packages/client/src/stores/builder.js | 3 - .../grid/layout/NewColumnButton.svelte | 2 +- packages/pro | 2 +- packages/server/Dockerfile | 4 +- packages/server/jest.config.ts | 1 + packages/server/package.json | 17 +- packages/server/scripts/test.sh | 5 +- packages/server/specs/openapi.json | 213 +++++- packages/server/specs/openapi.yaml | 160 ++++- packages/server/specs/resources/index.ts | 2 + packages/server/specs/resources/roles.ts | 65 ++ packages/server/specs/resources/user.ts | 8 +- .../server/src/api/controllers/application.ts | 7 +- packages/server/src/api/controllers/auth.ts | 9 +- .../src/api/controllers/deploy/index.ts | 17 +- .../server/src/api/controllers/permission.ts | 27 +- .../api/controllers/public/applications.ts | 18 +- .../api/controllers/public/mapping/types.ts | 4 + .../src/api/controllers/public/queries.ts | 6 +- .../src/api/controllers/public/roles.ts | 33 + .../server/src/api/controllers/public/rows.ts | 13 +- .../src/api/controllers/public/tables.ts | 13 +- .../src/api/controllers/public/users.ts | 30 +- .../server/src/api/controllers/query/index.ts | 4 +- .../src/api/controllers/row/external.ts | 22 +- .../server/src/api/controllers/row/index.ts | 7 +- .../src/api/controllers/row/internal.ts | 23 +- .../server/src/api/controllers/row/utils.ts | 15 +- .../server/src/api/controllers/row/views.ts | 78 +-- .../src/api/controllers/table/external.ts | 20 +- .../server/src/api/controllers/table/index.ts | 4 +- .../src/api/controllers/table/internal.ts | 35 +- .../server/src/api/controllers/table/utils.ts | 2 +- .../server/src/api/routes/public/roles.ts | 56 ++ .../src/api/routes/public/tests/users.spec.js | 38 - .../src/api/routes/public/tests/users.spec.ts | 126 ++++ packages/server/src/api/routes/row.ts | 170 ++--- ...ermissions.spec.js => permissions.spec.ts} | 113 ++- .../server/src/api/routes/tests/role.spec.js | 5 +- .../server/src/api/routes/tests/row.spec.ts | 656 +++++++++--------- .../src/api/routes/tests/viewV2.spec.ts | 18 +- packages/server/src/api/routes/view.ts | 2 +- packages/server/src/app.ts | 125 +--- packages/server/src/automations/index.ts | 4 + .../server/src/automations/steps/queryRows.ts | 17 +- .../tests/{filter.spec.js => filter.spec.ts} | 23 +- packages/server/src/automations/utils.ts | 13 +- packages/server/src/db/utils.ts | 17 +- packages/server/src/definitions/openapi.ts | 113 ++- packages/server/src/environment.ts | 2 + packages/server/src/features.ts | 24 + .../src/integration-test/postgres.spec.ts | 22 +- .../src/integrations/microsoftSqlServer.ts | 12 +- packages/server/src/integrations/mysql.ts | 66 +- packages/server/src/koa.ts | 102 +++ packages/server/src/middleware/noViewData.ts | 9 - .../src/middleware/tests/noViewData.spec.ts | 83 --- .../middleware/tests/trimViewRowInfo.spec.ts | 27 +- .../server/src/middleware/trimViewRowInfo.ts | 33 +- .../server/src/sdk/app/permissions/index.ts | 37 + .../app/permissions/tests/permissions.spec.ts | 52 ++ packages/server/src/sdk/app/rows/search.ts | 16 +- .../src/sdk/app/rows/search/external.ts | 3 +- .../src/sdk/app/rows/search/internal.ts | 4 +- .../app/rows/search/tests/external.spec.ts | 11 +- .../app/rows/search/tests/internal.spec.ts | 3 +- packages/server/src/sdk/app/views/index.ts | 49 +- .../src/sdk/app/views/tests/views.spec.ts | 379 ++++++++-- packages/server/src/sdk/index.ts | 2 + packages/server/src/startup.ts | 5 +- .../src/tests/utilities/TestConfiguration.ts | 16 +- .../server/src/tests/utilities/api/index.ts | 3 + .../src/tests/utilities/api/permission.ts | 52 ++ .../server/src/tests/utilities/api/row.ts | 37 +- .../server/src/tests/utilities/api/viewV2.ts | 74 +- packages/server/src/threads/automation.ts | 57 +- packages/server/src/threads/definitions.ts | 6 + packages/server/src/threads/query.ts | 8 +- packages/server/src/utilities/global.ts | 86 +-- packages/server/src/utilities/security.ts | 8 +- packages/server/src/utilities/users.ts | 17 +- .../server/src/utilities/workerRequests.ts | 31 +- packages/shared-core/package.json | 11 + packages/shared-core/src/filters.ts | 97 +-- packages/shared-core/tsconfig.build.json | 2 +- packages/shared-core/tsconfig.json | 6 + packages/types/src/api/web/app/rows.ts | 13 +- packages/types/src/api/web/app/table.ts | 12 +- packages/types/src/api/web/index.ts | 1 + packages/types/src/api/web/searchFilter.ts | 54 ++ .../types/src/documents/app/automation.ts | 5 +- packages/types/src/documents/app/view.ts | 7 +- packages/types/src/documents/document.ts | 6 + .../types/src/documents/global/userGroup.ts | 4 + packages/types/src/sdk/datasources.ts | 6 + packages/types/src/sdk/index.ts | 1 + packages/types/src/sdk/licensing/feature.ts | 2 + packages/types/src/sdk/permissions.ts | 1 - packages/types/src/sdk/row.ts | 16 + packages/types/src/sdk/search.ts | 6 + packages/types/tsconfig.build.json | 2 +- packages/worker/Dockerfile | 2 +- packages/worker/package.json | 15 + .../worker/src/api/controllers/global/self.ts | 4 +- .../src/api/controllers/global/users.ts | 8 +- .../routes/global/tests/appBuilder.spec.ts | 4 +- .../src/api/routes/global/tests/scim.spec.ts | 2 + packages/worker/src/environment.ts | 2 + packages/worker/src/features.ts | 13 + packages/worker/src/tests/jestEnv.ts | 2 +- .../validators/dynamodb.integration.spec.ts | 4 +- scripts/build.js | 6 +- yarn.lock | 30 +- 228 files changed, 4362 insertions(+), 2669 deletions(-) create mode 100644 .github/workflows/check_unreleased_changes.yml delete mode 100644 hosting/docker-compose.test.yaml rename hosting/{dependencies => tests}/Dockerfile (100%) rename hosting/{dependencies => tests}/README.md (100%) rename hosting/{dependencies => tests}/runner.sh (100%) rename packages/backend-core/src/{featureFlags => features}/index.ts (98%) create mode 100644 packages/backend-core/src/features/installation.ts rename packages/backend-core/src/{featureFlags => features}/tests/featureFlags.spec.ts (100%) rename packages/builder/src/pages/builder/app/[application]/design/[screenId]/{components/[componentId]/_components/settings => [componentId]/_components/Component}/ComponentInfoSection.svelte (100%) rename packages/builder/src/pages/builder/app/[application]/design/[screenId]/{components/[componentId]/_components/settings => [componentId]/_components/Component}/ComponentSettingsPanel.svelte (100%) rename packages/builder/src/pages/builder/app/[application]/design/[screenId]/{components/[componentId]/_components/settings => [componentId]/_components/Component}/ComponentSettingsSection.svelte (100%) rename packages/builder/src/pages/builder/app/[application]/design/[screenId]/{components/[componentId]/_components/settings => [componentId]/_components/Component}/ConditionalUIDrawer.svelte (100%) rename packages/builder/src/pages/builder/app/[application]/design/[screenId]/{components/[componentId]/_components/settings => [componentId]/_components/Component}/ConditionalUISection.svelte (100%) rename packages/builder/src/pages/builder/app/[application]/design/[screenId]/{components/[componentId]/_components/settings => [componentId]/_components/Component}/CustomStylesSection.svelte (100%) rename packages/builder/src/pages/builder/app/[application]/design/[screenId]/{components/[componentId]/_components/settings => [componentId]/_components/Component}/DesignSection.svelte (100%) rename packages/builder/src/pages/builder/app/[application]/design/[screenId]/{components/[componentId]/_components/settings => [componentId]/_components/Component}/StyleSection.svelte (100%) rename packages/builder/src/pages/builder/app/[application]/design/[screenId]/{components/[componentId]/_components/settings => [componentId]/_components/Component}/componentStyles.js (100%) rename packages/builder/src/pages/builder/app/[application]/design/[screenId]/{navigation/_components/NavigationLinksDrawer.svelte => [componentId]/_components/Navigation/LinksDrawer.svelte} (100%) rename packages/builder/src/pages/builder/app/[application]/design/[screenId]/{navigation/_components/NavigationLinksEditor.svelte => [componentId]/_components/Navigation/LinksEditor.svelte} (75%) create mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_components/Navigation/index.svelte rename packages/builder/src/pages/builder/app/[application]/design/[screenId]/{theme/_components => [componentId]/_components/Screen}/AppThemeSelect.svelte (100%) rename packages/builder/src/pages/builder/app/[application]/design/[screenId]/{theme/_components => [componentId]/_components/Screen}/ButtonRoundnessSelect.svelte (100%) rename packages/builder/src/pages/builder/app/[application]/design/[screenId]/{screens/_components/ScreenSettingsPanel.svelte => [componentId]/_components/Screen/GeneralPanel.svelte} (72%) create mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_components/Screen/ThemePanel.svelte create mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_components/Screen/index.svelte create mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_layout.svelte create mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/index.svelte rename packages/builder/src/pages/builder/app/[application]/design/[screenId]/{components => }/[componentId]/new/_components/NewComponentPanel.svelte (98%) rename packages/builder/src/pages/builder/app/[application]/design/[screenId]/{components => }/[componentId]/new/_components/componentStructure.json (100%) rename packages/builder/src/pages/builder/app/[application]/design/[screenId]/{components => }/[componentId]/new/index.svelte (100%) rename packages/builder/src/pages/builder/app/[application]/design/[screenId]/{components/[componentId]/_components/navigation => _components/ComponentList}/ComponentDropdownMenu.svelte (100%) rename packages/builder/src/pages/builder/app/[application]/design/[screenId]/{components/[componentId]/_components/navigation => _components/ComponentList}/ComponentKeyHandler.svelte (90%) rename packages/builder/src/pages/builder/app/[application]/design/[screenId]/{components/[componentId]/_components/navigation => _components/ComponentList}/ComponentScrollWrapper.svelte (93%) rename packages/builder/src/pages/builder/app/[application]/design/[screenId]/{components/[componentId]/_components/navigation => _components/ComponentList}/ComponentTree.svelte (98%) rename packages/builder/src/pages/builder/app/[application]/design/[screenId]/{components/[componentId]/_components/navigation => _components/ComponentList}/DNDPositionIndicator.svelte (100%) rename packages/builder/src/pages/builder/app/[application]/design/[screenId]/{components/[componentId]/_components/navigation => _components/ComponentList}/ScreenslotDropdownMenu.svelte (100%) rename packages/builder/src/pages/builder/app/[application]/design/[screenId]/{components/[componentId]/_components/navigation => _components/ComponentList}/dndStore.js (100%) create mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/ComponentList/index.svelte create mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/LeftPanel.svelte rename packages/builder/src/pages/builder/app/[application]/design/[screenId]/{screens/_components/ScreenDropdownMenu.svelte => _components/ScreenList/DropdownMenu.svelte} (97%) rename packages/builder/src/pages/builder/app/[application]/design/[screenId]/{screens/_components => _components/ScreenList}/RoleIndicator.svelte (87%) create mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/ScreenList/index.svelte delete mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/_fallback.svelte delete mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/_components/navigation/ComponentListPanel.svelte delete mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/_layout.svelte delete mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/index.svelte delete mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/index.svelte delete mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/[layoutId]/_components/LayoutDropdownMenu.svelte delete mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/[layoutId]/_components/LayoutListPanel.svelte delete mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/[layoutId]/_components/LayoutSettingsPanel.svelte delete mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/[layoutId]/_layout.svelte delete mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/[layoutId]/index.svelte delete mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/_layout.svelte delete mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/index.svelte delete mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/navigation/_components/NavigationInfoPanel.svelte delete mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/navigation/_components/NavigationSettingsPanel.svelte delete mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/navigation/index.svelte delete mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/screens/_components/ScreenListPanel.svelte delete mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/screens/index.svelte delete mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/theme/_components/ThemeInfoPanel.svelte delete mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/theme/_components/ThemeSettingsPanel.svelte delete mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/theme/index.svelte rename packages/builder/src/pages/builder/app/[application]/design/_components/{ => NewScreen}/CreateScreenModal.svelte (94%) rename packages/builder/src/pages/builder/app/[application]/design/_components/{ => NewScreen}/DatasourceModal.svelte (100%) rename packages/builder/src/pages/builder/app/[application]/design/_components/{ => NewScreen}/ScreenRoleModal.svelte (100%) rename packages/builder/src/pages/builder/app/[application]/design/{ => _components/NewScreen}/blank.png (100%) create mode 100644 packages/builder/src/pages/builder/app/[application]/design/_components/NewScreen/index.svelte rename packages/builder/src/pages/builder/app/[application]/design/{ => _components/NewScreen}/table.png (100%) create mode 100644 packages/server/specs/resources/roles.ts create mode 100644 packages/server/src/api/controllers/public/roles.ts create mode 100644 packages/server/src/api/routes/public/roles.ts delete mode 100644 packages/server/src/api/routes/public/tests/users.spec.js create mode 100644 packages/server/src/api/routes/public/tests/users.spec.ts rename packages/server/src/api/routes/tests/{permissions.spec.js => permissions.spec.ts} (57%) rename packages/server/src/automations/tests/{filter.spec.js => filter.spec.ts} (76%) create mode 100644 packages/server/src/features.ts create mode 100644 packages/server/src/koa.ts delete mode 100644 packages/server/src/middleware/noViewData.ts delete mode 100644 packages/server/src/middleware/tests/noViewData.spec.ts create mode 100644 packages/server/src/sdk/app/permissions/index.ts create mode 100644 packages/server/src/sdk/app/permissions/tests/permissions.spec.ts create mode 100644 packages/server/src/tests/utilities/api/permission.ts create mode 100644 packages/types/src/api/web/searchFilter.ts create mode 100644 packages/types/src/sdk/row.ts create mode 100644 packages/worker/src/features.ts diff --git a/.github/workflows/budibase_ci.yml b/.github/workflows/budibase_ci.yml index 9da52f8bc0..3e4b2221d2 100644 --- a/.github/workflows/budibase_ci.yml +++ b/.github/workflows/budibase_ci.yml @@ -18,6 +18,8 @@ env: BRANCH: ${{ github.event.pull_request.head.ref }} BASE_BRANCH: ${{ github.event.pull_request.base.ref}} PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + NX_BASE_BRANCH: origin/${{ github.base_ref }} + USE_NX_AFFECTED: ${{ github.event_name == 'pull_request' && github.base_ref != 'master'}} jobs: lint: @@ -25,20 +27,20 @@ jobs: steps: - name: Checkout repo and submodules uses: actions/checkout@v3 - if: github.repository == 'Budibase/budibase' + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'Budibase/budibase' with: submodules: true token: ${{ secrets.PERSONAL_ACCESS_TOKEN || github.token }} - name: Checkout repo only uses: actions/checkout@v3 - if: github.repository != 'Budibase/budibase' + if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != 'Budibase/budibase' - - name: Use Node.js 14.x + - name: Use Node.js 18.x uses: actions/setup-node@v3 with: - node-version: 14.x + node-version: 18.x cache: "yarn" - - run: yarn + - run: yarn --frozen-lockfile - run: yarn lint build: @@ -46,45 +48,66 @@ jobs: steps: - name: Checkout repo and submodules uses: actions/checkout@v3 - if: github.repository == 'Budibase/budibase' + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'Budibase/budibase' with: submodules: true token: ${{ secrets.PERSONAL_ACCESS_TOKEN || github.token }} + fetch-depth: 0 - name: Checkout repo only uses: actions/checkout@v3 - if: github.repository != 'Budibase/budibase' + if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != 'Budibase/budibase' + with: + fetch-depth: 0 - - name: Use Node.js 14.x + - name: Use Node.js 18.x uses: actions/setup-node@v3 with: - node-version: 14.x + node-version: 18.x cache: "yarn" - - run: yarn + - run: yarn --frozen-lockfile + # Run build all the projects - - run: yarn build + - name: Build + run: | + yarn build # Check the types of the projects built via esbuild - - run: yarn check:types + - name: Check types + run: | + if ${{ env.USE_NX_AFFECTED }}; then + yarn check:types --since=${{ env.NX_BASE_BRANCH }} + else + yarn check:types + fi test-libraries: runs-on: ubuntu-latest steps: - name: Checkout repo and submodules uses: actions/checkout@v3 - if: github.repository == 'Budibase/budibase' + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'Budibase/budibase' with: submodules: true token: ${{ secrets.PERSONAL_ACCESS_TOKEN || github.token }} + fetch-depth: 0 - name: Checkout repo only uses: actions/checkout@v3 - if: github.repository != 'Budibase/budibase' + if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != 'Budibase/budibase' + with: + fetch-depth: 0 - - name: Use Node.js 14.x + - name: Use Node.js 18.x uses: actions/setup-node@v3 with: - node-version: 14.x + node-version: 18.x cache: "yarn" - - run: yarn - - run: yarn test --ignore=@budibase/worker --ignore=@budibase/server --ignore=@budibase/pro + - run: yarn --frozen-lockfile + - name: Test + run: | + if ${{ env.USE_NX_AFFECTED }}; then + yarn test --ignore=@budibase/worker --ignore=@budibase/server --ignore=@budibase/pro --since=${{ env.NX_BASE_BRANCH }} + else + yarn test --ignore=@budibase/worker --ignore=@budibase/server --ignore=@budibase/pro + fi - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos @@ -96,21 +119,31 @@ jobs: steps: - name: Checkout repo and submodules uses: actions/checkout@v3 - if: github.repository == 'Budibase/budibase' + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'Budibase/budibase' with: submodules: true token: ${{ secrets.PERSONAL_ACCESS_TOKEN || github.token }} + fetch-depth: 0 - name: Checkout repo only uses: actions/checkout@v3 - if: github.repository != 'Budibase/budibase' + if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != 'Budibase/budibase' + with: + fetch-depth: 0 - - name: Use Node.js 14.x + - name: Use Node.js 18.x uses: actions/setup-node@v3 with: - node-version: 14.x + node-version: 18.x cache: "yarn" - - run: yarn - - run: yarn test --scope=@budibase/worker --scope=@budibase/server + - run: yarn --frozen-lockfile + - name: Test worker and server + run: | + if ${{ env.USE_NX_AFFECTED }}; then + yarn test --scope=@budibase/worker --scope=@budibase/server --since=${{ env.NX_BASE_BRANCH }} + else + yarn test --scope=@budibase/worker --scope=@budibase/server + fi + - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN || github.token }} # not required for public repos @@ -119,42 +152,50 @@ jobs: test-pro: runs-on: ubuntu-latest - if: github.repository == 'Budibase/budibase' + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'Budibase/budibase' steps: - name: Checkout repo and submodules uses: actions/checkout@v3 with: submodules: true token: ${{ secrets.PERSONAL_ACCESS_TOKEN || github.token }} + fetch-depth: 0 - - name: Use Node.js 14.x + - name: Use Node.js 18.x uses: actions/setup-node@v3 with: - node-version: 14.x + node-version: 18.x cache: "yarn" - - run: yarn - - run: yarn test --scope=@budibase/pro + - run: yarn --frozen-lockfile + - name: Test + run: | + if ${{ env.USE_NX_AFFECTED }}; then + yarn test --scope=@budibase/pro --since=${{ env.NX_BASE_BRANCH }} + else + yarn test --scope=@budibase/pro + fi integration-test: runs-on: ubuntu-latest steps: - name: Checkout repo and submodules uses: actions/checkout@v3 - if: github.repository == 'Budibase/budibase' + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'Budibase/budibase' with: submodules: true token: ${{ secrets.PERSONAL_ACCESS_TOKEN || github.token }} - name: Checkout repo only uses: actions/checkout@v3 - if: github.repository != 'Budibase/budibase' + if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != 'Budibase/budibase' - - name: Use Node.js 14.x + - name: Use Node.js 18.x uses: actions/setup-node@v3 with: - node-version: 14.x + node-version: 18.x cache: "yarn" - - run: yarn - - run: yarn build --projects=@budibase/server,@budibase/worker,@budibase/client + - run: yarn --frozen-lockfile + - name: Build packages + run: yarn build --scope @budibase/server --scope @budibase/worker --scope @budibase/client --scope @budibase/backend-core - name: Run tests run: | cd qa-core @@ -166,13 +207,12 @@ jobs: check-pro-submodule: runs-on: ubuntu-latest - if: github.repository == 'Budibase/budibase' + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'Budibase/budibase' steps: - name: Checkout repo and submodules uses: actions/checkout@v3 with: submodules: true - fetch-depth: 0 token: ${{ secrets.PERSONAL_ACCESS_TOKEN || github.token }} - name: Check pro commit diff --git a/.github/workflows/check_unreleased_changes.yml b/.github/workflows/check_unreleased_changes.yml new file mode 100644 index 0000000000..d558330545 --- /dev/null +++ b/.github/workflows/check_unreleased_changes.yml @@ -0,0 +1,29 @@ +name: check_unreleased_changes + +on: + pull_request: + branches: + - master + +jobs: + check_unreleased: + runs-on: ubuntu-latest + steps: + - name: Check for unreleased changes + env: + REPO: "Budibase/budibase" + TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + RELEASE_TIMESTAMP=$(curl -s -H "Authorization: token $TOKEN" \ + "https://api.github.com/repos/$REPO/releases/latest" | \ + jq -r .published_at) + COMMIT_TIMESTAMP=$(curl -s -H "Authorization: token $TOKEN" \ + "https://api.github.com/repos/$REPO/commits/master" | \ + jq -r .commit.committer.date) + RELEASE_SECONDS=$(date --date="$RELEASE_TIMESTAMP" "+%s") + COMMIT_SECONDS=$(date --date="$COMMIT_TIMESTAMP" "+%s") + if (( COMMIT_SECONDS > RELEASE_SECONDS )); then + echo "There are unreleased changes. Please release these changes before merging." + exit 1 + fi + echo "No unreleased changes detected." diff --git a/.github/workflows/release-develop.yml b/.github/workflows/release-develop.yml index 61cb283e28..bd727b7865 100644 --- a/.github/workflows/release-develop.yml +++ b/.github/workflows/release-develop.yml @@ -44,7 +44,7 @@ jobs: - uses: actions/setup-node@v1 with: - node-version: 14.x + node-version: 18.x - run: yarn install --frozen-lockfile - name: Update versions diff --git a/.nvmrc b/.nvmrc index 835d07c442..7950a44576 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -v14.20.1 +v18.17.0 diff --git a/.tool-versions b/.tool-versions index 9f2ea77b14..a909d60941 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1,3 +1,3 @@ -nodejs 14.21.3 +nodejs 18.17.0 python 3.10.0 -yarn 1.22.19 \ No newline at end of file +yarn 1.22.19 diff --git a/.vscode/launch.json b/.vscode/launch.json index 8cb49d5825..cfd8d7b155 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,42 +1,31 @@ + { - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "name": "Budibase Server", - "type": "node", - "request": "launch", - "runtimeArgs": [ - "--nolazy", - "-r", - "ts-node/register/transpile-only" - ], - "args": [ - "${workspaceFolder}/packages/server/src/index.ts" - ], - "cwd": "${workspaceFolder}/packages/server" - }, - { - "name": "Budibase Worker", - "type": "node", - "request": "launch", - "runtimeArgs": [ - "--nolazy", - "-r", - "ts-node/register/transpile-only" - ], - "args": [ - "${workspaceFolder}/packages/worker/src/index.ts" - ], - "cwd": "${workspaceFolder}/packages/worker" - }, - ], - "compounds": [ - { - "name": "Start Budibase", - "configurations": ["Budibase Server", "Budibase Worker"] - } - ] -} \ No newline at end of file + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Budibase Server", + "type": "node", + "request": "launch", + "runtimeArgs": ["--nolazy", "-r", "ts-node/register/transpile-only"], + "args": ["${workspaceFolder}/packages/server/src/index.ts"], + "cwd": "${workspaceFolder}/packages/server" + }, + { + "name": "Budibase Worker", + "type": "node", + "request": "launch", + "runtimeArgs": ["--nolazy", "-r", "ts-node/register/transpile-only"], + "args": ["${workspaceFolder}/packages/worker/src/index.ts"], + "cwd": "${workspaceFolder}/packages/worker" + } + ], + "compounds": [ + { + "name": "Start Budibase", + "configurations": ["Budibase Server", "Budibase Worker"] + } + ] +} diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 2fb4c36fa8..70f198a84c 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -90,7 +90,7 @@ Component libraries are collections of components as well as the definition of t #### 1. Prerequisites -- NodeJS version `14.x.x` +- NodeJS version `18.x.x` - Python version `3.x` ### Using asdf (recommended) diff --git a/hosting/docker-compose.test.yaml b/hosting/docker-compose.test.yaml deleted file mode 100644 index f059173d2d..0000000000 --- a/hosting/docker-compose.test.yaml +++ /dev/null @@ -1,47 +0,0 @@ -version: "3" - -# optional ports are specified throughout for more advanced use cases. - -services: - minio-service: - restart: on-failure - # Last version that supports the "fs" backend - image: minio/minio:RELEASE.2022-10-24T18-35-07Z - ports: - - "9000" - - "9001" - environment: - MINIO_ACCESS_KEY: ${MINIO_ACCESS_KEY} - MINIO_SECRET_KEY: ${MINIO_SECRET_KEY} - command: server /data --console-address ":9001" - healthcheck: - test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"] - interval: 30s - timeout: 20s - retries: 3 - - couchdb-service: - # platform: linux/amd64 - restart: on-failure - image: budibase/couchdb - environment: - - COUCHDB_PASSWORD=${COUCH_DB_PASSWORD} - - COUCHDB_USER=${COUCH_DB_USER} - ports: - - "5984" - - "4369" - - "9100" - healthcheck: - test: ["CMD", "curl", "-f", "http://localhost:5984/_up"] - interval: 30s - timeout: 20s - retries: 3 - - redis-service: - restart: on-failure - image: redis - command: redis-server --requirepass ${REDIS_PASSWORD} - ports: - - "6379" - healthcheck: - test: ["CMD", "redis-cli", "ping"] \ No newline at end of file diff --git a/hosting/single/Dockerfile b/hosting/single/Dockerfile index e43e5ad10c..9fdf2449d1 100644 --- a/hosting/single/Dockerfile +++ b/hosting/single/Dockerfile @@ -1,7 +1,7 @@ -FROM node:14-slim as build +FROM node:18-slim as build # install node-gyp dependencies -RUN apt-get update && apt-get upgrade -y && apt-get install -y --no-install-recommends apt-utils cron g++ make python +RUN apt-get update && apt-get upgrade -y && apt-get install -y --no-install-recommends apt-utils cron g++ make python3 # add pin script WORKDIR / diff --git a/hosting/dependencies/Dockerfile b/hosting/tests/Dockerfile similarity index 100% rename from hosting/dependencies/Dockerfile rename to hosting/tests/Dockerfile diff --git a/hosting/dependencies/README.md b/hosting/tests/README.md similarity index 100% rename from hosting/dependencies/README.md rename to hosting/tests/README.md diff --git a/hosting/dependencies/runner.sh b/hosting/tests/runner.sh similarity index 100% rename from hosting/dependencies/runner.sh rename to hosting/tests/runner.sh diff --git a/jestTestcontainersConfigGenerator.js b/jestTestcontainersConfigGenerator.js index 4b94cf5016..1e39ed771f 100644 --- a/jestTestcontainersConfigGenerator.js +++ b/jestTestcontainersConfigGenerator.js @@ -1,9 +1,16 @@ module.exports = () => { return { - dockerCompose: { - composeFilePath: "../../hosting", - composeFile: "docker-compose.test.yaml", - startupTimeout: 10000, - }, + couchdb: { + image: "budibase/couchdb", + ports: [5984], + env: { + COUCHDB_PASSWORD: "budibase", + COUCHDB_USER: "budibase", + }, + wait: { + type: "ports", + timeout: 20000, + } + } } } diff --git a/package.json b/package.json index d27af2e27d..4e4befb5f2 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "preinstall": "node scripts/syncProPackage.js", "setup": "git config submodule.recurse true && git submodule update && node ./hosting/scripts/setup.js && yarn && yarn build && yarn dev", "bootstrap": "./scripts/link-dependencies.sh && echo '***BOOTSTRAP ONLY REQUIRED FOR USE WITH ACCOUNT PORTAL***'", - "build": "yarn nx run-many -t=build", + "build": "lerna run build --stream", "build:dev": "lerna run --stream prebuild && yarn nx run-many --target=build --output-style=dynamic --watch --preserveWatchOutput", "check:types": "lerna run check:types", "backend:bootstrap": "./scripts/scopeBackend.sh && yarn run bootstrap", @@ -109,7 +109,7 @@ "@budibase/types": "0.0.0" }, "engines": { - "node": ">=14.0.0 <15.0.0" + "node": ">=18.0.0 <19.0.0" }, "dependencies": {} } diff --git a/packages/backend-core/src/cache/user.ts b/packages/backend-core/src/cache/user.ts index 8281bfca62..e2af78adfd 100644 --- a/packages/backend-core/src/cache/user.ts +++ b/packages/backend-core/src/cache/user.ts @@ -4,6 +4,8 @@ import * as context from "../context" import * as platform from "../platform" import env from "../environment" import * as accounts from "../accounts" +import { UserDB } from "../users" +import { sdk } from "@budibase/shared-core" const EXPIRY_SECONDS = 3600 @@ -60,6 +62,18 @@ export async function getUser( // make sure the tenant ID is always correct/set user.tenantId = tenantId } + // if has groups, could have builder permissions granted by a group + if (user.userGroups && !sdk.users.isGlobalBuilder(user)) { + await context.doInTenant(tenantId, async () => { + const appIds = await UserDB.getGroupBuilderAppIds(user) + if (appIds.length) { + const existing = user.builder?.apps || [] + user.builder = { + apps: [...new Set(existing.concat(appIds))], + } + } + }) + } return user } diff --git a/packages/backend-core/src/db/lucene.ts b/packages/backend-core/src/db/lucene.ts index a491451a62..7451d581b5 100644 --- a/packages/backend-core/src/db/lucene.ts +++ b/packages/backend-core/src/db/lucene.ts @@ -1,7 +1,6 @@ import fetch from "node-fetch" import { getCouchInfo } from "./couch" -import { SearchFilters, Row } from "@budibase/types" -import { createUserIndex } from "./searchIndexes/searchIndexes" +import { SearchFilters, Row, EmptyFilterOption } from "@budibase/types" const QUERY_START_REGEX = /\d[0-9]*:/g @@ -65,6 +64,7 @@ export class QueryBuilder { this.#index = index this.#query = { allOr: false, + onEmptyFilter: EmptyFilterOption.RETURN_ALL, string: {}, fuzzy: {}, range: {}, @@ -218,6 +218,10 @@ export class QueryBuilder { this.#query.allOr = true } + setOnEmptyFilter(value: EmptyFilterOption) { + this.#query.onEmptyFilter = value + } + handleSpaces(input: string) { if (this.#noEscaping) { return input @@ -289,8 +293,9 @@ export class QueryBuilder { const builder = this let allOr = this.#query && this.#query.allOr let query = allOr ? "" : "*:*" + let allFiltersEmpty = true const allPreProcessingOpts = { escape: true, lowercase: true, wrap: true } - let tableId + let tableId: string = "" if (this.#query.equal!.tableId) { tableId = this.#query.equal!.tableId delete this.#query.equal!.tableId @@ -305,7 +310,7 @@ export class QueryBuilder { } const contains = (key: string, value: any, mode = "AND") => { - if (Array.isArray(value) && value.length === 0) { + if (!value || (Array.isArray(value) && value.length === 0)) { return null } if (!Array.isArray(value)) { @@ -384,6 +389,12 @@ export class QueryBuilder { built += ` ${mode} ` } built += expression + if ( + (typeof value !== "string" && value != null) || + (typeof value === "string" && value !== tableId && value !== "") + ) { + allFiltersEmpty = false + } } if (opts?.returnBuilt) { return built @@ -463,6 +474,13 @@ export class QueryBuilder { allOr = false build({ tableId }, equal) } + if (allFiltersEmpty) { + if (this.#query.onEmptyFilter === EmptyFilterOption.RETURN_NONE) { + return "" + } else if (this.#query?.allOr) { + return query.replace("()", "(*:*)") + } + } return query } diff --git a/packages/backend-core/src/db/tests/lucene.spec.ts b/packages/backend-core/src/db/tests/lucene.spec.ts index a82828d8f2..7716661d88 100644 --- a/packages/backend-core/src/db/tests/lucene.spec.ts +++ b/packages/backend-core/src/db/tests/lucene.spec.ts @@ -1,6 +1,6 @@ import { newid } from "../../docIds/newid" import { getDB } from "../db" -import { Database } from "@budibase/types" +import { Database, EmptyFilterOption } from "@budibase/types" import { QueryBuilder, paginatedSearch, fullSearch } from "../lucene" const INDEX_NAME = "main" @@ -156,6 +156,76 @@ describe("lucene", () => { expect(resp.rows.length).toBe(2) }) + describe("empty filters behaviour", () => { + it("should return all rows by default", async () => { + const builder = new QueryBuilder(dbName, INDEX_NAME) + builder.addEqual("property", "") + builder.addEqual("number", null) + builder.addString("property", "") + builder.addFuzzy("property", "") + builder.addNotEqual("number", undefined) + builder.addOneOf("number", null) + builder.addContains("array", undefined) + builder.addNotContains("array", null) + builder.addContainsAny("array", null) + + const resp = await builder.run() + expect(resp.rows.length).toBe(3) + }) + + it("should return all rows when onEmptyFilter is ALL", async () => { + const builder = new QueryBuilder(dbName, INDEX_NAME) + builder.setOnEmptyFilter(EmptyFilterOption.RETURN_ALL) + builder.setAllOr() + builder.addEqual("property", "") + builder.addEqual("number", null) + builder.addString("property", "") + builder.addFuzzy("property", "") + builder.addNotEqual("number", undefined) + builder.addOneOf("number", null) + builder.addContains("array", undefined) + builder.addNotContains("array", null) + builder.addContainsAny("array", null) + + const resp = await builder.run() + expect(resp.rows.length).toBe(3) + }) + + it("should return no rows when onEmptyFilter is NONE", async () => { + const builder = new QueryBuilder(dbName, INDEX_NAME) + builder.setOnEmptyFilter(EmptyFilterOption.RETURN_NONE) + builder.addEqual("property", "") + builder.addEqual("number", null) + builder.addString("property", "") + builder.addFuzzy("property", "") + builder.addNotEqual("number", undefined) + builder.addOneOf("number", null) + builder.addContains("array", undefined) + builder.addNotContains("array", null) + builder.addContainsAny("array", null) + + const resp = await builder.run() + expect(resp.rows.length).toBe(0) + }) + + it("should return all matching rows when onEmptyFilter is NONE, but a filter value is provided", async () => { + const builder = new QueryBuilder(dbName, INDEX_NAME) + builder.setOnEmptyFilter(EmptyFilterOption.RETURN_NONE) + builder.addEqual("property", "") + builder.addEqual("number", 1) + builder.addString("property", "") + builder.addFuzzy("property", "") + builder.addNotEqual("number", undefined) + builder.addOneOf("number", null) + builder.addContains("array", undefined) + builder.addNotContains("array", null) + builder.addContainsAny("array", null) + + const resp = await builder.run() + expect(resp.rows.length).toBe(1) + }) + }) + describe("skip", () => { const skipDbName = `db-${newid()}` let docs: { diff --git a/packages/backend-core/src/featureFlags/index.ts b/packages/backend-core/src/features/index.ts similarity index 98% rename from packages/backend-core/src/featureFlags/index.ts rename to packages/backend-core/src/features/index.ts index 877cd60e1a..8f5c903e05 100644 --- a/packages/backend-core/src/featureFlags/index.ts +++ b/packages/backend-core/src/features/index.ts @@ -1,5 +1,6 @@ import env from "../environment" import * as context from "../context" +export * from "./installation" /** * Read the TENANT_FEATURE_FLAGS env var and return an array of features flags for each tenant. diff --git a/packages/backend-core/src/features/installation.ts b/packages/backend-core/src/features/installation.ts new file mode 100644 index 0000000000..defc8bf987 --- /dev/null +++ b/packages/backend-core/src/features/installation.ts @@ -0,0 +1,17 @@ +export function processFeatureEnvVar( + fullList: string[], + featureList?: string +) { + let list + if (!featureList) { + list = fullList + } else { + list = featureList.split(",") + } + for (let feature of list) { + if (!fullList.includes(feature)) { + throw new Error(`Feature: ${feature} is not an allowed option`) + } + } + return list as unknown as T[] +} diff --git a/packages/backend-core/src/featureFlags/tests/featureFlags.spec.ts b/packages/backend-core/src/features/tests/featureFlags.spec.ts similarity index 100% rename from packages/backend-core/src/featureFlags/tests/featureFlags.spec.ts rename to packages/backend-core/src/features/tests/featureFlags.spec.ts diff --git a/packages/backend-core/src/index.ts b/packages/backend-core/src/index.ts index 7b98674788..ffffd8240a 100644 --- a/packages/backend-core/src/index.ts +++ b/packages/backend-core/src/index.ts @@ -6,7 +6,8 @@ export * as roles from "./security/roles" export * as permissions from "./security/permissions" export * as accounts from "./accounts" export * as installation from "./installation" -export * as featureFlags from "./featureFlags" +export * as featureFlags from "./features" +export * as features from "./features/installation" export * as sessions from "./security/sessions" export * as platform from "./platform" export * as auth from "./auth" diff --git a/packages/backend-core/src/middleware/builderOnly.ts b/packages/backend-core/src/middleware/builderOnly.ts index 8c1c54a44c..fafcc524cc 100644 --- a/packages/backend-core/src/middleware/builderOnly.ts +++ b/packages/backend-core/src/middleware/builderOnly.ts @@ -5,11 +5,12 @@ import env from "../environment" export default async (ctx: UserCtx, next: any) => { const appId = getAppId() - const builderFn = env.isWorker() - ? hasBuilderPermissions - : env.isApps() - ? isBuilder - : undefined + const builderFn = + env.isWorker() || !appId + ? hasBuilderPermissions + : env.isApps() + ? isBuilder + : undefined if (!builderFn) { throw new Error("Service name unknown - middleware inactive.") } diff --git a/packages/backend-core/src/middleware/builderOrAdmin.ts b/packages/backend-core/src/middleware/builderOrAdmin.ts index c03e856233..4b8badec15 100644 --- a/packages/backend-core/src/middleware/builderOrAdmin.ts +++ b/packages/backend-core/src/middleware/builderOrAdmin.ts @@ -5,11 +5,12 @@ import env from "../environment" export default async (ctx: UserCtx, next: any) => { const appId = getAppId() - const builderFn = env.isWorker() - ? hasBuilderPermissions - : env.isApps() - ? isBuilder - : undefined + const builderFn = + env.isWorker() || !appId + ? hasBuilderPermissions + : env.isApps() + ? isBuilder + : undefined if (!builderFn) { throw new Error("Service name unknown - middleware inactive.") } diff --git a/packages/backend-core/src/security/permissions.ts b/packages/backend-core/src/security/permissions.ts index 70dae57ae6..aa0b20a30c 100644 --- a/packages/backend-core/src/security/permissions.ts +++ b/packages/backend-core/src/security/permissions.ts @@ -78,7 +78,6 @@ export const BUILTIN_PERMISSIONS = { permissions: [ new Permission(PermissionType.QUERY, PermissionLevel.READ), new Permission(PermissionType.TABLE, PermissionLevel.READ), - new Permission(PermissionType.VIEW, PermissionLevel.READ), ], }, WRITE: { @@ -87,7 +86,6 @@ export const BUILTIN_PERMISSIONS = { permissions: [ new Permission(PermissionType.QUERY, PermissionLevel.WRITE), new Permission(PermissionType.TABLE, PermissionLevel.WRITE), - new Permission(PermissionType.VIEW, PermissionLevel.READ), new Permission(PermissionType.AUTOMATION, PermissionLevel.EXECUTE), ], }, @@ -98,7 +96,6 @@ export const BUILTIN_PERMISSIONS = { new Permission(PermissionType.TABLE, PermissionLevel.WRITE), new Permission(PermissionType.USER, PermissionLevel.READ), new Permission(PermissionType.AUTOMATION, PermissionLevel.EXECUTE), - new Permission(PermissionType.VIEW, PermissionLevel.READ), new Permission(PermissionType.WEBHOOK, PermissionLevel.READ), ], }, @@ -109,7 +106,6 @@ export const BUILTIN_PERMISSIONS = { new Permission(PermissionType.TABLE, PermissionLevel.ADMIN), new Permission(PermissionType.USER, PermissionLevel.ADMIN), new Permission(PermissionType.AUTOMATION, PermissionLevel.ADMIN), - new Permission(PermissionType.VIEW, PermissionLevel.ADMIN), new Permission(PermissionType.WEBHOOK, PermissionLevel.READ), new Permission(PermissionType.QUERY, PermissionLevel.ADMIN), ], diff --git a/packages/backend-core/src/users/db.ts b/packages/backend-core/src/users/db.ts index 55cc97bb1c..c288540f35 100644 --- a/packages/backend-core/src/users/db.ts +++ b/packages/backend-core/src/users/db.ts @@ -1,30 +1,32 @@ import env from "../environment" import * as eventHelpers from "./events" import * as accounts from "../accounts" +import * as accountSdk from "../accounts" import * as cache from "../cache" -import { getIdentity, getTenantId, getGlobalDB } from "../context" +import { getGlobalDB, getIdentity, getTenantId } from "../context" import * as dbUtils from "../db" import { EmailUnavailableError, HTTPError } from "../errors" import * as platform from "../platform" import * as sessions from "../security/sessions" import * as usersCore from "./users" import { + Account, AllDocsResponse, BulkUserCreated, BulkUserDeleted, + isSSOAccount, + isSSOUser, RowResponse, SaveUserOpts, User, - Account, - isSSOUser, - isSSOAccount, UserStatus, + UserGroup, + ContextUser, } from "@budibase/types" -import * as accountSdk from "../accounts" import { - validateUniqueUser, getAccountHolderFromUserIds, isAdmin, + validateUniqueUser, } from "./utils" import { searchExistingEmails } from "./lookup" import { hash } from "../utils" @@ -32,8 +34,14 @@ import { hash } from "../utils" type QuotaUpdateFn = (change: number, cb?: () => Promise) => Promise type GroupUpdateFn = (groupId: string, userIds: string[]) => Promise type FeatureFn = () => Promise +type GroupGetFn = (ids: string[]) => Promise +type GroupBuildersFn = (user: User) => Promise type QuotaFns = { addUsers: QuotaUpdateFn; removeUsers: QuotaUpdateFn } -type GroupFns = { addUsers: GroupUpdateFn } +type GroupFns = { + addUsers: GroupUpdateFn + getBulk: GroupGetFn + getGroupBuilderAppIds: GroupBuildersFn +} type FeatureFns = { isSSOEnforced: FeatureFn; isAppBuildersEnabled: FeatureFn } const bulkDeleteProcessing = async (dbUser: User) => { @@ -179,6 +187,14 @@ export class UserDB { return user } + static async bulkGet(userIds: string[]) { + return await usersCore.bulkGetGlobalUsersById(userIds) + } + + static async bulkUpdate(users: User[]) { + return await usersCore.bulkUpdateGlobalUsers(users) + } + static async save(user: User, opts: SaveUserOpts = {}): Promise { // default booleans to true if (opts.hashPassword == null) { @@ -457,4 +473,12 @@ export class UserDB { await cache.user.invalidateUser(userId) await sessions.invalidateSessions(userId, { reason: "deletion" }) } + + static async getGroups(groupIds: string[]) { + return await this.groups.getBulk(groupIds) + } + + static async getGroupBuilderAppIds(user: User) { + return await this.groups.getGroupBuilderAppIds(user) + } } diff --git a/packages/backend-core/tests/core/utilities/mocks/licenses.ts b/packages/backend-core/tests/core/utilities/mocks/licenses.ts index 6747282040..309f0fd159 100644 --- a/packages/backend-core/tests/core/utilities/mocks/licenses.ts +++ b/packages/backend-core/tests/core/utilities/mocks/licenses.ts @@ -86,6 +86,10 @@ export const useAuditLogs = () => { return useFeature(Feature.AUDIT_LOGS) } +export const usePublicApiUserRoles = () => { + return useFeature(Feature.USER_ROLE_PUBLIC_API) +} + export const useScimIntegration = () => { return useFeature(Feature.SCIM) } @@ -98,6 +102,10 @@ export const useAppBuilders = () => { return useFeature(Feature.APP_BUILDERS) } +export const useViewPermissions = () => { + return useFeature(Feature.VIEW_PERMISSIONS) +} + // QUOTAS export const setAutomationLogsQuota = (value: number) => { diff --git a/packages/backend-core/tests/core/utilities/testContainerUtils.ts b/packages/backend-core/tests/core/utilities/testContainerUtils.ts index f6c702f7ef..7da6cbc777 100644 --- a/packages/backend-core/tests/core/utilities/testContainerUtils.ts +++ b/packages/backend-core/tests/core/utilities/testContainerUtils.ts @@ -32,8 +32,8 @@ function getTestContainerSettings( ): string | null { const entry = Object.entries(global).find( ([k]) => - k.includes(`_${serverName.toUpperCase()}`) && - k.includes(`_${key.toUpperCase()}__`) + k.includes(`${serverName.toUpperCase()}`) && + k.includes(`${key.toUpperCase()}`) ) if (!entry) { return null @@ -67,27 +67,14 @@ function getContainerInfo(containerName: string, port: number) { } function getCouchConfig() { - return getContainerInfo("couchdb-service", 5984) -} - -function getMinioConfig() { - return getContainerInfo("minio-service", 9000) -} - -function getRedisConfig() { - return getContainerInfo("redis-service", 6379) + return getContainerInfo("couchdb", 5984) } export function setupEnv(...envs: any[]) { - const couch = getCouchConfig(), - minio = getCouchConfig(), - redis = getRedisConfig() + const couch = getCouchConfig() const configs = [ { key: "COUCH_DB_PORT", value: couch.port }, { key: "COUCH_DB_URL", value: couch.url }, - { key: "MINIO_PORT", value: minio.port }, - { key: "MINIO_URL", value: minio.url }, - { key: "REDIS_URL", value: redis.url }, ] for (const config of configs.filter(x => !!x.value)) { diff --git a/packages/bbui/src/Actions/position_dropdown.js b/packages/bbui/src/Actions/position_dropdown.js index 8fa02bb8f3..4a5ef890bf 100644 --- a/packages/bbui/src/Actions/position_dropdown.js +++ b/packages/bbui/src/Actions/position_dropdown.js @@ -32,11 +32,10 @@ export default function positionDropdown(element, opts) { left: null, top: null, } - // Determine vertical styles if (align === "right-outside") { styles.top = anchorBounds.top - } else if (window.innerHeight - anchorBounds.bottom < 100) { + } else if (window.innerHeight - anchorBounds.bottom < (maxHeight || 100)) { styles.top = anchorBounds.top - elementBounds.height - offset styles.maxHeight = maxHeight || 240 } else { diff --git a/packages/bbui/src/ColorPicker/ColorPicker.svelte b/packages/bbui/src/ColorPicker/ColorPicker.svelte index 9a70134fb6..2ba5309860 100644 --- a/packages/bbui/src/ColorPicker/ColorPicker.svelte +++ b/packages/bbui/src/ColorPicker/ColorPicker.svelte @@ -1,8 +1,8 @@ -
-
(open = true)}> -
-
- {#if open} -
+
{ + dropdown.toggle() + }} +> +
+
+ + + +
{#each categories as category}
{category.label}
@@ -187,8 +184,8 @@
- {/if} -
+ + diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/theme/_components/AppThemeSelect.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_components/Screen/AppThemeSelect.svelte similarity index 100% rename from packages/builder/src/pages/builder/app/[application]/design/[screenId]/theme/_components/AppThemeSelect.svelte rename to packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_components/Screen/AppThemeSelect.svelte diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/theme/_components/ButtonRoundnessSelect.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_components/Screen/ButtonRoundnessSelect.svelte similarity index 100% rename from packages/builder/src/pages/builder/app/[application]/design/[screenId]/theme/_components/ButtonRoundnessSelect.svelte rename to packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_components/Screen/ButtonRoundnessSelect.svelte diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/screens/_components/ScreenSettingsPanel.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_components/Screen/GeneralPanel.svelte similarity index 72% rename from packages/builder/src/pages/builder/app/[application]/design/[screenId]/screens/_components/ScreenSettingsPanel.svelte rename to packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_components/Screen/GeneralPanel.svelte index 8982cd20de..a08ded8eee 100644 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/screens/_components/ScreenSettingsPanel.svelte +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_components/Screen/GeneralPanel.svelte @@ -1,12 +1,8 @@ - - - {#if $selectedScreen.layoutId} - - This screen uses a custom layout, which is deprecated - - {/if} - {#each screenSettings as setting (setting.key)} - setScreenSetting(setting, val)} - props={{ ...setting.props, error: errors[setting.key] }} - {bindings} - /> - {/each} - - - +{#if $selectedScreen.layoutId} + + This screen uses a custom layout, which is deprecated + +{/if} +{#each screenSettings as setting (setting.key)} + setScreenSetting(setting, val)} + props={{ ...setting.props, error: errors[setting.key] }} + {bindings} + /> +{/each} diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_components/Screen/ThemePanel.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_components/Screen/ThemePanel.svelte new file mode 100644 index 0000000000..13a008fae0 --- /dev/null +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_components/Screen/ThemePanel.svelte @@ -0,0 +1,78 @@ + + +
+ + These settings apply to all screens +
+ + + + + + + update("buttonBorderRadius", e.detail)} + /> + + update("primaryColor", val)} + props={{ + spectrumTheme: $store.theme, + }} + /> + update("primaryColorHover", val)} + props={{ + spectrumTheme: $store.theme, + }} + /> + + + diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_components/Screen/index.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_components/Screen/index.svelte new file mode 100644 index 0000000000..778fa303cc --- /dev/null +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_components/Screen/index.svelte @@ -0,0 +1,51 @@ + + + +
+
+ {#each tabs as tab} + { + activeTab = tab + }} + > + {capitalise(tab)} + + {/each} +
+
+ + {#if activeTab === "theme"} + + {:else} + + {/if} + +
+ + diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_layout.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_layout.svelte new file mode 100644 index 0000000000..19cb1d8dff --- /dev/null +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_layout.svelte @@ -0,0 +1,52 @@ + + +{#if routeComponentId === `${$store.selectedScreenId}-screen`} + +{:else if routeComponentId === `${$store.selectedScreenId}-navigation`} + +{:else} + +{/if} + diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/index.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/index.svelte new file mode 100644 index 0000000000..0ff63d1ead --- /dev/null +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/index.svelte @@ -0,0 +1 @@ + diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/new/_components/NewComponentPanel.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/new/_components/NewComponentPanel.svelte similarity index 98% rename from packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/new/_components/NewComponentPanel.svelte rename to packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/new/_components/NewComponentPanel.svelte index 7dca5b792b..248bbc8141 100644 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/new/_components/NewComponentPanel.svelte +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/new/_components/NewComponentPanel.svelte @@ -31,6 +31,10 @@ $: orderMap = createComponentOrderMap(componentList) const getAllowedComponents = (allComponents, screen, component) => { + // Default to using the root screen container if no component specified + if (!component) { + component = screen.props + } const path = findComponentPath(screen?.props, component?._id) if (!path?.length) { return [] diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/new/_components/componentStructure.json b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/new/_components/componentStructure.json similarity index 100% rename from packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/new/_components/componentStructure.json rename to packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/new/_components/componentStructure.json diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/new/index.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/new/index.svelte similarity index 100% rename from packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/new/index.svelte rename to packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/new/index.svelte diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/AppPanel.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/AppPanel.svelte index 785b221239..09f97302fd 100644 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/AppPanel.svelte +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/AppPanel.svelte @@ -1,32 +1,16 @@
- +
+ Screens +
+
+ +
+
+ +
+
+
+ {#if filteredScreens?.length} + {#each filteredScreens as screen (screen._id)} + store.actions.screens.select(screen._id)} + rightAlignIcon + showTooltip + selectedBy={$userSelectedResourceMap[screen._id]} + > + +
+ +
+
+ {/each} + {:else} + +
+ There aren't any screens matching that route +
+
+ {/if} +
+ +
screensHeight.set("210px")} + /> +
+ + diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_fallback.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_fallback.svelte deleted file mode 100644 index 00165e4ee9..0000000000 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_fallback.svelte +++ /dev/null @@ -1,5 +0,0 @@ - diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_layout.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_layout.svelte index 8bc0dcc3e5..0e630b4f39 100644 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_layout.svelte +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_layout.svelte @@ -1,14 +1,10 @@ -
-
- - $goto("./screens")} - /> - $goto("./components")} - /> - $goto("./theme")} - /> - $goto("./navigation")} - /> - {#if $store.layouts?.length} - $goto("./layouts")} - /> - {/if} - -
- -
- {#if $selectedScreen} - +{#if $selectedScreen} +
+
+ - {/if} + +
-
+{/if} diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/_components/navigation/ComponentListPanel.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/_components/navigation/ComponentListPanel.svelte deleted file mode 100644 index 9513753d76..0000000000 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/_components/navigation/ComponentListPanel.svelte +++ /dev/null @@ -1,90 +0,0 @@ - - - -
- -
- -
    -
  • - { - $store.selectedComponentId = $selectedScreen?.props._id - }} - id={`component-${$selectedScreen?.props._id}`} - selectedBy={$userSelectedResourceMap[$selectedScreen?.props._id]} - > - - - - - - {#if $dndStore.dragging && $dndStore.valid} - - {#if $dndStore.dropPosition !== DropPosition.INSIDE} - - {/if} - {/if} -
  • -
-
-
- - - diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/_layout.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/_layout.svelte deleted file mode 100644 index 860258c940..0000000000 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/_layout.svelte +++ /dev/null @@ -1,41 +0,0 @@ - - - - - diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/index.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/index.svelte deleted file mode 100644 index 9b5d05fe57..0000000000 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/index.svelte +++ /dev/null @@ -1,4 +0,0 @@ - diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/index.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/index.svelte deleted file mode 100644 index f8c4cc0868..0000000000 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/index.svelte +++ /dev/null @@ -1,18 +0,0 @@ - diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/index.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/index.svelte index f5e3806bd6..c4ed7d949c 100644 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/index.svelte +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/index.svelte @@ -1,5 +1,6 @@ diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/[layoutId]/_components/LayoutDropdownMenu.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/[layoutId]/_components/LayoutDropdownMenu.svelte deleted file mode 100644 index cba68f899d..0000000000 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/[layoutId]/_components/LayoutDropdownMenu.svelte +++ /dev/null @@ -1,41 +0,0 @@ - - - -
- -
- Delete -
- - - - diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/[layoutId]/_components/LayoutListPanel.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/[layoutId]/_components/LayoutListPanel.svelte deleted file mode 100644 index cc895317fd..0000000000 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/[layoutId]/_components/LayoutListPanel.svelte +++ /dev/null @@ -1,29 +0,0 @@ - - - -
- {#each $store.layouts as layout (layout._id)} - store.actions.layouts.select(layout._id)} - > - - - {/each} -
-
- - diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/[layoutId]/_components/LayoutSettingsPanel.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/[layoutId]/_components/LayoutSettingsPanel.svelte deleted file mode 100644 index bfc2f94f43..0000000000 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/[layoutId]/_components/LayoutSettingsPanel.svelte +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - Custom layouts are being deprecated. They will be removed in a future - release. - - - You can save the content of this layout by pressing the button below. - - - This will copy all components inside your layout, which you can then paste - into a screen. - - - - diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/[layoutId]/_layout.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/[layoutId]/_layout.svelte deleted file mode 100644 index c82fefab3e..0000000000 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/[layoutId]/_layout.svelte +++ /dev/null @@ -1,20 +0,0 @@ - - - diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/[layoutId]/index.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/[layoutId]/index.svelte deleted file mode 100644 index 4d39403bc3..0000000000 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/[layoutId]/index.svelte +++ /dev/null @@ -1,7 +0,0 @@ - - - - diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/_layout.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/_layout.svelte deleted file mode 100644 index 1333c6afe3..0000000000 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/_layout.svelte +++ /dev/null @@ -1,12 +0,0 @@ - - - diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/index.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/index.svelte deleted file mode 100644 index 09d45f8fde..0000000000 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/index.svelte +++ /dev/null @@ -1,12 +0,0 @@ - diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/navigation/_components/NavigationInfoPanel.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/navigation/_components/NavigationInfoPanel.svelte deleted file mode 100644 index 614e1eed80..0000000000 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/navigation/_components/NavigationInfoPanel.svelte +++ /dev/null @@ -1,33 +0,0 @@ - - - - - {#if $selectedScreen.layoutId} - - You can't preview your navigation settings using this screen as it uses - a custom layout, which is deprecated - - {/if} - - Your navigation is configured for all the screens within your app. - - - You can hide and show your navigation for each screen in the screen - settings. - - - diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/navigation/_components/NavigationSettingsPanel.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/navigation/_components/NavigationSettingsPanel.svelte deleted file mode 100644 index c6d43984b2..0000000000 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/navigation/_components/NavigationSettingsPanel.svelte +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - - - - update("navigation", "Top")} - /> - update("navigation", "Left")} - /> - - - {#if $store.navigation.navigation === "Top"} - update("sticky", e.detail)} - /> - update("logoUrl", e.detail)} - placeholder="Add logo URL" - updateOnChange={false} - /> - {/if} - - - update("hideTitle", !e.detail)} - /> - {#if !$store.navigation.hideTitle} - update("title", e.detail)} - placeholder="Add title" - updateOnChange={false} - /> - {/if} - - - - update("navBackground", e.detail)} - /> - - - - update("navTextColor", e.detail)} - /> - - - diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/navigation/index.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/navigation/index.svelte deleted file mode 100644 index fc2e03d8e8..0000000000 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/navigation/index.svelte +++ /dev/null @@ -1,7 +0,0 @@ - - - - diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/screens/_components/ScreenListPanel.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/screens/_components/ScreenListPanel.svelte deleted file mode 100644 index 6362af3073..0000000000 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/screens/_components/ScreenListPanel.svelte +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - (searchString = e.detail)} - /> - + {#if searching} +
+ +
+ {/if} +
+ {/if} +
{/if} + + diff --git a/packages/frontend-core/src/index.js b/packages/frontend-core/src/index.js index 01bf05c69e..b0afc0c25d 100644 --- a/packages/frontend-core/src/index.js +++ b/packages/frontend-core/src/index.js @@ -1,5 +1,6 @@ export { createAPIClient } from "./api" export { fetchData } from "./fetch/fetchData" +export { Utils } from "./utils" export * as Constants from "./constants" export * from "./stores" export * from "./utils" From 066d8ff8d3f7a6e431bc68688e8ad955166aa352 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Wed, 6 Sep 2023 15:38:30 +0000 Subject: [PATCH 087/116] Bump version to 2.9.39-alpha.10 --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index 07de18b1d3..dc6caf3326 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.9.39-alpha.9", + "version": "2.9.39-alpha.10", "npmClient": "yarn", "packages": [ "packages/*" From c361588bd4dd7db75fd599db4faa58bbf12b9edd Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Wed, 6 Sep 2023 18:17:44 +0100 Subject: [PATCH 088/116] Updating the yarn dev process to not include a removal of the dist directory as part of the streamed watchers - this seems to create a problem for shared core and moving this up a level to a parallel run before the watchers massively improves stability. --- package.json | 2 +- packages/server/package.json | 2 +- packages/shared-core/package.json | 2 +- packages/types/package.json | 2 +- packages/worker/package.json | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index b0c428fe70..b263fb6585 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ "kill-builder": "kill-port 3000", "kill-server": "kill-port 4001 4002", "kill-all": "yarn run kill-builder && yarn run kill-server", - "dev": "yarn run kill-all && lerna run --stream dev:builder", + "dev": "yarn run kill-all && lerna run --parallel prebuild && lerna run --stream dev:builder", "dev:noserver": "yarn run kill-builder && lerna run --stream dev:stack:up && lerna run --stream dev:builder --ignore @budibase/backend-core --ignore @budibase/server --ignore @budibase/worker", "dev:server": "yarn run kill-server && lerna run --stream dev:builder --scope @budibase/worker --scope @budibase/server", "dev:built": "yarn run kill-all && cd packages/server && yarn dev:stack:up && cd ../../ && lerna run --stream dev:built", diff --git a/packages/server/package.json b/packages/server/package.json index ecf31175dc..39f52342a4 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -26,7 +26,7 @@ "dev:stack:up": "node scripts/dev/manage.js up", "dev:stack:down": "node scripts/dev/manage.js down", "dev:stack:nuke": "node scripts/dev/manage.js nuke", - "dev:builder": "yarn run dev:stack:up && rimraf dist/ && nodemon", + "dev:builder": "yarn run dev:stack:up && nodemon", "dev:built": "yarn run dev:stack:up && yarn run run:docker", "specs": "ts-node specs/generate.ts && openapi-typescript specs/openapi.yaml --output src/definitions/openapi.ts", "initialise": "node scripts/initialise.js", diff --git a/packages/shared-core/package.json b/packages/shared-core/package.json index 8edea4870a..160a42f086 100644 --- a/packages/shared-core/package.json +++ b/packages/shared-core/package.json @@ -10,7 +10,7 @@ "prebuild": "rimraf dist/", "build": "node ../../scripts/build.js && tsc -p tsconfig.build.json --emitDeclarationOnly --paths null", "build:dev": "yarn prebuild && tsc --build --watch --preserveWatchOutput", - "dev:builder": "yarn prebuild && tsc -p tsconfig.json --watch --preserveWatchOutput", + "dev:builder": "tsc -p tsconfig.json --watch --preserveWatchOutput", "check:types": "tsc -p tsconfig.json --noEmit --paths null" }, "dependencies": { diff --git a/packages/types/package.json b/packages/types/package.json index bb0163ae13..919cc736fc 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -10,7 +10,7 @@ "prebuild": "rimraf dist/", "build": "node ../../scripts/build.js && tsc -p tsconfig.build.json --emitDeclarationOnly", "build:dev": "yarn prebuild && tsc --build --watch --preserveWatchOutput", - "dev:builder": "yarn prebuild && tsc -p tsconfig.json --watch --preserveWatchOutput", + "dev:builder": "tsc -p tsconfig.json --watch --preserveWatchOutput", "check:types": "tsc -p tsconfig.json --noEmit --paths null" }, "jest": {}, diff --git a/packages/worker/package.json b/packages/worker/package.json index 3b66df264e..15ab1c1ff9 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -22,7 +22,7 @@ "predocker": "yarn build && cp ../../yarn.lock ./dist/", "build:docker": "yarn predocker && docker build . -t worker-service --label version=$BUDIBASE_RELEASE_VERSION", "dev:stack:init": "node ./scripts/dev/manage.js init", - "dev:builder": "npm run dev:stack:init && rimraf dist/ && nodemon", + "dev:builder": "npm run dev:stack:init && nodemon", "dev:built": "yarn run dev:stack:init && yarn run run:docker", "test": "bash scripts/test.sh", "test:watch": "jest --watch", From ceabccaaea1d0a8e3f598ec2136f8026236789c5 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Wed, 6 Sep 2023 17:30:39 +0000 Subject: [PATCH 089/116] Bump version to 2.9.39-alpha.11 --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index dc6caf3326..7f0341ceb5 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.9.39-alpha.10", + "version": "2.9.39-alpha.11", "npmClient": "yarn", "packages": [ "packages/*" From aca2d7be5b990aed7d5004b095a369e6104fa6a2 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 7 Sep 2023 09:54:17 +0200 Subject: [PATCH 090/116] Remove src and test from the backend-core npm --- packages/backend-core/.npmignore | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/backend-core/.npmignore b/packages/backend-core/.npmignore index 30bba85ce8..fb547825eb 100644 --- a/packages/backend-core/.npmignore +++ b/packages/backend-core/.npmignore @@ -1,6 +1,4 @@ * !dist/**/* dist/tsconfig.build.tsbuildinfo -!package.json -!src/** -!tests/** \ No newline at end of file +!package.json \ No newline at end of file From 2a3e83e53ddb495b34dde95be35a18d943daeeca Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 7 Sep 2023 09:46:30 +0100 Subject: [PATCH 091/116] Fix linting issues --- packages/client/src/components/ClientApp.svelte | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/client/src/components/ClientApp.svelte b/packages/client/src/components/ClientApp.svelte index 8b7646bc61..4efa8af4e6 100644 --- a/packages/client/src/components/ClientApp.svelte +++ b/packages/client/src/components/ClientApp.svelte @@ -16,7 +16,6 @@ themeStore, appStore, devToolsStore, - environmentStore, devToolsEnabled, } from "stores" import NotificationDisplay from "components/overlay/NotificationDisplay.svelte" From b90006835246f13f84c2d43bc85115e64d0dc8bb Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Thu, 7 Sep 2023 08:54:31 +0000 Subject: [PATCH 092/116] Bump version to 2.9.39-alpha.12 --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index 7f0341ceb5..a4f2947c62 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.9.39-alpha.11", + "version": "2.9.39-alpha.12", "npmClient": "yarn", "packages": [ "packages/*" From 5d0cf244866f4637336684e703d506b3f89eda72 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Thu, 7 Sep 2023 09:02:16 +0000 Subject: [PATCH 093/116] Bump version to 2.9.39-alpha.13 --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index a4f2947c62..541a06fb2f 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.9.39-alpha.12", + "version": "2.9.39-alpha.13", "npmClient": "yarn", "packages": [ "packages/*" From 346060092a25ff9c9f3e72f1eae59c428a16f1c9 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Thu, 7 Sep 2023 10:17:33 +0100 Subject: [PATCH 094/116] Updating pro to master reference. --- packages/pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/pro b/packages/pro index 140386c7ad..961d683794 160000 --- a/packages/pro +++ b/packages/pro @@ -1 +1 @@ -Subproject commit 140386c7ad7e3d50bd361fc702e49b288c1747c2 +Subproject commit 961d683794442f615468d44b684e5a94633109eb From 4c3cce82776744df7295880d5470f9b7da40d788 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Thu, 7 Sep 2023 09:19:36 +0000 Subject: [PATCH 095/116] Bump version to 2.9.39-alpha.14 --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index 541a06fb2f..a662b691ed 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.9.39-alpha.13", + "version": "2.9.39-alpha.14", "npmClient": "yarn", "packages": [ "packages/*" From f691987e65d22b5e6ec0048ab497a7fadef34952 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 7 Sep 2023 11:18:29 +0200 Subject: [PATCH 096/116] Update node types --- packages/backend-core/package.json | 4 ++-- packages/cli/package.json | 2 +- packages/pro | 2 +- packages/server/package.json | 4 ++-- packages/types/package.json | 2 +- packages/worker/package.json | 4 ++-- qa-core/package.json | 4 ++-- yarn.lock | 18 +++++++++--------- 8 files changed, 20 insertions(+), 20 deletions(-) diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index cf8d6fbe17..739469b49a 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -68,8 +68,8 @@ "@types/jest": "29.5.3", "@types/koa": "2.13.4", "@types/lodash": "4.14.180", - "@types/node": "14.18.20", - "@types/node-fetch": "2.6.1", + "@types/node": "18.17.0", + "@types/node-fetch": "2.6.4", "@types/pouchdb": "6.4.0", "@types/redlock": "4.0.3", "@types/semver": "7.3.7", diff --git a/packages/cli/package.json b/packages/cli/package.json index a0c885657c..6d4d78b7d7 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -56,7 +56,7 @@ "@swc/core": "1.3.71", "@swc/jest": "0.2.27", "@types/jest": "29.5.3", - "@types/node-fetch": "2.6.1", + "@types/node-fetch": "2.6.4", "@types/pouchdb": "^6.4.0", "copyfiles": "^2.4.1", "eslint": "^7.20.0", diff --git a/packages/pro b/packages/pro index 961d683794..7b58ca3f3c 160000 --- a/packages/pro +++ b/packages/pro @@ -1 +1 @@ -Subproject commit 961d683794442f615468d44b684e5a94633109eb +Subproject commit 7b58ca3f3c1e5d700b1af5d6c65b2fdf478f68ba diff --git a/packages/server/package.json b/packages/server/package.json index ecf31175dc..f3016fc38e 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -144,8 +144,8 @@ "@types/koa__router": "8.0.8", "@types/lodash": "4.14.180", "@types/mssql": "8.1.2", - "@types/node": "14.18.20", - "@types/node-fetch": "2.6.1", + "@types/node": "18.17.0", + "@types/node-fetch": "2.6.4", "@types/oracledb": "5.2.2", "@types/pg": "8.6.6", "@types/pouchdb": "6.4.0", diff --git a/packages/types/package.json b/packages/types/package.json index bb0163ae13..ccc8e10440 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -18,7 +18,7 @@ "@budibase/nano": "10.1.2", "@types/json5": "2.2.0", "@types/koa": "2.13.4", - "@types/node": "14.18.20", + "@types/node": "18.17.0", "@types/pouchdb": "6.4.0", "@types/redlock": "4.0.3", "concurrently": "^7.6.0", diff --git a/packages/worker/package.json b/packages/worker/package.json index 3b66df264e..472f2fa29c 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -82,8 +82,8 @@ "@types/koa": "2.13.4", "@types/koa__router": "8.0.8", "@types/lodash": "^4.14.191", - "@types/node": "14.18.20", - "@types/node-fetch": "2.6.1", + "@types/node": "18.17.0", + "@types/node-fetch": "2.6.4", "@types/pouchdb": "6.4.0", "@types/server-destroy": "1.0.1", "@types/supertest": "2.0.12", diff --git a/qa-core/package.json b/qa-core/package.json index cfdf7a1ee5..4954991f67 100644 --- a/qa-core/package.json +++ b/qa-core/package.json @@ -26,7 +26,7 @@ "@budibase/types": "^2.3.17", "@trendyol/jest-testcontainers": "2.1.1", "@types/jest": "29.5.3", - "@types/node-fetch": "2.6.2", + "@types/node-fetch": "2.6.4", "chance": "1.1.8", "dotenv": "16.0.1", "jest": "29.6.2", @@ -43,6 +43,6 @@ "dependencies": { "@budibase/backend-core": "^2.3.17", "form-data": "^4.0.0", - "node-fetch": "2" + "node-fetch": "2.6.7" } } diff --git a/yarn.lock b/yarn.lock index 4f5e0db2e7..4ff6647627 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6301,10 +6301,10 @@ "@types/tedious" "*" tarn "^3.0.1" -"@types/node-fetch@2.6.1": - version "2.6.1" - resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.6.1.tgz#8f127c50481db65886800ef496f20bbf15518975" - integrity sha512-oMqjURCaxoSIsHSr1E47QHzbmzNR5rK8McHuNb11BOM9cHcIK3Avy0s/b2JlXHoQGTYS3NsvWzV1M0iK7l0wbA== +"@types/node-fetch@2.6.4": + version "2.6.4" + resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.6.4.tgz#1bc3a26de814f6bf466b25aeb1473fa1afe6a660" + integrity sha512-1ZX9fcN4Rvkvgv4E6PAY5WXUFWFcRWxZa3EW83UjycOB9ljJCedb2CupIP4RZMEwF/M3eTcCihbBRgwtGbg5Rg== dependencies: "@types/node" "*" form-data "^3.0.0" @@ -6322,16 +6322,16 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-18.11.18.tgz#8dfb97f0da23c2293e554c5a50d61ef134d7697f" integrity sha512-DHQpWGjyQKSHj3ebjFI/wRKcqQcdR+MoFBygntYOZytCqNfkd2ZC4ARDJ2DQqhjH5p85Nnd3jhUJIXrszFX/JA== -"@types/node@14.18.20": - version "14.18.20" - resolved "https://registry.yarnpkg.com/@types/node/-/node-14.18.20.tgz#268f028b36eaf51181c3300252f605488c4f0650" - integrity sha512-Q8KKwm9YqEmUBRsqJ2GWJDtXltBDxTdC4m5vTdXBolu2PeQh8LX+f6BTwU+OuXPu37fLxoN6gidqBmnky36FXA== - "@types/node@16.9.1": version "16.9.1" resolved "https://registry.yarnpkg.com/@types/node/-/node-16.9.1.tgz#0611b37db4246c937feef529ddcc018cf8e35708" integrity sha512-QpLcX9ZSsq3YYUUnD3nFDY8H7wctAhQj/TFKL8Ya8v5fMm3CFXxo8zStsLAl780ltoYoo1WvKUVGBQK+1ifr7g== +"@types/node@18.17.0": + version "18.17.0" + resolved "https://registry.yarnpkg.com/@types/node/-/node-18.17.0.tgz#35d44267a33dd46b49ee0f73d31b05fd7407e290" + integrity sha512-GXZxEtOxYGFchyUzxvKI14iff9KZ2DI+A6a37o6EQevtg6uO9t+aUZKcaC1Te5Ng1OnLM7K9NVVj+FbecD9cJg== + "@types/node@>=10.0.0", "@types/node@>=12.12.47", "@types/node@>=13.13.4", "@types/node@>=13.7.0": version "18.14.5" resolved "https://registry.yarnpkg.com/@types/node/-/node-18.14.5.tgz#4a13a6445862159303fc38586598a9396fc408b3" From ad1d25badf8123db281bee8ed93580261451c103 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Thu, 7 Sep 2023 10:32:00 +0100 Subject: [PATCH 097/116] Updating pro to develop. --- packages/pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/pro b/packages/pro index 961d683794..140386c7ad 160000 --- a/packages/pro +++ b/packages/pro @@ -1 +1 @@ -Subproject commit 961d683794442f615468d44b684e5a94633109eb +Subproject commit 140386c7ad7e3d50bd361fc702e49b288c1747c2 From a6c1f00ef02f5f0c8926575f9525d655e7052b4c Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Thu, 7 Sep 2023 09:34:18 +0000 Subject: [PATCH 098/116] Bump version to 2.9.39-alpha.15 --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index a662b691ed..7b0ab812e8 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.9.39-alpha.14", + "version": "2.9.39-alpha.15", "npmClient": "yarn", "packages": [ "packages/*" From 827f50261149ec4c894bcc58a9b3545170f3a6be Mon Sep 17 00:00:00 2001 From: Mitch-Budibase Date: Thu, 7 Sep 2023 11:06:56 +0100 Subject: [PATCH 099/116] Update pro reference --- packages/pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/pro b/packages/pro index cf3bef2aad..140386c7ad 160000 --- a/packages/pro +++ b/packages/pro @@ -1 +1 @@ -Subproject commit cf3bef2aad9c739111b306fd0712397adc363f81 +Subproject commit 140386c7ad7e3d50bd361fc702e49b288c1747c2 From 52f33bd14d7f7cbc1d6efaffe4d4921c04470c7f Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Thu, 7 Sep 2023 14:04:40 +0100 Subject: [PATCH 100/116] Merging master back to develop. --- .github/workflows/budibase_ci.yml | 3 ++- lerna.json | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/budibase_ci.yml b/.github/workflows/budibase_ci.yml index 3e4b2221d2..d670e222d3 100644 --- a/.github/workflows/budibase_ci.yml +++ b/.github/workflows/budibase_ci.yml @@ -214,6 +214,7 @@ jobs: with: submodules: true token: ${{ secrets.PERSONAL_ACCESS_TOKEN || github.token }} + fetch-depth: 0 - name: Check pro commit id: get_pro_commits @@ -251,4 +252,4 @@ jobs: process.exit(1); } else { console.log('All good, the submodule had been merged and setup correctly!') - } + } \ No newline at end of file diff --git a/lerna.json b/lerna.json index 7b0ab812e8..1b2130677e 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.9.39-alpha.15", + "version": "2.9.39", "npmClient": "yarn", "packages": [ "packages/*" @@ -19,4 +19,4 @@ "loadEnvFiles": false } } -} \ No newline at end of file +} From 8781ca0be7e47d6806454ea89ab7451aab5cba11 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 7 Sep 2023 15:27:13 +0200 Subject: [PATCH 101/116] Remove cypress dependencies --- .eslintignore | 3 -- .github/workflows/README.md | 53 ++++++++++++++++++++++++----------- .gitignore | 2 -- .prettierignore | 2 -- docs/CONTRIBUTING.md | 8 ++---- package.json | 1 - packages/builder/.gitignore | 2 -- packages/builder/package.json | 14 --------- 8 files changed, 40 insertions(+), 45 deletions(-) diff --git a/.eslintignore b/.eslintignore index 0d81de0ef9..021fe8e367 100644 --- a/.eslintignore +++ b/.eslintignore @@ -7,7 +7,4 @@ packages/worker/coverage packages/backend-core/coverage packages/server/client packages/builder/.routify -packages/builder/cypress/support/queryLevelTransformerFunction.js -packages/builder/cypress/support/queryLevelTransformerFunctionWithData.js -packages/builder/cypress/reports packages/sdk/sdk diff --git a/.github/workflows/README.md b/.github/workflows/README.md index 7e4172e602..9b75a2e73a 100644 --- a/.github/workflows/README.md +++ b/.github/workflows/README.md @@ -1,4 +1,3 @@ - # Budibase CI Pipelines Welcome to the budibase CI pipelines directory. This document details what each of the CI pipelines are for, and come common combinations. @@ -6,27 +5,34 @@ Welcome to the budibase CI pipelines directory. This document details what each ## All CI Pipelines ### Note -- When running workflow dispatch jobs, ensure you always run them off the `master` branch. It defaults to `develop`, so double check before running any jobs. The exception to this case is the `deploy-release` job which requires the develop branch. + +- When running workflow dispatch jobs, ensure you always run them off the `master` branch. It defaults to `develop`, so double check before running any jobs. The exception to this case is the `deploy-release` job which requires the develop branch. ### Standard CI Build Job (budibase_ci.yml) + Triggers: + - PR or push to develop - PR or push to master -The standard CI Build job is what runs when you raise a PR to develop or master. +The standard CI Build job is what runs when you raise a PR to develop or master. + - Installs all dependencies, -- builds the project +- builds the project - run the unit tests - Generate test coverage metrics with codecov -- Run the cypress tests +- Run the integration tests ### Release Develop Job (release-develop.yml) + Triggers: + - Push to develop -The job responsible for building, tagging and pushing docker images out to the test and release environments. +The job responsible for building, tagging and pushing docker images out to the test and release environments. + - Installs all dependencies -- builds the project +- builds the project - run the unit tests - publish the budibase JS packages under a prerelease tag to NPM - build, tag and push docker images under the `develop` tag to docker hub @@ -34,23 +40,29 @@ The job responsible for building, tagging and pushing docker images out to the t These images will then be pulled by the test and release environments, updating the latest automatically. Discord notifications are sent to the #infra channel when this occurs. ### Release Job (release.yml) + Triggers: + - Push to master This job is responsible for building and pushing the latest code to NPM and docker hub, so that it can be deployed. + - Installs all dependencies -- builds the project +- builds the project - run the unit tests - publish the budibase JS packages under a release tag to NPM (always incremented by patch versions) - build, tag and push docker images under the `v.x.x.x` (the tag of the NPM release) tag to docker hub ### Release Selfhost Job (release-selfhost.yml) + Triggers: + - Manual Workflow Dispatch Trigger -This job is responsible for delivering the latest version of budibase to those that are self-hosting. +This job is responsible for delivering the latest version of budibase to those that are self-hosting. This job relies on the release job to have run first, so the latest image is pushed to dockerhub. This job then will pull the latest version from `lerna.json` and try to find an image in dockerhub corresponding to that version. For example, if the version in `lerna.json` is `1.0.0`: + - Pull the images for all budibase services tagged `v1.0.0` from dockerhub - Tag these images as `latest` - Push them back to dockerhub. This now means anyone who pulls `latest` (self hosters using docker-compose) will get the latest version. @@ -58,53 +70,61 @@ This job relies on the release job to have run first, so the latest image is pus - Perform a github release with the latest version. You can see previous releases here (https://github.com/Budibase/budibase/releases) ### Deploy Release (deploy-release.yml) + Triggers: + - Manual Workflow Dispatch Trigger This job is responsible for deploying to our release, cloud kubernetes environment. You must run the release job first, to ensure that the latest images have been built and pushed to docker hub. After kicking off this job, the following will occur: -- Checks out the release branch +- Checks out the release branch - Pulls the latest `values.yaml` from budibase infra, a private repo containing budibases infrastructure configuration - Gets the latest budibase version from `lerna.json`, if it hasn't been specified in the workflow when you kicked it off -- Configures AWS Credentials +- Configures AWS Credentials - Deploys the helm chart in the budibase repo to our preproduction EKS cluster, injecting the `values.yaml` we pulled from budibase-infra - Fires off a discord webhook in the #infra channel to show that the deployment completely successfully. ### Deploy Preprod (deploy-preprod.yml) + Triggers: + - Manual Workflow Dispatch Trigger This job is responsible for deploying to our preprod, cloud kubernetes environment. You must run the release job first, to ensure that the latest images have been built and pushed to docker hub. After kicking off this job, the following will occur: -- Checks out the master branch +- Checks out the master branch - Pulls the latest `values.yaml` from budibase infra, a private repo containing budibases infrastructure configuration - Gets the latest budibase version from `lerna.json`, if it hasn't been specified in the workflow when you kicked it off -- Configures AWS Credentials +- Configures AWS Credentials - Deploys the helm chart in the budibase repo to our preprod EKS cluster, injecting the `values.yaml` we pulled from budibase-infra - Fires off a discord webhook in the #infra channel to show that the deployment completely successfully. ### Deploy Production (deploy-cloud.yml) + Triggers: + - Manual Workflow Dispatch Trigger This job is responsible for deploying to our production, cloud kubernetes environment. You must run the release job first, to ensure that the latest images have been built and pushed to docker hub. You can also manually enter a version number for this job, so you can perform rollbacks or upgrade to a specific version. After kicking off this job, the following will occur: -- Checks out the master branch +- Checks out the master branch - Pulls the latest `values.yaml` from budibase infra, a private repo containing budibases infrastructure configuration - Gets the latest budibase version from `lerna.json`, if it hasn't been specified in the workflow when you kicked it off -- Configures AWS Credentials +- Configures AWS Credentials - Deploys the helm chart in the budibase repo to our production EKS cluster, injecting the `values.yaml` we pulled from budibase-infra - Fires off a discord webhook in the #infra channel to show that the deployment completely successfully. ## Common Workflows ### Deploy Changes to Production (Release) + - Merge `develop` into `master` - Wait for budibase CI job and release job to run - Run cloud deploy job - Run release selfhost job ### Deploy Changes to Production (Hotfix) + - Branch off `master` - Perform your hotfix - Merge back into `master` @@ -113,6 +133,7 @@ This job is responsible for deploying to our production, cloud kubernetes enviro - Run release selfhost job ### Rollback A Bad Cloud Deployment + - Kick off cloud deploy job - Ensure you are running off master -- Enter the version number of the last known good version of budibase. For example `1.0.0` \ No newline at end of file +- Enter the version number of the last known good version of budibase. For example `1.0.0` diff --git a/.gitignore b/.gitignore index 22a7313e66..02e0ca300d 100644 --- a/.gitignore +++ b/.gitignore @@ -97,8 +97,6 @@ typings/ bin/ hosting/.generated* -packages/builder/cypress.env.json -packages/builder/cypress/reports stats.html diff --git a/.prettierignore b/.prettierignore index 7eb567d517..a73fed4890 100644 --- a/.prettierignore +++ b/.prettierignore @@ -9,6 +9,4 @@ packages/backend-core/coverage packages/server/client packages/server/src/definitions/openapi.ts packages/builder/.routify -packages/builder/cypress/support/queryLevelTransformerFunction.js -packages/builder/cypress/support/queryLevelTransformerFunctionWithData.js packages/sdk/sdk \ No newline at end of file diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 70f198a84c..3a32075a33 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -264,16 +264,14 @@ Sometimes, things go wrong. This can be due to incompatible updates on the budib ### Running tests -#### End-to-end Tests +#### Unit Tests -Budibase uses Cypress to run a number of E2E tests. To run the tests execute the following command in the root folder: +Budibase uses Jest to run a number of tests. To run the tests execute the following command in the root folder: ``` -yarn test:e2e +yarn test ``` -Or if you are in the builder you can run `yarn cy:test`. - ### Other Useful Information - The contributors are listed in [AUTHORS.md](https://github.com/Budibase/budibase/blob/master/.github/AUTHORS.md) (add yourself). diff --git a/package.json b/package.json index b0c428fe70..8def60ade1 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,6 @@ "esbuild": "^0.18.17", "esbuild-node-externals": "^1.8.0", "eslint": "^8.44.0", - "eslint-plugin-cypress": "^2.11.3", "husky": "^8.0.3", "js-yaml": "^4.1.0", "kill-port": "^1.6.1", diff --git a/packages/builder/.gitignore b/packages/builder/.gitignore index 70c94f7a78..e5c961d509 100644 --- a/packages/builder/.gitignore +++ b/packages/builder/.gitignore @@ -5,6 +5,4 @@ package-lock.json release/ dist/ routify -cypress/videos -cypress/screenshots .routify/ \ No newline at end of file diff --git a/packages/builder/package.json b/packages/builder/package.json index db8ef86086..a6bf81201d 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -43,21 +43,10 @@ "/node_modules/(?!svelte).+\\.js$", ".*string-templates.*" ], - "modulePathIgnorePatterns": [ - "/cypress/" - ], "setupFilesAfterEnv": [ "@testing-library/jest-dom/extend-expect" ] }, - "eslintConfig": { - "extends": [ - "plugin:cypress/recommended" - ], - "rules": { - "cypress/no-unnecessary-waiting": "off" - } - }, "dependencies": { "@budibase/bbui": "0.0.0", "@budibase/frontend-core": "0.0.0", @@ -104,9 +93,6 @@ "@testing-library/jest-dom": "5.17.0", "@testing-library/svelte": "^3.2.2", "babel-jest": "29.6.2", - "cypress": "^9.3.1", - "cypress-multi-reporters": "^1.6.0", - "cypress-terminal-report": "^1.4.1", "identity-obj-proxy": "^3.0.0", "jest": "29.6.2", "jsdom": "^21.1.1", From 0f9552560bd61994a6e5b6b5b3c22bf1f51278ab Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 7 Sep 2023 15:34:58 +0200 Subject: [PATCH 102/116] yarn.lock --- yarn.lock | 333 ++++-------------------------------------------------- 1 file changed, 20 insertions(+), 313 deletions(-) diff --git a/yarn.lock b/yarn.lock index 4f5e0db2e7..a0d71c7763 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2832,38 +2832,6 @@ string-width "^4.2.0" y18n "^5.0.5" -"@cypress/request@^2.88.10": - version "2.88.11" - resolved "https://registry.yarnpkg.com/@cypress/request/-/request-2.88.11.tgz#5a4c7399bc2d7e7ed56e92ce5acb620c8b187047" - integrity sha512-M83/wfQ1EkspjkE2lNWNV5ui2Cv7UCv1swW1DqljahbzLVWltcsexQh8jYtuS/vzFXP+HySntGM83ZXA9fn17w== - dependencies: - aws-sign2 "~0.7.0" - aws4 "^1.8.0" - caseless "~0.12.0" - combined-stream "~1.0.6" - extend "~3.0.2" - forever-agent "~0.6.1" - form-data "~2.3.2" - http-signature "~1.3.6" - is-typedarray "~1.0.0" - isstream "~0.1.2" - json-stringify-safe "~5.0.1" - mime-types "~2.1.19" - performance-now "^2.1.0" - qs "~6.10.3" - safe-buffer "^5.1.2" - tough-cookie "~2.5.0" - tunnel-agent "^0.6.0" - uuid "^8.3.2" - -"@cypress/xvfb@^1.2.4": - version "1.2.4" - resolved "https://registry.yarnpkg.com/@cypress/xvfb/-/xvfb-1.2.4.tgz#2daf42e8275b39f4aa53c14214e557bd14e7748a" - integrity sha512-skbBzPggOVYCbnGgV+0dmBdW/s77ZkAOXIC1knS8NagwDjBrNC1LuXtQJeiN6l+m7lzmHtaoUw/ctJKdqkG57Q== - dependencies: - debug "^3.1.0" - lodash.once "^4.1.1" - "@dabh/diagnostics@^2.0.2": version "2.0.3" resolved "https://registry.yarnpkg.com/@dabh/diagnostics/-/diagnostics-2.0.3.tgz#7f7e97ee9a725dffc7808d93668cc984e1dc477a" @@ -6342,7 +6310,7 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-12.20.55.tgz#c329cbd434c42164f846b909bd6f85b5537f6240" integrity sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ== -"@types/node@>=8.0.0 <15", "@types/node@^14.14.31": +"@types/node@>=8.0.0 <15": version "14.18.37" resolved "https://registry.yarnpkg.com/@types/node/-/node-14.18.37.tgz#0bfcd173e8e1e328337473a8317e37b3b14fd30d" integrity sha512-7GgtHCs/QZrBrDzgIJnQtuSvhFSwhyYSI2uafSwZoNt1iOGhEN5fwNrQMjtONyHm9+/LoA4453jH0CMYcr06Pg== @@ -6603,16 +6571,6 @@ dependencies: "@types/node" "*" -"@types/sinonjs__fake-timers@8.1.1": - version "8.1.1" - resolved "https://registry.yarnpkg.com/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-8.1.1.tgz#b49c2c70150141a15e0fa7e79cf1f92a72934ce3" - integrity sha512-0kSuKjAS0TrGLJ0M/+8MaFkGsQhZpB6pxOmvS3K8FYI72K//YmdfoW9X2qPsAKh1mkwxGD5zib9s1FIFed6E8g== - -"@types/sizzle@^2.3.2": - version "2.3.3" - resolved "https://registry.yarnpkg.com/@types/sizzle/-/sizzle-2.3.3.tgz#ff5e2f1902969d305225a047c8a0fd5c915cebef" - integrity sha512-JYM8x9EGF163bEyhdJBpR2QX1R5naCJHC8ucJylJ3w9/CVBaskdQ8WqBf8MmQrd1kRvp/a4TS8HJ+bxzR7ZJYQ== - "@types/stack-utils@^2.0.0": version "2.0.1" resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.1.tgz#20f18294f797f2209b5f65c8e3b5c8e8261d127c" @@ -6738,13 +6696,6 @@ dependencies: "@types/yargs-parser" "*" -"@types/yauzl@^2.9.1": - version "2.10.0" - resolved "https://registry.yarnpkg.com/@types/yauzl/-/yauzl-2.10.0.tgz#b3248295276cf8c6f153ebe6a9aba0c988cb2599" - integrity sha512-Cn6WYCm0tXv8p6k+A8PvbDG763EDpBoTzHdA+Q/MF6H3sapGjCm9NzoaJncJS9tUKSuCoDs9XHxYYsQDgxR6kw== - dependencies: - "@types/node" "*" - "@typescript-eslint/parser@5.45.0": version "5.45.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.45.0.tgz#b18a5f6b3cf1c2b3e399e9d2df4be40d6b0ddd0e" @@ -7301,7 +7252,7 @@ ansi-colors@^4.1.1: resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA== -ansi-escapes@^4.2.1, ansi-escapes@^4.3.0: +ansi-escapes@^4.2.1: version "4.3.2" resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.2.tgz#6b2291d1db7d98b6521d5f1efa42d0f3a9feb65e" integrity sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ== @@ -7436,11 +7387,6 @@ arangojs@7.2.0: x3-linkedlist "1.2.0" xhr "^2.4.1" -arch@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/arch/-/arch-2.2.0.tgz#1bc47818f305764f23ab3306b0bfc086c5a29d11" - integrity sha512-Of/R0wqp83cgHozfIYLbBMnej79U/SVGOOyuB3VVFv1NRM/PSFMK12x9KVtiYzJqmnU5WR2qp0Z5rHb7sWGnFQ== - archive-type@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/archive-type/-/archive-type-4.0.0.tgz#f92e72233056dfc6969472749c267bdb046b1d70" @@ -7697,7 +7643,7 @@ async-value@^1.2.2: resolved "https://registry.yarnpkg.com/async-value/-/async-value-1.2.2.tgz#84517a1e7cb6b1a5b5e181fa31be10437b7fb125" integrity sha512-8rwtYe32OAS1W9CTwvknoyts+mc3ta8N7Pi0h7AjkMaKvsFbr39K+gEfZ7Z81aPXQ1sK5M23lgLy1QfZpcpadQ== -async@^3.2.0, async@^3.2.1, async@^3.2.3: +async@^3.2.1, async@^3.2.3: version "3.2.4" resolved "https://registry.yarnpkg.com/async/-/async-3.2.4.tgz#2d22e00f8cddeb5fde5dd33522b56d1cf569a81c" integrity sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ== @@ -8137,11 +8083,6 @@ bl@~0.8.1: dependencies: readable-stream "~1.0.26" -blob-util@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/blob-util/-/blob-util-2.0.2.tgz#3b4e3c281111bb7f11128518006cdc60b403a1eb" - integrity sha512-T7JQa+zsXXEa6/8ZhHcQEW1UFfVM49Ts65uBkFL6fz2QmrElqmbajIDJvuA0tEhRe5eIjpV9ZF+0RfZR9voJFQ== - bluebird@3.7.2, bluebird@^3.5.1, bluebird@^3.7.2: version "3.7.2" resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f" @@ -8623,11 +8564,6 @@ cacheable-request@^7.0.2: normalize-url "^6.0.1" responselike "^2.0.0" -cachedir@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/cachedir/-/cachedir-2.3.0.tgz#0c75892a052198f0b21c7c1804d8331edfcae0e8" - integrity sha512-A+Fezp4zxnit6FanDmv9EqXNAi3vt9DWp51/71UEhXukb7QUuvtv9344h91dyAxuTLoSYJFU299qzR3tzwPAhw== - call-bind@^1.0.0, call-bind@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c" @@ -8761,7 +8697,7 @@ check-error@^1.0.2: resolved "https://registry.yarnpkg.com/check-error/-/check-error-1.0.2.tgz#574d312edd88bb5dd8912e9286dd6c0aed4aac82" integrity sha512-BrgHpW9NURQgzoNyjfq0Wu6VFO6D7IZEmJNdtgNqpzGG8RuNFHt2jQxWlAs4HMe119chBnv+34syEZtc6IhLtA== -check-more-types@2.24.0, check-more-types@^2.24.0: +check-more-types@2.24.0: version "2.24.0" resolved "https://registry.yarnpkg.com/check-more-types/-/check-more-types-2.24.0.tgz#1420ffb10fd444dcfc79b43891bbfffd32a84600" integrity sha512-Pj779qHxV2tuapviy1bSZNEL1maXr13bPYpsvSDB68HlYcYuhlDrmGd63i0JHMCLKzc7rUSNIrpdJlhVlNwrxA== @@ -8868,23 +8804,6 @@ cli-spinners@^2.5.0: resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-2.7.0.tgz#f815fd30b5f9eaac02db604c7a231ed7cb2f797a" integrity sha512-qu3pN8Y3qHNgE2AFweciB1IfMnmZ/fsNTEE+NOFjmGB2F/7rLhnhzppvpCnN4FovtP26k8lHyy9ptEbNwWFLzw== -cli-table3@~0.6.1: - version "0.6.3" - resolved "https://registry.yarnpkg.com/cli-table3/-/cli-table3-0.6.3.tgz#61ab765aac156b52f222954ffc607a6f01dbeeb2" - integrity sha512-w5Jac5SykAeZJKntOxJCrm63Eg5/4dhMWIcuTbo9rpE+brgaSZo0RuNJZeOyMgsUdhDeojvgyQLmjI+K50ZGyg== - dependencies: - string-width "^4.2.0" - optionalDependencies: - "@colors/colors" "1.5.0" - -cli-truncate@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/cli-truncate/-/cli-truncate-2.1.0.tgz#c39e28bf05edcde5be3b98992a22deed5a2b93c7" - integrity sha512-n8fOixwDD6b/ObinzTrp1ZKFzbgvKZvuz/TvejnLn1aQfC6r52XEx85FmuC+3HI+JM7coBRXUvNqEU2PHVrHpg== - dependencies: - slice-ansi "^3.0.0" - string-width "^4.2.0" - cli-truncate@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/cli-truncate/-/cli-truncate-3.1.0.tgz#3f23ab12535e3d73e839bb43e73c9de487db1389" @@ -9077,7 +8996,7 @@ colord@^2.9.1: resolved "https://registry.yarnpkg.com/colord/-/colord-2.9.3.tgz#4f8ce919de456f1d5c1c368c307fe20f3e59fb43" integrity sha512-jeC1axXpnb0/2nn/Y1LPuLdgXBLH7aDcHu4KEKfqw3CUhX7ZpfBSlPKyqXE6btIgEzfWtrX3/tyBCaCvXvMkOw== -colorette@2.0.19, colorette@^2.0.14, colorette@^2.0.16, colorette@^2.0.7: +colorette@2.0.19, colorette@^2.0.14, colorette@^2.0.7: version "2.0.19" resolved "https://registry.yarnpkg.com/colorette/-/colorette-2.0.19.tgz#cdf044f47ad41a0f4b56b3a0d5b4e6e1a2d5a798" integrity sha512-3tlv/dIP7FWvj3BsbHrGLJ6l/oKh1O3TcgBqMn+yyCagOxc23fyzDS6HypQbgxWbkpDnf52p1LuR4eWDQ/K9WQ== @@ -9170,11 +9089,6 @@ commander@^9.1.0, commander@^9.4.0, commander@^9.4.1: resolved "https://registry.yarnpkg.com/commander/-/commander-9.5.0.tgz#bc08d1eb5cedf7ccb797a96199d41c7bc3e60d30" integrity sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ== -common-tags@^1.8.0: - version "1.8.2" - resolved "https://registry.yarnpkg.com/common-tags/-/common-tags-1.8.2.tgz#94ebb3c076d26032745fd54face7f688ef5ac9c6" - integrity sha512-gk/Z852D2Wtb//0I+kRFNKKE9dIIVirjoqPoA1wJU+XePVXZfGeBpk45+A1rKO4Q43prqWBNY/MiIeRLbPWUaA== - commondir@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" @@ -9815,70 +9729,6 @@ cwd@^0.10.0: find-pkg "^0.1.2" fs-exists-sync "^0.1.0" -cypress-multi-reporters@^1.6.0: - version "1.6.2" - resolved "https://registry.yarnpkg.com/cypress-multi-reporters/-/cypress-multi-reporters-1.6.2.tgz#129dfeffa00d4deca3e9f58d84570b9962c28c2b" - integrity sha512-lvwGwHqZG5CwGxBJ6UJXWaxlWGkJgxBjP0h+IVLrrwRlJpT4coSwwt+UzMdeqEMrzT4IDfhbtmUNOiDleisOYA== - dependencies: - debug "^4.1.1" - lodash "^4.17.15" - -cypress-terminal-report@^1.4.1: - version "1.4.2" - resolved "https://registry.yarnpkg.com/cypress-terminal-report/-/cypress-terminal-report-1.4.2.tgz#4eeaf2c6a063b42271ec686aff4ab0d6f7b252a6" - integrity sha512-YfKB1McG/1mxTrSTyCxv103hg+NC4atHLw3rZKfeRO4qyL5OLNLKbC6kMErqlTrKjfb/cR6KZ+yNr2G+i4pIJA== - dependencies: - chalk "^3.0.0" - methods "^1.1.2" - -cypress@^9.3.1: - version "9.7.0" - resolved "https://registry.yarnpkg.com/cypress/-/cypress-9.7.0.tgz#bf55b2afd481f7a113ef5604aa8b693564b5e744" - integrity sha512-+1EE1nuuuwIt/N1KXRR2iWHU+OiIt7H28jJDyyI4tiUftId/DrXYEwoDa5+kH2pki1zxnA0r6HrUGHV5eLbF5Q== - dependencies: - "@cypress/request" "^2.88.10" - "@cypress/xvfb" "^1.2.4" - "@types/node" "^14.14.31" - "@types/sinonjs__fake-timers" "8.1.1" - "@types/sizzle" "^2.3.2" - arch "^2.2.0" - blob-util "^2.0.2" - bluebird "^3.7.2" - buffer "^5.6.0" - cachedir "^2.3.0" - chalk "^4.1.0" - check-more-types "^2.24.0" - cli-cursor "^3.1.0" - cli-table3 "~0.6.1" - commander "^5.1.0" - common-tags "^1.8.0" - dayjs "^1.10.4" - debug "^4.3.2" - enquirer "^2.3.6" - eventemitter2 "^6.4.3" - execa "4.1.0" - executable "^4.1.1" - extract-zip "2.0.1" - figures "^3.2.0" - fs-extra "^9.1.0" - getos "^3.2.1" - is-ci "^3.0.0" - is-installed-globally "~0.4.0" - lazy-ass "^1.6.0" - listr2 "^3.8.3" - lodash "^4.17.21" - log-symbols "^4.0.0" - minimist "^1.2.6" - ospath "^1.2.2" - pretty-bytes "^5.6.0" - proxy-from-env "1.0.0" - request-progress "^3.0.0" - semver "^7.3.2" - supports-color "^8.1.1" - tmp "~0.2.1" - untildify "^4.0.0" - yauzl "^2.10.0" - dargs@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/dargs/-/dargs-7.0.0.tgz#04015c41de0bcb69ec84050f3d9be0caf8d6d5cc" @@ -11022,7 +10872,7 @@ enhanced-resolve@^5.8.3: graceful-fs "^4.2.4" tapable "^2.2.0" -enquirer@^2.3.5, enquirer@^2.3.6, enquirer@~2.3.6: +enquirer@^2.3.5, enquirer@~2.3.6: version "2.3.6" resolved "https://registry.yarnpkg.com/enquirer/-/enquirer-2.3.6.tgz#2a7fe5dd634a1e4125a975ec994ff5456dc3734d" integrity sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg== @@ -11523,13 +11373,6 @@ escodegen@^2.0.0: optionalDependencies: source-map "~0.6.1" -eslint-plugin-cypress@^2.11.3: - version "2.12.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-cypress/-/eslint-plugin-cypress-2.12.1.tgz#9aeee700708ca8c058e00cdafe215199918c2632" - integrity sha512-c2W/uPADl5kospNDihgiLc7n87t5XhUbFDoTl6CfVkmG+kDAb5Ux10V9PoLPu9N+r7znpc+iQlcmAqT1A/89HA== - dependencies: - globals "^11.12.0" - eslint-plugin-svelte@^2.32.2: version "2.32.2" resolved "https://registry.yarnpkg.com/eslint-plugin-svelte/-/eslint-plugin-svelte-2.32.2.tgz#d8f1352b55967445ee8d57aaee55f99712696a30" @@ -11882,11 +11725,6 @@ event-target-shim@^5.0.0: resolved "https://registry.yarnpkg.com/event-target-shim/-/event-target-shim-5.0.1.tgz#5d4d3ebdf9583d63a5333ce2deb7480ab2b05789" integrity sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ== -eventemitter2@^6.4.3: - version "6.4.9" - resolved "https://registry.yarnpkg.com/eventemitter2/-/eventemitter2-6.4.9.tgz#41f2750781b4230ed58827bc119d293471ecb125" - integrity sha512-JEPTiaOt9f04oa6NOkc4aH+nVp5I3wEjpHbIPqfgCdD5v5bUzy7xQqwcVO2aDQgOWhI28da57HksMrzK9HlRxg== - eventemitter3@^4.0.4: version "4.0.7" resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.7.tgz#2de9b68f6528d5644ef5c59526a1b4a07306169f" @@ -11910,21 +11748,6 @@ evp_bytestokey@^1.0.0, evp_bytestokey@^1.0.3: md5.js "^1.3.4" safe-buffer "^5.1.1" -execa@4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/execa/-/execa-4.1.0.tgz#4e5491ad1572f2f17a77d388c6c857135b22847a" - integrity sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA== - dependencies: - cross-spawn "^7.0.0" - get-stream "^5.0.0" - human-signals "^1.1.1" - is-stream "^2.0.0" - merge-stream "^2.0.0" - npm-run-path "^4.0.0" - onetime "^5.1.0" - signal-exit "^3.0.2" - strip-final-newline "^2.0.0" - execa@5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/execa/-/execa-5.0.0.tgz#4029b0007998a841fbd1032e5f4de86a3c1e3376" @@ -11981,13 +11804,6 @@ execa@^1.0.0: signal-exit "^3.0.0" strip-eof "^1.0.0" -executable@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/executable/-/executable-4.1.1.tgz#41532bff361d3e57af4d763b70582db18f5d133c" - integrity sha512-8iA79xD3uAch729dUG8xaaBBFGaEa0wdD2VkYLFHwlqosEj/jT66AzcreRDSgV7ehnNLBW2WR5jIXwGKjVdTLg== - dependencies: - pify "^2.2.0" - exif-parser@^0.1.12: version "0.1.12" resolved "https://registry.yarnpkg.com/exif-parser/-/exif-parser-0.1.12.tgz#58a9d2d72c02c1f6f02a0ef4a9166272b7760922" @@ -12179,17 +11995,6 @@ extglob@^2.0.4: snapdragon "^0.8.1" to-regex "^3.0.1" -extract-zip@2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/extract-zip/-/extract-zip-2.0.1.tgz#663dca56fe46df890d5f131ef4a06d22bb8ba13a" - integrity sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg== - dependencies: - debug "^4.1.1" - get-stream "^5.1.0" - yauzl "^2.10.0" - optionalDependencies: - "@types/yauzl" "^2.9.1" - extsprintf@1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" @@ -12376,7 +12181,7 @@ fflate@^0.4.1: resolved "https://registry.yarnpkg.com/fflate/-/fflate-0.4.8.tgz#f90b82aefbd8ac174213abb338bd7ef848f0f5ae" integrity sha512-FJqqoDBR00Mdj9ppamLa/Y7vxm+PRmNWA67N846RvsoYVMKB4q3y/de5PA7gUmRMYK/8CMz2GDZQmCRN1wBcWA== -figures@3.2.0, figures@^3.0.0, figures@^3.2.0: +figures@3.2.0, figures@^3.0.0: version "3.2.0" resolved "https://registry.yarnpkg.com/figures/-/figures-3.2.0.tgz#625c18bd293c604dc4a8ddb2febf0c88341746af" integrity sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg== @@ -13114,7 +12919,7 @@ get-stream@^4.0.0, get-stream@^4.1.0: dependencies: pump "^3.0.0" -get-stream@^5.0.0, get-stream@^5.1.0: +get-stream@^5.1.0: version "5.2.0" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-5.2.0.tgz#4966a1795ee5ace65e706c4b7beb71257d6e22d3" integrity sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA== @@ -13168,13 +12973,6 @@ getopts@2.3.0: resolved "https://registry.yarnpkg.com/getopts/-/getopts-2.3.0.tgz#71e5593284807e03e2427449d4f6712a268666f4" integrity sha512-5eDf9fuSXwxBL6q5HX+dhDj+dslFGWzU5thZ9kNKUkcPtaPdatmUFKwHFrLb/uf/WpA4BHET+AX3Scl56cAjpA== -getos@^3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/getos/-/getos-3.2.1.tgz#0134d1f4e00eb46144c5a9c0ac4dc087cbb27dc5" - integrity sha512-U56CfOK17OKgTVqozZjUKNdkfEv6jk5WISBJ8SHoagjE6L69zOwl3Z+O8myjY9MEW3i2HPWQBt/LTbCgcC973Q== - dependencies: - async "^3.2.0" - getpass@^0.1.1: version "0.1.7" resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" @@ -13385,7 +13183,7 @@ global@~4.4.0: min-document "^2.19.0" process "^0.11.10" -globals@^11.1.0, globals@^11.12.0: +globals@^11.1.0: version "11.12.0" resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== @@ -13996,15 +13794,6 @@ http-signature@~1.2.0: jsprim "^1.2.2" sshpk "^1.7.0" -http-signature@~1.3.6: - version "1.3.6" - resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.3.6.tgz#cb6fbfdf86d1c974f343be94e87f7fc128662cf9" - integrity sha512-3adrsD6zqo4GsTqtO7FyrejHNv+NgiIfAfv68+jVlFmSr9OGy7zrxONceFRLKvnnZA5jbxQBX1u9PpB6Wi32Gw== - dependencies: - assert-plus "^1.0.0" - jsprim "^2.0.2" - sshpk "^1.14.1" - http2-wrapper@^1.0.0-beta.5.2: version "1.0.3" resolved "https://registry.yarnpkg.com/http2-wrapper/-/http2-wrapper-1.0.3.tgz#b8f55e0c1f25d4ebd08b3b0c2c079f9590800b3d" @@ -14021,11 +13810,6 @@ https-proxy-agent@5, https-proxy-agent@^5.0.0, https-proxy-agent@^5.0.1: agent-base "6" debug "4" -human-signals@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-1.1.1.tgz#c5b1cd14f50aeae09ab6c59fe63ba3395fe4dfa3" - integrity sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw== - human-signals@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0" @@ -14512,7 +14296,7 @@ is-callable@^1.1.4, is-callable@^1.2.4: resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.4.tgz#47301d58dd0259407865547853df6d61fe471945" integrity sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w== -is-ci@3.0.1, is-ci@^3.0.0: +is-ci@3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-3.0.1.tgz#db6ecbed1bd659c43dac0f45661e7674103d1867" integrity sha512-ZYvCgrefwqoQ6yTyYUbQu64HsITZ3NfKX1lzaEYdkTDcfKzzCI/wthRRYKkdjHKFVgNiXKAKm65Zo1pk2as/QQ== @@ -14650,7 +14434,7 @@ is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3, is-glob@~4.0.1: dependencies: is-extglob "^2.1.1" -is-installed-globally@^0.4.0, is-installed-globally@~0.4.0: +is-installed-globally@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/is-installed-globally/-/is-installed-globally-0.4.0.tgz#9a0fd407949c30f86eb6959ef1b7994ed0b7b520" integrity sha512-iwGqO3J21aaSkC7jWnHP/difazwS7SFeIqxv6wEtLU8Y5KlzFTjyqcSIT0d8s4+dDhKytsk9PJZ2BkS5eZwQRQ== @@ -15918,16 +15702,6 @@ jsprim@^1.2.2: json-schema "0.4.0" verror "1.10.0" -jsprim@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-2.0.2.tgz#77ca23dbcd4135cd364800d22ff82c2185803d4d" - integrity sha512-gqXddjPqQ6G40VdnI6T6yObEC+pDNvyP95wdQhkWkg7crHH3km5qP1FsOXEkzEQwnz6gz5qGTn1c2Y52wP3OyQ== - dependencies: - assert-plus "1.0.0" - extsprintf "1.3.0" - json-schema "0.4.0" - verror "1.10.0" - jstransform@~11.0.0: version "11.0.3" resolved "https://registry.yarnpkg.com/jstransform/-/jstransform-11.0.3.tgz#09a78993e0ae4d4ef4487f6155a91f6190cb4223" @@ -16307,7 +16081,7 @@ latest-version@^5.1.0: dependencies: package-json "^6.3.0" -lazy-ass@1.6.0, lazy-ass@^1.6.0: +lazy-ass@1.6.0: version "1.6.0" resolved "https://registry.yarnpkg.com/lazy-ass/-/lazy-ass-1.6.0.tgz#7999655e8646c17f089fdd187d150d3324d54513" integrity sha512-cc8oEVoctTvsFZ/Oje/kGnHbpWHYBe8IAJe4C0QNc3t8uM/0Y8+erSz/7Y1ALuXTEZTMvxXwO6YbX1ey3ujiZw== @@ -16665,20 +16439,6 @@ linkify-it@^3.0.1: dependencies: uc.micro "^1.0.1" -listr2@^3.8.3: - version "3.14.0" - resolved "https://registry.yarnpkg.com/listr2/-/listr2-3.14.0.tgz#23101cc62e1375fd5836b248276d1d2b51fdbe9e" - integrity sha512-TyWI8G99GX9GjE54cJ+RrNMcIFBfwMPxc3XTFiAYGN4s10hWROGtOg7+O6u6LE3mNkyld7RSLE6nrKBvTfcs3g== - dependencies: - cli-truncate "^2.1.0" - colorette "^2.0.16" - log-update "^4.0.0" - p-map "^4.0.0" - rfdc "^1.3.0" - rxjs "^7.5.1" - through "^2.3.8" - wrap-ansi "^7.0.0" - load-bmfont@^1.3.1, load-bmfont@^1.4.0: version "1.4.1" resolved "https://registry.yarnpkg.com/load-bmfont/-/load-bmfont-1.4.1.tgz#c0f5f4711a1e2ccff725a7b6078087ccfcddd3e9" @@ -16894,7 +16654,7 @@ lodash.omit@^4.5.0: resolved "https://registry.yarnpkg.com/lodash.omit/-/lodash.omit-4.5.0.tgz#6eb19ae5a1ee1dd9df0b969e66ce0b7fa30b5e60" integrity sha512-XeqSp49hNGmlkj2EJlfrQFIzQ6lXdNro9sddtQzcJY8QaoC2GO0DT7xaIokHeyM+mIT0mPMlPvkYzg2xCuHdZg== -lodash.once@^4.0.0, lodash.once@^4.1.1: +lodash.once@^4.0.0: version "4.1.1" resolved "https://registry.yarnpkg.com/lodash.once/-/lodash.once-4.1.1.tgz#0dd3971213c7c56df880977d504c88fb471a97ac" integrity sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg== @@ -16946,7 +16706,7 @@ log-symbols@^3.0.0: dependencies: chalk "^2.4.2" -log-symbols@^4.0.0, log-symbols@^4.1.0: +log-symbols@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-4.1.0.tgz#3fbdbb95b4683ac9fc785111e792e558d4abd503" integrity sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg== @@ -16954,16 +16714,6 @@ log-symbols@^4.0.0, log-symbols@^4.1.0: chalk "^4.1.0" is-unicode-supported "^0.1.0" -log-update@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/log-update/-/log-update-4.0.0.tgz#589ecd352471f2a1c0c570287543a64dfd20e0a1" - integrity sha512-9fkkDevMefjg0mmzWFBW8YkFP91OrizzkW3diF7CpG+S2EYdy4+TVfGwz1zeF8x7hCx1ovSPTOE9Ngib74qqUg== - dependencies: - ansi-escapes "^4.3.0" - cli-cursor "^3.1.0" - slice-ansi "^4.0.0" - wrap-ansi "^6.2.0" - logform@^2.3.2, logform@^2.4.0: version "2.5.1" resolved "https://registry.yarnpkg.com/logform/-/logform-2.5.1.tgz#44c77c34becd71b3a42a3970c77929e52c6ed48b" @@ -18497,7 +18247,7 @@ npm-run-path@^2.0.0: dependencies: path-key "^2.0.0" -npm-run-path@^4.0.0, npm-run-path@^4.0.1: +npm-run-path@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-4.0.1.tgz#b7ecd1e5ed53da8e37a55e1c2269e0b97ed748ea" integrity sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw== @@ -19059,11 +18809,6 @@ os-tmpdir@~1.0.2: resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" integrity sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g== -ospath@^1.2.2: - version "1.2.2" - resolved "https://registry.yarnpkg.com/ospath/-/ospath-1.2.2.tgz#1276639774a3f8ef2572f7fe4280e0ea4550c07b" - integrity sha512-o6E5qJV5zkAbIDNhGSIlyOhScKXgQrSRMilfph0clDfM0nEnBOlKlH4sWDmG95BW/CvwNz0vmm7dJVtU2KlMiA== - osx-release@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/osx-release/-/osx-release-1.1.0.tgz#f217911a28136949af1bf9308b241e2737d3cd6c" @@ -19700,7 +19445,7 @@ pify@5.0.0, pify@^5.0.0: resolved "https://registry.yarnpkg.com/pify/-/pify-5.0.0.tgz#1f5eca3f5e87ebec28cc6d54a0e4aaf00acc127f" integrity sha512-eW/gHNMlxdSP6dmG6uJip6FXN0EQBwm2clYYd8Wul42Cwu/DK8HEftzsapcNdYe2MfLiIwZqsDk2RDEsTE79hA== -pify@^2.2.0, pify@^2.3.0: +pify@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" integrity sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog== @@ -20625,11 +20370,6 @@ prettier@^2.5.1: resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.4.tgz#34dd2595629bfbb79d344ac4a91ff948694463c3" integrity sha512-vIS4Rlc2FNh0BySk3Wkd6xmwxB0FpOndW5fisM5H8hsZSxU2VWVB5CWIkIjWvrHjIhxk2g3bfMKM87zNTrZddw== -pretty-bytes@^5.6.0: - version "5.6.0" - resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-5.6.0.tgz#356256f643804773c82f64723fe78c92c62beaeb" - integrity sha512-FFw039TmrBqFK8ma/7OL3sDz/VytdtJr044/QUJtH0wK9lb9jLq9tJyIxUwtQJHwar2BqtiA4iCWSwo9JLkzFg== - pretty-format@^26.6.2: version "26.6.2" resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-26.6.2.tgz#e35c2705f14cb7fe2fe94fa078345b444120fc93" @@ -20865,11 +20605,6 @@ proxy-agent@^5.0.0: proxy-from-env "^1.0.0" socks-proxy-agent "^5.0.0" -proxy-from-env@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.0.0.tgz#33c50398f70ea7eb96d21f7b817630a55791c7ee" - integrity sha512-F2JHgJQ1iqwnHDcQjVBsq3n/uoaFL+iPW/eAeL7kVxy/2RrWaN4WroKjjvbsoRtv0ftelNyC01bjRhn/bhcf4A== - proxy-from-env@^1.0.0, proxy-from-env@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2" @@ -20983,13 +20718,6 @@ qs@6.11.0, qs@^6.10.3, qs@^6.11.0, qs@^6.4.0, qs@^6.9.4: dependencies: side-channel "^1.0.4" -qs@~6.10.3: - version "6.10.5" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.10.5.tgz#974715920a80ff6a262264acd2c7e6c2a53282b4" - integrity sha512-O5RlPh0VFtR78y79rgcgKK4wbAI0C5zGVLztOIdpWX6ep368q5Hv6XRxDvXuZ9q3C6v+e3n8UfZZJw7IIG27eQ== - dependencies: - side-channel "^1.0.4" - qs@~6.5.2: version "6.5.3" resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.3.tgz#3aeeffc91967ef6e35c0e488ef46fb296ab76aad" @@ -21544,13 +21272,6 @@ repeat-string@^1.6.1: resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" integrity sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w== -request-progress@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/request-progress/-/request-progress-3.0.0.tgz#4ca754081c7fec63f505e4faa825aa06cd669dbe" - integrity sha512-MnWzEHHaxHO2iWiQuHrUPBi/1WeBf5PkxQqNyNvLl9VAYSdXkP8tQ3pBSeCPD+yw0v0Aq1zosWLz0BdeXpWwZg== - dependencies: - throttleit "^1.0.0" - request@^2.88.0: version "2.88.2" resolved "https://registry.yarnpkg.com/request/-/request-2.88.2.tgz#d73c918731cb5a87da047e207234146f664d12b3" @@ -21983,7 +21704,7 @@ rxjs@^6.6.0, rxjs@^6.6.6: dependencies: tslib "^1.9.0" -rxjs@^7.0.0, rxjs@^7.5.1, rxjs@^7.5.5, rxjs@^7.8.0: +rxjs@^7.0.0, rxjs@^7.5.5, rxjs@^7.8.0: version "7.8.0" resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.8.0.tgz#90a938862a82888ff4c7359811a595e14e1e09a4" integrity sha512-F2+gxDshqmIub1KdvZkaEfGDwLNpPvk9Fs6LD/MyQxNgMds/WH9OdDDXOmxUZpME+iSK3rQCctkL0DYyytUqMg== @@ -22502,15 +22223,6 @@ slice-ansi@^2.1.0: astral-regex "^1.0.0" is-fullwidth-code-point "^2.0.0" -slice-ansi@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-3.0.0.tgz#31ddc10930a1b7e0b67b08c96c2f49b77a789787" - integrity sha512-pSyv7bSTC7ig9Dcgbw9AuRNUb5k5V6oDudjZoMBSr13qpLBG7tB+zgCkARjq7xIUgdz5P1Qe8u+rSGdouOOIyQ== - dependencies: - ansi-styles "^4.0.0" - astral-regex "^2.0.0" - is-fullwidth-code-point "^3.0.0" - slice-ansi@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-4.0.0.tgz#500e8dd0fd55b05815086255b3195adf2a45fe6b" @@ -22945,7 +22657,7 @@ ssh2@^1.11.0: cpu-features "~0.0.4" nan "^2.16.0" -sshpk@^1.14.1, sshpk@^1.7.0: +sshpk@^1.7.0: version "1.17.0" resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.17.0.tgz#578082d92d4fe612b13007496e543fa0fbcbe4c5" integrity sha512-/9HIEs1ZXGhSPE8X6Ccm7Nam1z8KcoCqPdI7ecm1N33EzAetWahvQWVqLZtaZQ+IDKX4IyA2o0gBzqIMkAagHQ== @@ -23451,7 +23163,7 @@ supports-color@^7.0.0, supports-color@^7.1.0: dependencies: has-flag "^4.0.0" -supports-color@^8.0.0, supports-color@^8.1.0, supports-color@^8.1.1: +supports-color@^8.0.0, supports-color@^8.1.0: version "8.1.1" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== @@ -23902,11 +23614,6 @@ thread-stream@^2.0.0: dependencies: real-require "^0.2.0" -throttleit@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/throttleit/-/throttleit-1.0.0.tgz#9e785836daf46743145a5984b6268d828528ac6c" - integrity sha512-rkTVqu6IjfQ/6+uNuuc3sZek4CEYxTJom3IktzgdSxcZqdARuebbA/f4QmAxMQIxqq9ZLEUkSYqvuk1I6VKq4g== - through2@3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/through2/-/through2-3.0.2.tgz#99f88931cfc761ec7678b41d5d7336b5b6a07bf4" @@ -25792,7 +25499,7 @@ yargs@^17.2.1, yargs@^17.3.1, yargs@^17.5.1, yargs@^17.6.2: y18n "^5.0.5" yargs-parser "^21.1.1" -yauzl@^2.10.0, yauzl@^2.4.2: +yauzl@^2.4.2: version "2.10.0" resolved "https://registry.yarnpkg.com/yauzl/-/yauzl-2.10.0.tgz#c7eb17c93e112cb1086fa6d8e51fb0667b79a5f9" integrity sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g== From 205d33f172e35fee2a5a3afdb0d844147b0d3d11 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 7 Sep 2023 15:37:22 +0200 Subject: [PATCH 103/116] Clean cypress refs --- .../backend-core/src/cache/appMetadata.ts | 2 +- packages/backend-core/src/environment.ts | 12 +++---- packages/server/src/environment.ts | 34 ++++--------------- .../src/sdk/app/rows/search/internal.ts | 5 --- .../src/api/controllers/system/environment.ts | 3 +- packages/worker/src/environment.ts | 22 +++--------- 6 files changed, 20 insertions(+), 58 deletions(-) diff --git a/packages/backend-core/src/cache/appMetadata.ts b/packages/backend-core/src/cache/appMetadata.ts index 0c320ec776..420456fd41 100644 --- a/packages/backend-core/src/cache/appMetadata.ts +++ b/packages/backend-core/src/cache/appMetadata.ts @@ -55,7 +55,7 @@ export async function getAppMetadata(appId: string): Promise { throw err } } - // needed for cypress/some scenarios where the caching happens + // needed for some scenarios where the caching happens // so quickly the requests can get slightly out of sync // might store its invalid just before it stores its valid if (isInvalid(metadata)) { diff --git a/packages/backend-core/src/environment.ts b/packages/backend-core/src/environment.ts index 05fcbffd46..3894bdd0f7 100644 --- a/packages/backend-core/src/environment.ts +++ b/packages/backend-core/src/environment.ts @@ -2,15 +2,15 @@ import { existsSync, readFileSync } from "fs" import { ServiceType } from "@budibase/types" function isTest() { - return isCypress() || isJest() + return isJest() } function isJest() { - return !!(process.env.NODE_ENV === "jest" || process.env.JEST_WORKER_ID) -} - -function isCypress() { - return process.env.NODE_ENV === "cypress" + return ( + process.env.NODE_ENV === "jest" || + (process.env.JEST_WORKER_ID != null && + process.env.JEST_WORKER_ID !== "null") + ) } function isDev() { diff --git a/packages/server/src/environment.ts b/packages/server/src/environment.ts index 06fd659911..a1701535ce 100644 --- a/packages/server/src/environment.ts +++ b/packages/server/src/environment.ts @@ -3,28 +3,8 @@ import { ServiceType } from "@budibase/types" coreEnv._set("SERVICE_TYPE", ServiceType.APPS) import { join } from "path" -function isTest() { - return isCypress() || isJest() -} - -function isJest() { - return ( - process.env.NODE_ENV === "jest" || - (process.env.JEST_WORKER_ID != null && - process.env.JEST_WORKER_ID !== "null") - ) -} - -function isDev() { - return process.env.NODE_ENV !== "production" -} - -function isCypress() { - return process.env.NODE_ENV === "cypress" -} - let LOADED = false -if (!LOADED && isDev() && !isTest()) { +if (!LOADED && coreEnv.isDev() && !coreEnv.isTest()) { require("dotenv").config({ path: join(__dirname, "..", ".env"), }) @@ -93,12 +73,12 @@ const environment = { // @ts-ignore environment[key] = value }, - isTest, - isJest, - isCypress, - isDev, + isTest: coreEnv.isTest, + isJest: coreEnv.isJest, + + isDev: coreEnv.isDev, isProd: () => { - return !isDev() + return !coreEnv.isDev() }, isInThread: () => { return process.env.FORKED_PROCESS @@ -108,7 +88,7 @@ const environment = { } // threading can cause memory issues with node-ts in development -if (isDev() && environment.DISABLE_THREADING == null) { +if (coreEnv.isDev() && environment.DISABLE_THREADING == null) { environment._set("DISABLE_THREADING", "1") } diff --git a/packages/server/src/sdk/app/rows/search/internal.ts b/packages/server/src/sdk/app/rows/search/internal.ts index dfc5b7dcab..4cdeca87f6 100644 --- a/packages/server/src/sdk/app/rows/search/internal.ts +++ b/packages/server/src/sdk/app/rows/search/internal.ts @@ -34,11 +34,6 @@ import pick from "lodash/pick" export async function search(options: SearchParams) { const { tableId } = options - // Fetch the whole table when running in cypress, as search doesn't work - if (!env.COUCH_DB_URL && env.isCypress()) { - return { rows: await fetch(tableId) } - } - const { paginate, query } = options const params: InternalSearchParams = { diff --git a/packages/worker/src/api/controllers/system/environment.ts b/packages/worker/src/api/controllers/system/environment.ts index 729a00fa88..a63533e1bb 100644 --- a/packages/worker/src/api/controllers/system/environment.ts +++ b/packages/worker/src/api/controllers/system/environment.ts @@ -10,7 +10,6 @@ export const fetch = async (ctx: Ctx) => { accountPortalUrl: env.ACCOUNT_PORTAL_URL, disableAccountPortal: env.DISABLE_ACCOUNT_PORTAL, baseUrl: env.PLATFORM_URL, - // in test need to pretend its in production for the UI (Cypress) - isDev: env.isDev() && !env.isTest(), + isDev: env.isDev(), } } diff --git a/packages/worker/src/environment.ts b/packages/worker/src/environment.ts index c357ceb65b..2d5ecbd868 100644 --- a/packages/worker/src/environment.ts +++ b/packages/worker/src/environment.ts @@ -4,20 +4,8 @@ import { join } from "path" coreEnv._set("SERVICE_TYPE", ServiceType.WORKER) -function isDev() { - return process.env.NODE_ENV !== "production" -} - -function isTest() { - return ( - process.env.NODE_ENV === "jest" || - process.env.NODE_ENV === "cypress" || - process.env.JEST_WORKER_ID != null - ) -} - let LOADED = false -if (!LOADED && isDev() && !isTest()) { +if (!LOADED && coreEnv.isDev() && !coreEnv.isTest()) { require("dotenv").config({ path: join(__dirname, "..", ".env"), }) @@ -85,16 +73,16 @@ const environment = { // @ts-ignore environment[key] = value }, - isDev, - isTest, + isDev: coreEnv.isDev, + isTest: coreEnv.isTest, isProd: () => { - return !isDev() + return !coreEnv.isDev() }, } // if some var haven't been set, define them if (!environment.APPS_URL) { - environment.APPS_URL = isDev() + environment.APPS_URL = coreEnv.isDev() ? "http://localhost:4001" : "http://app-service:4002" } From d7db276e475acb35441d5fef6d23a31de6ec64eb Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Thu, 7 Sep 2023 13:59:22 +0000 Subject: [PATCH 104/116] Bump version to 2.9.40-alpha.0 --- lerna.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lerna.json b/lerna.json index 1b2130677e..0d8a2613d4 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.9.39", + "version": "2.9.40-alpha.0", "npmClient": "yarn", "packages": [ "packages/*" @@ -19,4 +19,4 @@ "loadEnvFiles": false } } -} +} \ No newline at end of file From 7bd91ebb7f93c250a53dfd3caad12aaffb8d232f Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 7 Sep 2023 16:25:13 +0200 Subject: [PATCH 105/116] Fix --- packages/worker/src/api/controllers/system/environment.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/worker/src/api/controllers/system/environment.ts b/packages/worker/src/api/controllers/system/environment.ts index a63533e1bb..ade5f241e2 100644 --- a/packages/worker/src/api/controllers/system/environment.ts +++ b/packages/worker/src/api/controllers/system/environment.ts @@ -10,6 +10,6 @@ export const fetch = async (ctx: Ctx) => { accountPortalUrl: env.ACCOUNT_PORTAL_URL, disableAccountPortal: env.DISABLE_ACCOUNT_PORTAL, baseUrl: env.PLATFORM_URL, - isDev: env.isDev(), + isDev: env.isDev() && !env.isTest(), } } From 2f115b5b6434c7b5d8abddc00a76a959218686a0 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Thu, 7 Sep 2023 15:27:52 +0100 Subject: [PATCH 106/116] Quick fix for automation timing. --- packages/server/src/threads/automation.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/server/src/threads/automation.ts b/packages/server/src/threads/automation.ts index 8bdf9cbe65..9241289e86 100644 --- a/packages/server/src/threads/automation.ts +++ b/packages/server/src/threads/automation.ts @@ -102,7 +102,7 @@ class Orchestrator { } cleanupTriggerOutputs(stepId: string, triggerOutput: TriggerOutput) { - if (stepId === CRON_STEP_ID) { + if (stepId === CRON_STEP_ID && !triggerOutput.timestamp) { triggerOutput.timestamp = Date.now() } return triggerOutput From e7f29c6da6b3d659019a3b50c3f5113c79bcf5f1 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Thu, 7 Sep 2023 14:53:01 +0000 Subject: [PATCH 107/116] Bump version to 2.9.40-alpha.1 --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index 0d8a2613d4..e52513f23c 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.9.40-alpha.0", + "version": "2.9.40-alpha.1", "npmClient": "yarn", "packages": [ "packages/*" From 40870cbdc409e5cd230b83d7fa1bd28365aa4f67 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Thu, 7 Sep 2023 15:44:18 +0000 Subject: [PATCH 108/116] Bump version to 2.9.40-alpha.2 --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index e52513f23c..edbc5e3ebf 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.9.40-alpha.1", + "version": "2.9.40-alpha.2", "npmClient": "yarn", "packages": [ "packages/*" From db1a1f37931b9e9c110c2ed87b2f1799e99ba546 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Thu, 7 Sep 2023 16:02:26 +0000 Subject: [PATCH 109/116] Bump version to 2.9.40-alpha.3 --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index edbc5e3ebf..fde56290f6 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.9.40-alpha.2", + "version": "2.9.40-alpha.3", "npmClient": "yarn", "packages": [ "packages/*" From 562564fb193c503c2e770fec2666100c8d264588 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Thu, 7 Sep 2023 16:21:02 +0000 Subject: [PATCH 110/116] Bump version to 2.9.40-alpha.4 --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index fde56290f6..ec3b6411c6 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.9.40-alpha.3", + "version": "2.9.40-alpha.4", "npmClient": "yarn", "packages": [ "packages/*" From f6d1344ea510e2da1ddefa4e91df5a74678e83fd Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 7 Sep 2023 19:49:55 +0200 Subject: [PATCH 111/116] Update pro ref --- packages/pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/pro b/packages/pro index 7b58ca3f3c..140386c7ad 160000 --- a/packages/pro +++ b/packages/pro @@ -1 +1 @@ -Subproject commit 7b58ca3f3c1e5d700b1af5d6c65b2fdf478f68ba +Subproject commit 140386c7ad7e3d50bd361fc702e49b288c1747c2 From 847d8f0732693a3954f719f103adbfc228b77bb4 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 7 Sep 2023 19:54:27 +0200 Subject: [PATCH 112/116] Update pro ref --- packages/pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/pro b/packages/pro index 140386c7ad..4638ae916e 160000 --- a/packages/pro +++ b/packages/pro @@ -1 +1 @@ -Subproject commit 140386c7ad7e3d50bd361fc702e49b288c1747c2 +Subproject commit 4638ae916e55ce89166095578cbd01745d0ee9ee From 84fa6b2233d9ecbb36ee70acd29c1374d0de7c3d Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Thu, 7 Sep 2023 18:19:22 +0000 Subject: [PATCH 113/116] Bump version to 2.9.40-alpha.5 --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index ec3b6411c6..b60b8cb9df 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.9.40-alpha.4", + "version": "2.9.40-alpha.5", "npmClient": "yarn", "packages": [ "packages/*" From 449bb5003640430739c2a4a1992f1f301ae6521a Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Thu, 7 Sep 2023 18:50:48 +0000 Subject: [PATCH 114/116] Bump version to 2.9.40-alpha.6 --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index b60b8cb9df..e8211f66b1 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.9.40-alpha.5", + "version": "2.9.40-alpha.6", "npmClient": "yarn", "packages": [ "packages/*" From f61abd1f1dcf9363732b499cde22746b9feaf023 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 7 Sep 2023 21:14:38 +0100 Subject: [PATCH 115/116] Revert "Clean backend-core package" --- packages/backend-core/.npmignore | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/backend-core/.npmignore b/packages/backend-core/.npmignore index fb547825eb..30bba85ce8 100644 --- a/packages/backend-core/.npmignore +++ b/packages/backend-core/.npmignore @@ -1,4 +1,6 @@ * !dist/**/* dist/tsconfig.build.tsbuildinfo -!package.json \ No newline at end of file +!package.json +!src/** +!tests/** \ No newline at end of file From 9b722b7be1d00d396310f5ed373caa9bc95720b2 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Thu, 7 Sep 2023 20:27:06 +0000 Subject: [PATCH 116/116] Bump version to 2.9.40-alpha.7 --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index e8211f66b1..1725c59154 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.9.40-alpha.6", + "version": "2.9.40-alpha.7", "npmClient": "yarn", "packages": [ "packages/*"