From 0159d52aa68d097391f7a0dbef36075fcdb2063e Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Mon, 17 Jan 2022 09:39:22 +0100 Subject: [PATCH 01/19] Revert "sameSite and secure cookie settings" --- packages/backend-core/src/environment.js | 8 -------- packages/backend-core/src/utils.js | 6 ------ 2 files changed, 14 deletions(-) diff --git a/packages/backend-core/src/environment.js b/packages/backend-core/src/environment.js index 3db59ab321..c26ad1c199 100644 --- a/packages/backend-core/src/environment.js +++ b/packages/backend-core/src/environment.js @@ -6,13 +6,6 @@ function isTest() { ) } -function isDev() { - return ( - process.env.NODE_ENV !== "production" && - process.env.BUDIBASE_ENVIRONMENT !== "production" - ) -} - module.exports = { JWT_SECRET: process.env.JWT_SECRET, COUCH_DB_URL: process.env.COUCH_DB_URL, @@ -34,7 +27,6 @@ module.exports = { COOKIE_DOMAIN: process.env.COOKIE_DOMAIN, PLATFORM_URL: process.env.PLATFORM_URL, isTest, - isDev, _set(key, value) { process.env[key] = value module.exports[key] = value diff --git a/packages/backend-core/src/utils.js b/packages/backend-core/src/utils.js index 37193885f1..8c00f2a8b8 100644 --- a/packages/backend-core/src/utils.js +++ b/packages/backend-core/src/utils.js @@ -23,7 +23,6 @@ const { getUserSessions, invalidateSessions } = require("./security/sessions") const { migrateIfRequired } = require("./migrations") const { USER_EMAIL_VIEW_CASING } = require("./migrations").MIGRATIONS const { GLOBAL_DB } = require("./migrations").MIGRATION_DBS -const { isDev, isTest } = require("./environment") const APP_PREFIX = DocumentTypes.APP + SEPARATOR @@ -109,11 +108,6 @@ exports.setCookie = (ctx, value, name = "builder", opts = { sign: true }) => { overwrite: true, } - if (!isDev() && !isTest()) { - config.sameSite = "none" - config.secure = true - } - if (environment.COOKIE_DOMAIN) { config.domain = environment.COOKIE_DOMAIN } From 45093aac139526980ec13e1f787bbdaf5881c432 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Mon, 17 Jan 2022 08:48:49 +0000 Subject: [PATCH 02/19] v1.0.42 --- lerna.json | 2 +- packages/backend-core/package.json | 2 +- packages/bbui/package.json | 2 +- packages/builder/package.json | 8 ++++---- packages/cli/package.json | 2 +- packages/client/package.json | 6 +++--- packages/server/package.json | 8 ++++---- packages/string-templates/package.json | 2 +- packages/worker/package.json | 6 +++--- 9 files changed, 19 insertions(+), 19 deletions(-) diff --git a/lerna.json b/lerna.json index 9c19e33343..960c7fb249 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.0.41", + "version": "1.0.42", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index 03b215be56..ef6e7354c5 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "1.0.41", + "version": "1.0.42", "description": "Budibase backend core libraries used in server and worker", "main": "src/index.js", "author": "Budibase", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 02a1f3fdb5..3e0c504a9a 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/bbui", "description": "A UI solution used in the different Budibase projects.", - "version": "1.0.41", + "version": "1.0.42", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", diff --git a/packages/builder/package.json b/packages/builder/package.json index 555bb0701f..07c3299066 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.0.41", + "version": "1.0.42", "license": "GPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^1.0.41", - "@budibase/client": "^1.0.41", + "@budibase/bbui": "^1.0.42", + "@budibase/client": "^1.0.42", "@budibase/colorpicker": "1.1.2", - "@budibase/string-templates": "^1.0.41", + "@budibase/string-templates": "^1.0.42", "@sentry/browser": "5.19.1", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/cli/package.json b/packages/cli/package.json index bb8c650e51..ee01a63b9d 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "1.0.41", + "version": "1.0.42", "description": "Budibase CLI, for developers, self hosting and migrations.", "main": "src/index.js", "bin": { diff --git a/packages/client/package.json b/packages/client/package.json index 5679e723e5..c66e260ff2 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "1.0.41", + "version": "1.0.42", "license": "MPL-2.0", "module": "dist/budibase-client.js", "main": "dist/budibase-client.js", @@ -19,9 +19,9 @@ "dev:builder": "rollup -cw" }, "dependencies": { - "@budibase/bbui": "^1.0.41", + "@budibase/bbui": "^1.0.42", "@budibase/standard-components": "^0.9.139", - "@budibase/string-templates": "^1.0.41", + "@budibase/string-templates": "^1.0.42", "regexparam": "^1.3.0", "shortid": "^2.2.15", "svelte-spa-router": "^3.0.5" diff --git a/packages/server/package.json b/packages/server/package.json index 7e50569440..df04080f5c 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "1.0.41", + "version": "1.0.42", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -70,9 +70,9 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "^10.0.3", - "@budibase/backend-core": "^1.0.41", - "@budibase/client": "^1.0.41", - "@budibase/string-templates": "^1.0.41", + "@budibase/backend-core": "^1.0.42", + "@budibase/client": "^1.0.42", + "@budibase/string-templates": "^1.0.42", "@bull-board/api": "^3.7.0", "@bull-board/koa": "^3.7.0", "@elastic/elasticsearch": "7.10.0", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index a5d387ee8a..48b232db77 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "1.0.41", + "version": "1.0.42", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/worker/package.json b/packages/worker/package.json index 48301e40dc..85f5e274e5 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "1.0.41", + "version": "1.0.42", "description": "Budibase background service", "main": "src/index.js", "repository": { @@ -29,8 +29,8 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "^1.0.41", - "@budibase/string-templates": "^1.0.41", + "@budibase/backend-core": "^1.0.42", + "@budibase/string-templates": "^1.0.42", "@koa/router": "^8.0.0", "@sentry/node": "^6.0.0", "@techpass/passport-openidconnect": "^0.3.0", From 80e1da6a942dee3e6902393158f16b237f734407 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Mon, 17 Jan 2022 15:57:31 +0100 Subject: [PATCH 03/19] readding query thread timeout --- packages/server/src/api/controllers/query/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/server/src/api/controllers/query/index.js b/packages/server/src/api/controllers/query/index.js index 4096dd433f..21db1eebbf 100644 --- a/packages/server/src/api/controllers/query/index.js +++ b/packages/server/src/api/controllers/query/index.js @@ -9,8 +9,11 @@ const { Thread, ThreadType } = require("../../../threads") const { save: saveDatasource } = require("../datasource") const { RestImporter } = require("./import") const { invalidateDynamicVariables } = require("../../../threads/utils") +const environment = require("../../../environment") -const Runner = new Thread(ThreadType.QUERY, { timeoutMs: 10000 }) +const Runner = new Thread(ThreadType.QUERY, { + timeoutMs: environment.QUERY_THREAD_TIMEOUT || 10000, +}) // simple function to append "readable" to all read queries function enrichQueries(input) { From 9ef9c63b0e2dc4f2c60a7171565363cedf85f5d0 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Mon, 17 Jan 2022 16:42:48 +0000 Subject: [PATCH 04/19] v1.0.43 --- lerna.json | 2 +- packages/backend-core/package.json | 2 +- packages/bbui/package.json | 2 +- packages/builder/package.json | 8 ++++---- packages/cli/package.json | 2 +- packages/client/package.json | 6 +++--- packages/server/package.json | 8 ++++---- packages/string-templates/package.json | 2 +- packages/worker/package.json | 6 +++--- 9 files changed, 19 insertions(+), 19 deletions(-) diff --git a/lerna.json b/lerna.json index 960c7fb249..42925e163b 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.0.42", + "version": "1.0.43", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index ef6e7354c5..ac5288687d 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "1.0.42", + "version": "1.0.43", "description": "Budibase backend core libraries used in server and worker", "main": "src/index.js", "author": "Budibase", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 3e0c504a9a..af9e518b7b 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/bbui", "description": "A UI solution used in the different Budibase projects.", - "version": "1.0.42", + "version": "1.0.43", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", diff --git a/packages/builder/package.json b/packages/builder/package.json index 07c3299066..189497dd73 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.0.42", + "version": "1.0.43", "license": "GPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^1.0.42", - "@budibase/client": "^1.0.42", + "@budibase/bbui": "^1.0.43", + "@budibase/client": "^1.0.43", "@budibase/colorpicker": "1.1.2", - "@budibase/string-templates": "^1.0.42", + "@budibase/string-templates": "^1.0.43", "@sentry/browser": "5.19.1", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/cli/package.json b/packages/cli/package.json index ee01a63b9d..5f3f2786bd 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "1.0.42", + "version": "1.0.43", "description": "Budibase CLI, for developers, self hosting and migrations.", "main": "src/index.js", "bin": { diff --git a/packages/client/package.json b/packages/client/package.json index c66e260ff2..aeafd8d1c3 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "1.0.42", + "version": "1.0.43", "license": "MPL-2.0", "module": "dist/budibase-client.js", "main": "dist/budibase-client.js", @@ -19,9 +19,9 @@ "dev:builder": "rollup -cw" }, "dependencies": { - "@budibase/bbui": "^1.0.42", + "@budibase/bbui": "^1.0.43", "@budibase/standard-components": "^0.9.139", - "@budibase/string-templates": "^1.0.42", + "@budibase/string-templates": "^1.0.43", "regexparam": "^1.3.0", "shortid": "^2.2.15", "svelte-spa-router": "^3.0.5" diff --git a/packages/server/package.json b/packages/server/package.json index df04080f5c..70904e148f 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "1.0.42", + "version": "1.0.43", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -70,9 +70,9 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "^10.0.3", - "@budibase/backend-core": "^1.0.42", - "@budibase/client": "^1.0.42", - "@budibase/string-templates": "^1.0.42", + "@budibase/backend-core": "^1.0.43", + "@budibase/client": "^1.0.43", + "@budibase/string-templates": "^1.0.43", "@bull-board/api": "^3.7.0", "@bull-board/koa": "^3.7.0", "@elastic/elasticsearch": "7.10.0", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index 48b232db77..e0bcd641c8 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "1.0.42", + "version": "1.0.43", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/worker/package.json b/packages/worker/package.json index 85f5e274e5..9c2238501d 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "1.0.42", + "version": "1.0.43", "description": "Budibase background service", "main": "src/index.js", "repository": { @@ -29,8 +29,8 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "^1.0.42", - "@budibase/string-templates": "^1.0.42", + "@budibase/backend-core": "^1.0.43", + "@budibase/string-templates": "^1.0.43", "@koa/router": "^8.0.0", "@sentry/node": "^6.0.0", "@techpass/passport-openidconnect": "^0.3.0", From 9b885d0207fa859a109f404b253fdb3056959433 Mon Sep 17 00:00:00 2001 From: Michael Drury Date: Tue, 18 Jan 2022 20:54:19 +0000 Subject: [PATCH 05/19] Quick fix for #4093 - make sure the App ID/App URL returned for deployed apps is always lowercase, as URLs are not case sensitive and should not be compared as such. --- packages/server/src/utilities/workerRequests.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/server/src/utilities/workerRequests.js b/packages/server/src/utilities/workerRequests.js index 92dffc8d3f..421b8c426e 100644 --- a/packages/server/src/utilities/workerRequests.js +++ b/packages/server/src/utilities/workerRequests.js @@ -71,7 +71,7 @@ exports.getDeployedApps = async () => { for (let [key, value] of Object.entries(json)) { if (value.url) { value.url = value.url.toLowerCase() - apps[key] = value + apps[key.toLowerCase()] = value } } return apps From 2eb6bef9f5255148c820c0b3b5d8d92db7c86a50 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Wed, 19 Jan 2022 10:13:22 +0000 Subject: [PATCH 06/19] v1.0.44 --- lerna.json | 2 +- packages/backend-core/package.json | 2 +- packages/bbui/package.json | 2 +- packages/builder/package.json | 8 ++++---- packages/cli/package.json | 2 +- packages/client/package.json | 6 +++--- packages/server/package.json | 8 ++++---- packages/string-templates/package.json | 2 +- packages/worker/package.json | 6 +++--- 9 files changed, 19 insertions(+), 19 deletions(-) diff --git a/lerna.json b/lerna.json index 42925e163b..ad778bd2cf 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.0.43", + "version": "1.0.44", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index ac5288687d..be37988678 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "1.0.43", + "version": "1.0.44", "description": "Budibase backend core libraries used in server and worker", "main": "src/index.js", "author": "Budibase", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index af9e518b7b..6d71fd3fbc 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/bbui", "description": "A UI solution used in the different Budibase projects.", - "version": "1.0.43", + "version": "1.0.44", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", diff --git a/packages/builder/package.json b/packages/builder/package.json index 189497dd73..c392fe39b8 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.0.43", + "version": "1.0.44", "license": "GPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^1.0.43", - "@budibase/client": "^1.0.43", + "@budibase/bbui": "^1.0.44", + "@budibase/client": "^1.0.44", "@budibase/colorpicker": "1.1.2", - "@budibase/string-templates": "^1.0.43", + "@budibase/string-templates": "^1.0.44", "@sentry/browser": "5.19.1", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/cli/package.json b/packages/cli/package.json index 5f3f2786bd..0af381d319 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "1.0.43", + "version": "1.0.44", "description": "Budibase CLI, for developers, self hosting and migrations.", "main": "src/index.js", "bin": { diff --git a/packages/client/package.json b/packages/client/package.json index aeafd8d1c3..f0639d8bb4 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "1.0.43", + "version": "1.0.44", "license": "MPL-2.0", "module": "dist/budibase-client.js", "main": "dist/budibase-client.js", @@ -19,9 +19,9 @@ "dev:builder": "rollup -cw" }, "dependencies": { - "@budibase/bbui": "^1.0.43", + "@budibase/bbui": "^1.0.44", "@budibase/standard-components": "^0.9.139", - "@budibase/string-templates": "^1.0.43", + "@budibase/string-templates": "^1.0.44", "regexparam": "^1.3.0", "shortid": "^2.2.15", "svelte-spa-router": "^3.0.5" diff --git a/packages/server/package.json b/packages/server/package.json index 70904e148f..6f721f84d8 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "1.0.43", + "version": "1.0.44", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -70,9 +70,9 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "^10.0.3", - "@budibase/backend-core": "^1.0.43", - "@budibase/client": "^1.0.43", - "@budibase/string-templates": "^1.0.43", + "@budibase/backend-core": "^1.0.44", + "@budibase/client": "^1.0.44", + "@budibase/string-templates": "^1.0.44", "@bull-board/api": "^3.7.0", "@bull-board/koa": "^3.7.0", "@elastic/elasticsearch": "7.10.0", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index e0bcd641c8..2a7d9d95bf 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "1.0.43", + "version": "1.0.44", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/worker/package.json b/packages/worker/package.json index 9c2238501d..78f9b1544b 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "1.0.43", + "version": "1.0.44", "description": "Budibase background service", "main": "src/index.js", "repository": { @@ -29,8 +29,8 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "^1.0.43", - "@budibase/string-templates": "^1.0.43", + "@budibase/backend-core": "^1.0.44", + "@budibase/string-templates": "^1.0.44", "@koa/router": "^8.0.0", "@sentry/node": "^6.0.0", "@techpass/passport-openidconnect": "^0.3.0", From 1975af430a728ff7b44068d12fbaad71299fe66f Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Thu, 20 Jan 2022 15:44:39 +0000 Subject: [PATCH 07/19] Fix for #4126 - wrong bindings were being passed to the drawer, making sure correct ones are available. --- .../src/components/integration/QueryBindingBuilder.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/builder/src/components/integration/QueryBindingBuilder.svelte b/packages/builder/src/components/integration/QueryBindingBuilder.svelte index dd688dceb6..3161e2ae48 100644 --- a/packages/builder/src/components/integration/QueryBindingBuilder.svelte +++ b/packages/builder/src/components/integration/QueryBindingBuilder.svelte @@ -72,7 +72,7 @@ bindableOptions, customParams?.[binding.name] )} - {bindableOptions} + bind:bindings={bindableOptions} /> {:else} deleteQueryBinding(idx)} /> From c6de0f3d306602c8bb53a0e8b0896f69f35fd665 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Thu, 20 Jan 2022 16:12:32 +0000 Subject: [PATCH 08/19] Renaming bindableOptions to bindings and replacing the query bindings variable with queryBindings. --- .../actions/ExecuteQuery.svelte | 4 ++-- .../PropertyControls/DataSourceSelect.svelte | 4 ++-- .../integration/QueryBindingBuilder.svelte | 21 +++++++++---------- .../components/integration/QueryViewer.svelte | 2 +- 4 files changed, 15 insertions(+), 16 deletions(-) diff --git a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ButtonActionEditor/actions/ExecuteQuery.svelte b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ButtonActionEditor/actions/ExecuteQuery.svelte index 88c7e87054..8c438e4b22 100644 --- a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ButtonActionEditor/actions/ExecuteQuery.svelte +++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/ButtonActionEditor/actions/ExecuteQuery.svelte @@ -55,8 +55,8 @@
0} {/if} @@ -49,7 +48,7 @@ {/if}
- {#each bindings as binding, idx} + {#each queryBindings as binding, idx} onBindingChange(binding.name, evt.detail)} value={runtimeToReadableBinding( - bindableOptions, + bindings, customParams?.[binding.name] )} - bind:bindings={bindableOptions} + {bindings} /> {:else} deleteQueryBinding(idx)} /> diff --git a/packages/builder/src/components/integration/QueryViewer.svelte b/packages/builder/src/components/integration/QueryViewer.svelte index f14d1d2b88..c6ae7c4ce8 100644 --- a/packages/builder/src/components/integration/QueryViewer.svelte +++ b/packages/builder/src/components/integration/QueryViewer.svelte @@ -120,7 +120,7 @@ config={integrationInfo.extra} /> {/if} - + {/if}
{#if shouldShowQueryConfig} From 38122eec327e124055adcbb89c456756c5e822d1 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Thu, 20 Jan 2022 16:33:40 +0000 Subject: [PATCH 09/19] v1.0.45 --- lerna.json | 2 +- packages/backend-core/package.json | 2 +- packages/bbui/package.json | 2 +- packages/builder/package.json | 8 ++++---- packages/cli/package.json | 2 +- packages/client/package.json | 6 +++--- packages/server/package.json | 8 ++++---- packages/string-templates/package.json | 2 +- packages/worker/package.json | 6 +++--- 9 files changed, 19 insertions(+), 19 deletions(-) diff --git a/lerna.json b/lerna.json index ad778bd2cf..bb128cb560 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.0.44", + "version": "1.0.45", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index be37988678..34fca88b3d 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "1.0.44", + "version": "1.0.45", "description": "Budibase backend core libraries used in server and worker", "main": "src/index.js", "author": "Budibase", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 6d71fd3fbc..ae19abe44d 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/bbui", "description": "A UI solution used in the different Budibase projects.", - "version": "1.0.44", + "version": "1.0.45", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", diff --git a/packages/builder/package.json b/packages/builder/package.json index c392fe39b8..e4b4b50740 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.0.44", + "version": "1.0.45", "license": "GPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^1.0.44", - "@budibase/client": "^1.0.44", + "@budibase/bbui": "^1.0.45", + "@budibase/client": "^1.0.45", "@budibase/colorpicker": "1.1.2", - "@budibase/string-templates": "^1.0.44", + "@budibase/string-templates": "^1.0.45", "@sentry/browser": "5.19.1", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/cli/package.json b/packages/cli/package.json index 0af381d319..32f7f01265 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "1.0.44", + "version": "1.0.45", "description": "Budibase CLI, for developers, self hosting and migrations.", "main": "src/index.js", "bin": { diff --git a/packages/client/package.json b/packages/client/package.json index f0639d8bb4..5ef6bd181d 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "1.0.44", + "version": "1.0.45", "license": "MPL-2.0", "module": "dist/budibase-client.js", "main": "dist/budibase-client.js", @@ -19,9 +19,9 @@ "dev:builder": "rollup -cw" }, "dependencies": { - "@budibase/bbui": "^1.0.44", + "@budibase/bbui": "^1.0.45", "@budibase/standard-components": "^0.9.139", - "@budibase/string-templates": "^1.0.44", + "@budibase/string-templates": "^1.0.45", "regexparam": "^1.3.0", "shortid": "^2.2.15", "svelte-spa-router": "^3.0.5" diff --git a/packages/server/package.json b/packages/server/package.json index 6f721f84d8..73d243abb2 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "1.0.44", + "version": "1.0.45", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -70,9 +70,9 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "^10.0.3", - "@budibase/backend-core": "^1.0.44", - "@budibase/client": "^1.0.44", - "@budibase/string-templates": "^1.0.44", + "@budibase/backend-core": "^1.0.45", + "@budibase/client": "^1.0.45", + "@budibase/string-templates": "^1.0.45", "@bull-board/api": "^3.7.0", "@bull-board/koa": "^3.7.0", "@elastic/elasticsearch": "7.10.0", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index 2a7d9d95bf..2f36a4a685 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "1.0.44", + "version": "1.0.45", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/worker/package.json b/packages/worker/package.json index 78f9b1544b..76bdec3873 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "1.0.44", + "version": "1.0.45", "description": "Budibase background service", "main": "src/index.js", "repository": { @@ -29,8 +29,8 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "^1.0.44", - "@budibase/string-templates": "^1.0.44", + "@budibase/backend-core": "^1.0.45", + "@budibase/string-templates": "^1.0.45", "@koa/router": "^8.0.0", "@sentry/node": "^6.0.0", "@techpass/passport-openidconnect": "^0.3.0", From ea6b2866095c2c9452bfd79c4d1c268a3b27dde3 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Thu, 20 Jan 2022 19:06:08 +0000 Subject: [PATCH 10/19] Fixing an issue where old apps did not send up the values of the default parameters, the server should be able to handle this, enrich them in if they aren't there. --- .../integration/QueryBindingBuilder.svelte | 2 -- .../server/src/api/controllers/query/index.js | 17 ++++++++++++++--- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/packages/builder/src/components/integration/QueryBindingBuilder.svelte b/packages/builder/src/components/integration/QueryBindingBuilder.svelte index 34d4d4219b..9bcf9d36f8 100644 --- a/packages/builder/src/components/integration/QueryBindingBuilder.svelte +++ b/packages/builder/src/components/integration/QueryBindingBuilder.svelte @@ -15,8 +15,6 @@ queryBindings = [...queryBindings, {}] } - $: console.log(bindings) - function deleteQueryBinding(idx) { queryBindings.splice(idx, 1) queryBindings = queryBindings diff --git a/packages/server/src/api/controllers/query/index.js b/packages/server/src/api/controllers/query/index.js index 21db1eebbf..9cf7612e8a 100644 --- a/packages/server/src/api/controllers/query/index.js +++ b/packages/server/src/api/controllers/query/index.js @@ -141,6 +141,16 @@ async function execute(ctx, opts = { rowsOnly: false }) { const query = await db.get(ctx.params.queryId) const datasource = await db.get(query.datasourceId) + const enrichedParameters = ctx.request.body.parameters || {} + // make sure parameters are fully enriched with defaults + if (query && query.parameters) { + for (let parameter of query.parameters) { + if (!enrichedParameters[parameter.name]) { + enrichedParameters[parameter.name] = parameter.default + } + } + } + // call the relevant CRUD method on the integration class try { const { rows, pagination, extra } = await Runner.run({ @@ -149,7 +159,7 @@ async function execute(ctx, opts = { rowsOnly: false }) { queryVerb: query.queryVerb, fields: query.fields, pagination: ctx.request.body.pagination, - parameters: ctx.request.body.parameters, + parameters: enrichedParameters, transformer: query.transformer, queryId: ctx.params.queryId, }) @@ -178,8 +188,9 @@ const removeDynamicVariables = async (db, queryId) => { if (dynamicVariables) { // delete dynamic variables from the datasource - const newVariables = dynamicVariables.filter(dv => dv.queryId !== queryId) - datasource.config.dynamicVariables = newVariables + datasource.config.dynamicVariables = dynamicVariables.filter( + dv => dv.queryId !== queryId + ) await db.put(datasource) // invalidate the deleted variables From 81479b18f3cfc3c7f4f1a6ab2fb3bc3decab7361 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Tue, 18 Jan 2022 13:19:41 +0000 Subject: [PATCH 11/19] Derive safe array-like value as the default value for multi-select fields --- .../components/app/forms/MultiFieldSelect.svelte | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/packages/client/src/components/app/forms/MultiFieldSelect.svelte b/packages/client/src/components/app/forms/MultiFieldSelect.svelte index cecc569b6f..d09a8730ae 100644 --- a/packages/client/src/components/app/forms/MultiFieldSelect.svelte +++ b/packages/client/src/components/app/forms/MultiFieldSelect.svelte @@ -19,6 +19,7 @@ let fieldApi let fieldSchema + $: safeDefaultValue = getSafeDefaultValue(defaultValue) $: flatOptions = optionsSource == null || optionsSource === "schema" $: options = getOptions( optionsSource, @@ -28,6 +29,16 @@ valueColumn, customOptions ) + + const getSafeDefaultValue = value => { + if (value == null || value === "") { + return [] + } + if (!Array.isArray(value)) { + return [value] + } + return value + } Date: Tue, 18 Jan 2022 13:20:06 +0000 Subject: [PATCH 12/19] Transform the output of JS expressions to be actual types rather than strings --- .../src/helpers/javascript.js | 6 ++- .../src/processors/postprocessor.js | 5 ++ .../string-templates/test/javascript.spec.js | 48 ++++++++++++++++++- 3 files changed, 56 insertions(+), 3 deletions(-) diff --git a/packages/string-templates/src/helpers/javascript.js b/packages/string-templates/src/helpers/javascript.js index 9231283e89..0173be0b54 100644 --- a/packages/string-templates/src/helpers/javascript.js +++ b/packages/string-templates/src/helpers/javascript.js @@ -1,5 +1,6 @@ const { atob } = require("../utilities") const { cloneDeep } = require("lodash/fp") +const { LITERAL_MARKER } = require("../helpers/constants") // The method of executing JS scripts depends on the bundle being built. // This setter is used in the entrypoint (either index.cjs or index.mjs). @@ -46,8 +47,9 @@ module.exports.processJS = (handlebars, context) => { $: path => getContextValue(path, cloneDeep(context)), } - // Create a sandbox with out context and run the JS - return runJS(js, sandboxContext) + // Create a sandbox with our context and run the JS + const res = { data: runJS(js, sandboxContext) } + return `{{${LITERAL_MARKER} js_result-${JSON.stringify(res)}}}` } catch (error) { return "Error while executing JS" } diff --git a/packages/string-templates/src/processors/postprocessor.js b/packages/string-templates/src/processors/postprocessor.js index 4d1c84013a..7fc3f663fe 100644 --- a/packages/string-templates/src/processors/postprocessor.js +++ b/packages/string-templates/src/processors/postprocessor.js @@ -36,6 +36,11 @@ module.exports.processors = [ return value === "true" case "object": return JSON.parse(value) + case "js_result": + // We use the literal helper to process the result of JS expressions + // as we want to be able to return any types. + // We wrap the value in an abject to be able to use undefined properly. + return JSON.parse(value).data } return value }), diff --git a/packages/string-templates/test/javascript.spec.js b/packages/string-templates/test/javascript.spec.js index 05cc80331a..5363f37e02 100644 --- a/packages/string-templates/test/javascript.spec.js +++ b/packages/string-templates/test/javascript.spec.js @@ -7,7 +7,7 @@ const processJS = (js, context) => { describe("Test the JavaScript helper", () => { it("should execute a simple expression", () => { const output = processJS(`return 1 + 2`) - expect(output).toBe("3") + expect(output).toBe(3) }) it("should be able to use primitive bindings", () => { @@ -50,6 +50,52 @@ describe("Test the JavaScript helper", () => { expect(output).toBe("shazbat") }) + it("should be able to return an object", () => { + const output = processJS(`return $("foo")`, { + foo: { + bar: { + baz: "shazbat", + }, + }, + }) + expect(output.bar.baz).toBe("shazbat") + }) + + it("should be able to return an array", () => { + const output = processJS(`return $("foo")`, { + foo: ["a", "b", "c"], + }) + expect(output[2]).toBe("c") + }) + + it("should be able to return null", () => { + const output = processJS(`return $("foo")`, { + foo: null, + }) + expect(output).toBe(null) + }) + + it("should be able to return undefined", () => { + const output = processJS(`return $("foo")`, { + foo: undefined, + }) + expect(output).toBe(undefined) + }) + + it("should be able to return 0", () => { + const output = processJS(`return $("foo")`, { + foo: 0, + }) + expect(output).toBe(0) + }) + + it("should be able to return an empty string", () => { + const output = processJS(`return $("foo")`, { + foo: "", + }) + expect(output).toBe("") + }) + it("should be able to use a deep array binding", () => { const output = processJS(`return $("foo.0.bar")`, { foo: [ From 124d6680418cfa23b79eb4168e490f7d1d3b5f89 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Tue, 18 Jan 2022 13:20:28 +0000 Subject: [PATCH 13/19] Fix issue with array field validation --- .../server/src/api/controllers/row/utils.js | 28 ++++++++++++------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/packages/server/src/api/controllers/row/utils.js b/packages/server/src/api/controllers/row/utils.js index 71b22375f7..e18aee582f 100644 --- a/packages/server/src/api/controllers/row/utils.js +++ b/packages/server/src/api/controllers/row/utils.js @@ -52,21 +52,29 @@ exports.validate = async ({ appId, tableId, row, table }) => { const constraints = cloneDeep(table.schema[fieldName].constraints) const type = table.schema[fieldName].type // special case for options, need to always allow unselected (null) - if ( - (type === FieldTypes.OPTIONS || type === FieldTypes.ARRAY) && - constraints.inclusion - ) { + if (type === FieldTypes.OPTIONS && constraints.inclusion) { constraints.inclusion.push(null) } let res // Validate.js doesn't seem to handle array - if (type === FieldTypes.ARRAY && row[fieldName] && row[fieldName].length) { - row[fieldName].map(val => { - if (!constraints.inclusion.includes(val)) { - errors[fieldName] = "Field not in list" - } - }) + if (type === FieldTypes.ARRAY) { + const hasValues = + Array.isArray(row[fieldName]) && row[fieldName].length > 0 + + // Check values are valid if values are specified + if (hasValues) { + row[fieldName].map(val => { + if (!constraints.inclusion.includes(val)) { + errors[fieldName] = "Value not in list" + } + }) + } + + // Check for required constraint + if (constraints.presence === true && !hasValues) { + errors[fieldName] = "Required field" + } } else if (type === FieldTypes.JSON && typeof row[fieldName] === "string") { // this should only happen if there is an error try { From db56a64805c21a101da90426fb1290204328cc92 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Tue, 18 Jan 2022 15:25:43 +0000 Subject: [PATCH 14/19] Revert changes to MultiFieldSelect --- .../components/app/forms/MultiFieldSelect.svelte | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/packages/client/src/components/app/forms/MultiFieldSelect.svelte b/packages/client/src/components/app/forms/MultiFieldSelect.svelte index d09a8730ae..cecc569b6f 100644 --- a/packages/client/src/components/app/forms/MultiFieldSelect.svelte +++ b/packages/client/src/components/app/forms/MultiFieldSelect.svelte @@ -19,7 +19,6 @@ let fieldApi let fieldSchema - $: safeDefaultValue = getSafeDefaultValue(defaultValue) $: flatOptions = optionsSource == null || optionsSource === "schema" $: options = getOptions( optionsSource, @@ -29,16 +28,6 @@ valueColumn, customOptions ) - - const getSafeDefaultValue = value => { - if (value == null || value === "") { - return [] - } - if (!Array.isArray(value)) { - return [value] - } - return value - } Date: Tue, 18 Jan 2022 15:34:10 +0000 Subject: [PATCH 15/19] Fix data fetch for nested providers, JSON arrays or array fields not working --- packages/client/src/utils/fetch/DataFetch.js | 6 ------ 1 file changed, 6 deletions(-) diff --git a/packages/client/src/utils/fetch/DataFetch.js b/packages/client/src/utils/fetch/DataFetch.js index 2333991ac9..90808026d5 100644 --- a/packages/client/src/utils/fetch/DataFetch.js +++ b/packages/client/src/utils/fetch/DataFetch.js @@ -111,12 +111,6 @@ export default class DataFetch { */ async getInitialData() { const { datasource, filter, sortColumn, paginate } = this.options - const tableId = datasource?.tableId - - // Ensure table ID exists - if (!tableId) { - return - } // Fetch datasource definition and determine feature flags const definition = await this.constructor.getDefinition(datasource) From 45142ba9166049c1434a2e6e6eed32b2e88ba7da Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Thu, 20 Jan 2022 19:37:01 +0000 Subject: [PATCH 16/19] Update {{ now }} HBS helper to floor to the second instead of millisecond --- packages/string-templates/src/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/string-templates/src/index.js b/packages/string-templates/src/index.js index 820b8da290..d824d5f1db 100644 --- a/packages/string-templates/src/index.js +++ b/packages/string-templates/src/index.js @@ -112,9 +112,10 @@ module.exports.processStringSync = (string, context, opts) => { const template = instance.compile(string, { strict: false, }) + const now = Math.floor(Date.now() / 1000) * 1000 return processors.postprocess( template({ - now: new Date().toISOString(), + now: new Date(now).toISOString(), ...context, }) ) From 927310c812a560ce7b575f585c6695e04e39ba72 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Thu, 20 Jan 2022 19:58:40 +0000 Subject: [PATCH 17/19] v1.0.46 --- lerna.json | 2 +- packages/backend-core/package.json | 2 +- packages/bbui/package.json | 2 +- packages/builder/package.json | 8 ++++---- packages/cli/package.json | 2 +- packages/client/package.json | 6 +++--- packages/server/package.json | 8 ++++---- packages/string-templates/package.json | 2 +- packages/worker/package.json | 6 +++--- 9 files changed, 19 insertions(+), 19 deletions(-) diff --git a/lerna.json b/lerna.json index bb128cb560..7663789a6d 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.0.45", + "version": "1.0.46", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index 34fca88b3d..d0eb047164 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "1.0.45", + "version": "1.0.46", "description": "Budibase backend core libraries used in server and worker", "main": "src/index.js", "author": "Budibase", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index ae19abe44d..4812c128ec 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/bbui", "description": "A UI solution used in the different Budibase projects.", - "version": "1.0.45", + "version": "1.0.46", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", diff --git a/packages/builder/package.json b/packages/builder/package.json index e4b4b50740..418d7b5510 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.0.45", + "version": "1.0.46", "license": "GPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^1.0.45", - "@budibase/client": "^1.0.45", + "@budibase/bbui": "^1.0.46", + "@budibase/client": "^1.0.46", "@budibase/colorpicker": "1.1.2", - "@budibase/string-templates": "^1.0.45", + "@budibase/string-templates": "^1.0.46", "@sentry/browser": "5.19.1", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/cli/package.json b/packages/cli/package.json index 32f7f01265..e7469771c5 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "1.0.45", + "version": "1.0.46", "description": "Budibase CLI, for developers, self hosting and migrations.", "main": "src/index.js", "bin": { diff --git a/packages/client/package.json b/packages/client/package.json index 5ef6bd181d..fe4f04510d 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "1.0.45", + "version": "1.0.46", "license": "MPL-2.0", "module": "dist/budibase-client.js", "main": "dist/budibase-client.js", @@ -19,9 +19,9 @@ "dev:builder": "rollup -cw" }, "dependencies": { - "@budibase/bbui": "^1.0.45", + "@budibase/bbui": "^1.0.46", "@budibase/standard-components": "^0.9.139", - "@budibase/string-templates": "^1.0.45", + "@budibase/string-templates": "^1.0.46", "regexparam": "^1.3.0", "shortid": "^2.2.15", "svelte-spa-router": "^3.0.5" diff --git a/packages/server/package.json b/packages/server/package.json index 73d243abb2..1a8851a071 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "1.0.45", + "version": "1.0.46", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -70,9 +70,9 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "^10.0.3", - "@budibase/backend-core": "^1.0.45", - "@budibase/client": "^1.0.45", - "@budibase/string-templates": "^1.0.45", + "@budibase/backend-core": "^1.0.46", + "@budibase/client": "^1.0.46", + "@budibase/string-templates": "^1.0.46", "@bull-board/api": "^3.7.0", "@bull-board/koa": "^3.7.0", "@elastic/elasticsearch": "7.10.0", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index 2f36a4a685..b75fa633e3 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "1.0.45", + "version": "1.0.46", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/worker/package.json b/packages/worker/package.json index 76bdec3873..44f45fa03e 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "1.0.45", + "version": "1.0.46", "description": "Budibase background service", "main": "src/index.js", "repository": { @@ -29,8 +29,8 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "^1.0.45", - "@budibase/string-templates": "^1.0.45", + "@budibase/backend-core": "^1.0.46", + "@budibase/string-templates": "^1.0.46", "@koa/router": "^8.0.0", "@sentry/node": "^6.0.0", "@techpass/passport-openidconnect": "^0.3.0", From b22f1f54a0a098ac93f73803196306639d8b16f6 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 21 Jan 2022 13:32:56 +0000 Subject: [PATCH 18/19] Fix rare issue which could occur when enriching component props twice before an initial render has taken place --- .../client/src/components/Component.svelte | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/packages/client/src/components/Component.svelte b/packages/client/src/components/Component.svelte index d05f01f58a..8cd1849336 100644 --- a/packages/client/src/components/Component.svelte +++ b/packages/client/src/components/Component.svelte @@ -276,27 +276,29 @@ // reactive statements as much as possible. const cacheSettings = (enriched, nested, conditional) => { const allSettings = { ...enriched, ...nested, ...conditional } - if (!cachedSettings) { + const mounted = ref?.$$set != null + if (!cachedSettings || !mounted) { cachedSettings = { ...allSettings } initialSettings = cachedSettings } else { Object.keys(allSettings).forEach(key => { const same = propsAreSame(allSettings[key], cachedSettings[key]) if (!same) { + // Updated cachedSettings (which is assigned by reference to + // initialSettings) so that if we remount the component then the + // initial props are up to date. By setting it this way rather than + // setting it on initialSettings directly, we avoid a double render. cachedSettings[key] = allSettings[key] - assignSetting(key, allSettings[key]) + + // Programmatically set the prop to avoid svelte reactive statements + // firing inside components. This circumvents the problems caused by + // spreading a props object. + ref.$$set({ [key]: allSettings[key] }) } }) } } - // Assigns a certain setting to this component. - // We manually use the svelte $set function to avoid triggering additional - // reactive statements. - const assignSetting = (key, value) => { - ref?.$$set?.({ [key]: value }) - } - // Generates a key used to determine when components need to fully remount. // Currently only toggling editing requires remounting. const getRenderKey = (id, editing) => { @@ -305,7 +307,7 @@ {#key renderKey} - {#if constructor && cachedSettings && (visible || inSelectedPath)} + {#if constructor && initialSettings && (visible || inSelectedPath)}
Date: Mon, 24 Jan 2022 15:48:12 +0000 Subject: [PATCH 19/19] v1.0.47 --- lerna.json | 2 +- packages/backend-core/package.json | 2 +- packages/bbui/package.json | 2 +- packages/builder/package.json | 8 ++++---- packages/cli/package.json | 2 +- packages/client/package.json | 6 +++--- packages/server/package.json | 8 ++++---- packages/string-templates/package.json | 2 +- packages/worker/package.json | 6 +++--- 9 files changed, 19 insertions(+), 19 deletions(-) diff --git a/lerna.json b/lerna.json index 7663789a6d..7899c71f2d 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.0.46", + "version": "1.0.47", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index d0eb047164..ef49cd6307 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "1.0.46", + "version": "1.0.47", "description": "Budibase backend core libraries used in server and worker", "main": "src/index.js", "author": "Budibase", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 4812c128ec..04a8d2e522 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/bbui", "description": "A UI solution used in the different Budibase projects.", - "version": "1.0.46", + "version": "1.0.47", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", diff --git a/packages/builder/package.json b/packages/builder/package.json index 418d7b5510..1d4e37c665 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.0.46", + "version": "1.0.47", "license": "GPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^1.0.46", - "@budibase/client": "^1.0.46", + "@budibase/bbui": "^1.0.47", + "@budibase/client": "^1.0.47", "@budibase/colorpicker": "1.1.2", - "@budibase/string-templates": "^1.0.46", + "@budibase/string-templates": "^1.0.47", "@sentry/browser": "5.19.1", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/cli/package.json b/packages/cli/package.json index e7469771c5..b101ff94a1 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "1.0.46", + "version": "1.0.47", "description": "Budibase CLI, for developers, self hosting and migrations.", "main": "src/index.js", "bin": { diff --git a/packages/client/package.json b/packages/client/package.json index fe4f04510d..a8000503af 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "1.0.46", + "version": "1.0.47", "license": "MPL-2.0", "module": "dist/budibase-client.js", "main": "dist/budibase-client.js", @@ -19,9 +19,9 @@ "dev:builder": "rollup -cw" }, "dependencies": { - "@budibase/bbui": "^1.0.46", + "@budibase/bbui": "^1.0.47", "@budibase/standard-components": "^0.9.139", - "@budibase/string-templates": "^1.0.46", + "@budibase/string-templates": "^1.0.47", "regexparam": "^1.3.0", "shortid": "^2.2.15", "svelte-spa-router": "^3.0.5" diff --git a/packages/server/package.json b/packages/server/package.json index 1a8851a071..477c45fc4a 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "1.0.46", + "version": "1.0.47", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -70,9 +70,9 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "^10.0.3", - "@budibase/backend-core": "^1.0.46", - "@budibase/client": "^1.0.46", - "@budibase/string-templates": "^1.0.46", + "@budibase/backend-core": "^1.0.47", + "@budibase/client": "^1.0.47", + "@budibase/string-templates": "^1.0.47", "@bull-board/api": "^3.7.0", "@bull-board/koa": "^3.7.0", "@elastic/elasticsearch": "7.10.0", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index b75fa633e3..69e91740a2 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "1.0.46", + "version": "1.0.47", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/worker/package.json b/packages/worker/package.json index 44f45fa03e..1cbc0cb246 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "1.0.46", + "version": "1.0.47", "description": "Budibase background service", "main": "src/index.js", "repository": { @@ -29,8 +29,8 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "^1.0.46", - "@budibase/string-templates": "^1.0.46", + "@budibase/backend-core": "^1.0.47", + "@budibase/string-templates": "^1.0.47", "@koa/router": "^8.0.0", "@sentry/node": "^6.0.0", "@techpass/passport-openidconnect": "^0.3.0",