From 035cda117761aaffe556f209de9331495fda3584 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Mon, 4 Apr 2022 15:39:38 +0100 Subject: [PATCH 001/129] Extension of fix for 4978 - fixing an issue where parentheses are added to the IN query, causing the query system to not recognise the need to switch out the binding. --- packages/server/src/threads/query.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/packages/server/src/threads/query.js b/packages/server/src/threads/query.js index 270c2cc713..aee3ddb205 100644 --- a/packages/server/src/threads/query.js +++ b/packages/server/src/threads/query.js @@ -37,7 +37,7 @@ class QueryRunner { arrays = [] for (let binding of bindings) { // look for array/list operations in the SQL statement, which will need handled later - const listRegex = new RegExp(`(in|IN|In|iN)( )+${binding}`) + const listRegex = new RegExp(`(in|IN|In|iN)( )+[(]?${binding}[)]?`) const listRegexMatch = sql.match(listRegex) // check if the variable was used as part of a string concat e.g. 'Hello {{binding}}' const charConstRegex = new RegExp(`'[^']*${binding}[^']*'`) @@ -63,12 +63,14 @@ class QueryRunner { "," ) // build a string like ($1, $2, $3) - sql = sql.replace( - binding, - `(${Array.apply(null, Array(value.length)) - .map(() => integration.getBindingIdentifier()) - .join(",")})` - ) + let replacement = `${Array.apply(null, Array(value.length)) + .map(() => integration.getBindingIdentifier()) + .join(",")}` + // check if parentheses are needed + if (!listRegexMatch[0].includes(`(${binding})`)) { + replacement = `(${replacement})` + } + sql = sql.replace(binding, replacement) } else { sql = sql.replace(binding, integration.getBindingIdentifier()) } From 4d084383f3def3481a88152e019b2d0bfb8c31c9 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Mon, 4 Apr 2022 19:08:56 +0100 Subject: [PATCH 002/129] Fix for #5242 - string interpolation in SQL queries was too wide, it was combining parts of multiple strings, rather than searching for bindings within distinct strings. --- packages/server/src/threads/query.js | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/packages/server/src/threads/query.js b/packages/server/src/threads/query.js index aee3ddb205..d6089567b8 100644 --- a/packages/server/src/threads/query.js +++ b/packages/server/src/threads/query.js @@ -9,6 +9,8 @@ const { const { doInAppContext, getAppDB } = require("@budibase/backend-core/context") const { isSQL } = require("../integrations/utils") +const CONST_CHAR_REGEX = new RegExp("'[^']*'", "g") + class QueryRunner { constructor(input, flags = { noRecursiveQuery: false }) { this.datasource = input.datasource @@ -37,17 +39,22 @@ class QueryRunner { arrays = [] for (let binding of bindings) { // look for array/list operations in the SQL statement, which will need handled later - const listRegex = new RegExp(`(in|IN|In|iN)( )+[(]?${binding}[)]?`) - const listRegexMatch = sql.match(listRegex) + const listRegexMatch = sql.match( + new RegExp(`(in|IN|In|iN)( )+[(]?${binding}[)]?`) + ) // check if the variable was used as part of a string concat e.g. 'Hello {{binding}}' - const charConstRegex = new RegExp(`'[^']*${binding}[^']*'`) - const charConstMatch = sql.match(charConstRegex) - if (charConstMatch) { - let [part1, part2] = charConstMatch[0].split(binding) + // start by finding all the instances of const character strings + const charConstMatch = sql.match(CONST_CHAR_REGEX) || [] + // now look within them to see if a binding is used + const charConstBindingMatch = charConstMatch.find(string => + string.match(new RegExp(`'[^']*${binding}[^']*'`)) + ) + if (charConstBindingMatch) { + let [part1, part2] = charConstBindingMatch.split(binding) part1 = `'${part1.substring(1)}'` part2 = `'${part2.substring(0, part2.length - 1)}'` sql = sql.replace( - charConstMatch[0], + charConstBindingMatch, integration.getStringConcat([ part1, integration.getBindingIdentifier(), From 6840d8d166a9ae686575d3b30e4fd7b4604eb650 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Tue, 5 Apr 2022 11:16:17 +0000 Subject: [PATCH 003/129] v1.0.105 --- lerna.json | 2 +- packages/backend-core/package.json | 2 +- packages/bbui/package.json | 4 ++-- packages/builder/package.json | 10 +++++----- packages/cli/package.json | 2 +- packages/client/package.json | 8 ++++---- packages/frontend-core/package.json | 4 ++-- packages/server/package.json | 8 ++++---- packages/string-templates/package.json | 2 +- packages/worker/package.json | 6 +++--- 10 files changed, 24 insertions(+), 24 deletions(-) diff --git a/lerna.json b/lerna.json index db7d9fbb21..58a35fcca6 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.0.105-alpha.0", + "version": "1.0.105", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index 5289b10107..6c48b8f9ae 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "1.0.105-alpha.0", + "version": "1.0.105", "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 5a636355c0..069a539a76 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/bbui", "description": "A UI solution used in the different Budibase projects.", - "version": "1.0.105-alpha.0", + "version": "1.0.105", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", @@ -38,7 +38,7 @@ ], "dependencies": { "@adobe/spectrum-css-workflow-icons": "^1.2.1", - "@budibase/string-templates": "^1.0.105-alpha.0", + "@budibase/string-templates": "^1.0.105", "@spectrum-css/actionbutton": "^1.0.1", "@spectrum-css/actiongroup": "^1.0.1", "@spectrum-css/avatar": "^3.0.2", diff --git a/packages/builder/package.json b/packages/builder/package.json index af18e31000..65e02fb012 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.0.105-alpha.0", + "version": "1.0.105", "license": "GPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^1.0.105-alpha.0", - "@budibase/client": "^1.0.105-alpha.0", - "@budibase/frontend-core": "^1.0.105-alpha.0", - "@budibase/string-templates": "^1.0.105-alpha.0", + "@budibase/bbui": "^1.0.105", + "@budibase/client": "^1.0.105", + "@budibase/frontend-core": "^1.0.105", + "@budibase/string-templates": "^1.0.105", "@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 de641d371c..a329ba3cb5 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "1.0.105-alpha.0", + "version": "1.0.105", "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 d6b05b10f9..59106632b0 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "1.0.105-alpha.0", + "version": "1.0.105", "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.105-alpha.0", - "@budibase/frontend-core": "^1.0.105-alpha.0", - "@budibase/string-templates": "^1.0.105-alpha.0", + "@budibase/bbui": "^1.0.105", + "@budibase/frontend-core": "^1.0.105", + "@budibase/string-templates": "^1.0.105", "@spectrum-css/button": "^3.0.3", "@spectrum-css/card": "^3.0.3", "@spectrum-css/divider": "^1.0.3", diff --git a/packages/frontend-core/package.json b/packages/frontend-core/package.json index b30a0ec2cb..28332de724 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "1.0.105-alpha.0", + "version": "1.0.105", "description": "Budibase frontend core libraries used in builder and client", "author": "Budibase", "license": "MPL-2.0", "svelte": "src/index.js", "dependencies": { - "@budibase/bbui": "^1.0.105-alpha.0", + "@budibase/bbui": "^1.0.105", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/server/package.json b/packages/server/package.json index cfcba8059c..7fda53da5f 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.105-alpha.0", + "version": "1.0.105", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -68,9 +68,9 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "^10.0.3", - "@budibase/backend-core": "^1.0.105-alpha.0", - "@budibase/client": "^1.0.105-alpha.0", - "@budibase/string-templates": "^1.0.105-alpha.0", + "@budibase/backend-core": "^1.0.105", + "@budibase/client": "^1.0.105", + "@budibase/string-templates": "^1.0.105", "@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 399488bc72..91e6f30659 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "1.0.105-alpha.0", + "version": "1.0.105", "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 67ff3c8942..861ed842f7 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.105-alpha.0", + "version": "1.0.105", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -31,8 +31,8 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "^1.0.105-alpha.0", - "@budibase/string-templates": "^1.0.105-alpha.0", + "@budibase/backend-core": "^1.0.105", + "@budibase/string-templates": "^1.0.105", "@koa/router": "^8.0.0", "@sentry/node": "^6.0.0", "@techpass/passport-openidconnect": "^0.3.0", From b9bf678770e81fedbce592ed3361a20e3834302c Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Tue, 5 Apr 2022 13:38:48 +0000 Subject: [PATCH 004/129] v1.0.106 --- lerna.json | 2 +- packages/backend-core/package.json | 2 +- packages/bbui/package.json | 4 ++-- packages/builder/package.json | 10 +++++----- packages/cli/package.json | 2 +- packages/client/package.json | 8 ++++---- packages/frontend-core/package.json | 4 ++-- packages/server/package.json | 8 ++++---- packages/string-templates/package.json | 2 +- packages/worker/package.json | 6 +++--- 10 files changed, 24 insertions(+), 24 deletions(-) diff --git a/lerna.json b/lerna.json index 58a35fcca6..7b641ea9a8 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.0.105", + "version": "1.0.106", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index 6c48b8f9ae..8b253b1162 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "1.0.105", + "version": "1.0.106", "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 069a539a76..3bcaa549f9 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/bbui", "description": "A UI solution used in the different Budibase projects.", - "version": "1.0.105", + "version": "1.0.106", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", @@ -38,7 +38,7 @@ ], "dependencies": { "@adobe/spectrum-css-workflow-icons": "^1.2.1", - "@budibase/string-templates": "^1.0.105", + "@budibase/string-templates": "^1.0.106", "@spectrum-css/actionbutton": "^1.0.1", "@spectrum-css/actiongroup": "^1.0.1", "@spectrum-css/avatar": "^3.0.2", diff --git a/packages/builder/package.json b/packages/builder/package.json index 65e02fb012..69d111859e 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.0.105", + "version": "1.0.106", "license": "GPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^1.0.105", - "@budibase/client": "^1.0.105", - "@budibase/frontend-core": "^1.0.105", - "@budibase/string-templates": "^1.0.105", + "@budibase/bbui": "^1.0.106", + "@budibase/client": "^1.0.106", + "@budibase/frontend-core": "^1.0.106", + "@budibase/string-templates": "^1.0.106", "@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 a329ba3cb5..f5dd335da0 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "1.0.105", + "version": "1.0.106", "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 59106632b0..ae05385d3e 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "1.0.105", + "version": "1.0.106", "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.105", - "@budibase/frontend-core": "^1.0.105", - "@budibase/string-templates": "^1.0.105", + "@budibase/bbui": "^1.0.106", + "@budibase/frontend-core": "^1.0.106", + "@budibase/string-templates": "^1.0.106", "@spectrum-css/button": "^3.0.3", "@spectrum-css/card": "^3.0.3", "@spectrum-css/divider": "^1.0.3", diff --git a/packages/frontend-core/package.json b/packages/frontend-core/package.json index 28332de724..3162949b40 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "1.0.105", + "version": "1.0.106", "description": "Budibase frontend core libraries used in builder and client", "author": "Budibase", "license": "MPL-2.0", "svelte": "src/index.js", "dependencies": { - "@budibase/bbui": "^1.0.105", + "@budibase/bbui": "^1.0.106", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/server/package.json b/packages/server/package.json index 7fda53da5f..06cbe22d83 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.105", + "version": "1.0.106", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -68,9 +68,9 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "^10.0.3", - "@budibase/backend-core": "^1.0.105", - "@budibase/client": "^1.0.105", - "@budibase/string-templates": "^1.0.105", + "@budibase/backend-core": "^1.0.106", + "@budibase/client": "^1.0.106", + "@budibase/string-templates": "^1.0.106", "@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 91e6f30659..4bd3901719 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "1.0.105", + "version": "1.0.106", "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 861ed842f7..b172fef4fc 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.105", + "version": "1.0.106", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -31,8 +31,8 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "^1.0.105", - "@budibase/string-templates": "^1.0.105", + "@budibase/backend-core": "^1.0.106", + "@budibase/string-templates": "^1.0.106", "@koa/router": "^8.0.0", "@sentry/node": "^6.0.0", "@techpass/passport-openidconnect": "^0.3.0", From 3c3be6678623a992becb79d54afbd15aaa0bb1bd Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Wed, 6 Apr 2022 08:16:24 +0100 Subject: [PATCH 005/129] Don't show an error for the endpoint --- packages/client/src/api/api.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/client/src/api/api.js b/packages/client/src/api/api.js index 591d4a6782..35730ac9b7 100644 --- a/packages/client/src/api/api.js +++ b/packages/client/src/api/api.js @@ -28,6 +28,7 @@ export const API = createAPIClient({ // Or we could check error.status and redirect to login on a 403 etc. onError: error => { const { status, method, url, message, handled } = error || {} + const ignoreErrorUrls = ["analytics", "/api/global/self"] // Log any errors that we haven't manually handled if (!handled) { @@ -39,7 +40,14 @@ export const API = createAPIClient({ if (message) { // Don't notify if the URL contains the word analytics as it may be // blocked by browser extensions - if (!url?.includes("analytics")) { + let ignore = false + for (let ignoreUrl of ignoreErrorUrls) { + if (url?.includes(ignoreUrl)) { + ignore = true + break + } + } + if (!ignore) { notificationStore.actions.error(message) } } From dbb81d9c1a8aacd11af999887560e342e76ea5ab Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Wed, 6 Apr 2022 10:43:08 +0100 Subject: [PATCH 006/129] configure bash step to use automation query timeout --- packages/server/src/automations/steps/bash.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/server/src/automations/steps/bash.js b/packages/server/src/automations/steps/bash.js index 1d3c22fd0e..efa4295e35 100644 --- a/packages/server/src/automations/steps/bash.js +++ b/packages/server/src/automations/steps/bash.js @@ -1,6 +1,7 @@ const { execSync } = require("child_process") const { processStringSync } = require("@budibase/string-templates") const automationUtils = require("../automationUtils") +const environment = require("../../environment") exports.definition = { name: "Bash Scripting", @@ -51,7 +52,9 @@ exports.run = async function ({ inputs, context }) { let stdout, success = true try { - stdout = execSync(command, { timeout: 500 }).toString() + stdout = execSync(command, { + timeout: environment.QUERY_THREAD_TIMEOUT || 500, + }).toString() } catch (err) { stdout = err.message success = false From d1ea717bdd8337e40a62dc5349c6da1c4c172fb8 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Wed, 6 Apr 2022 09:48:21 +0000 Subject: [PATCH 007/129] v1.0.107 --- lerna.json | 2 +- packages/backend-core/package.json | 2 +- packages/bbui/package.json | 4 ++-- packages/builder/package.json | 10 +++++----- packages/cli/package.json | 2 +- packages/client/package.json | 8 ++++---- packages/frontend-core/package.json | 4 ++-- packages/server/package.json | 8 ++++---- packages/string-templates/package.json | 2 +- packages/worker/package.json | 6 +++--- 10 files changed, 24 insertions(+), 24 deletions(-) diff --git a/lerna.json b/lerna.json index 7b641ea9a8..11cd10c009 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.0.106", + "version": "1.0.107", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index 8b253b1162..a1b63e8c30 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "1.0.106", + "version": "1.0.107", "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 3bcaa549f9..cce726b82f 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.106", + "version": "1.0.107", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", @@ -38,7 +38,7 @@ ], "dependencies": { "@adobe/spectrum-css-workflow-icons": "^1.2.1", - "@budibase/string-templates": "^1.0.106", + "@budibase/string-templates": "^1.0.107", "@spectrum-css/actionbutton": "^1.0.1", "@spectrum-css/actiongroup": "^1.0.1", "@spectrum-css/avatar": "^3.0.2", diff --git a/packages/builder/package.json b/packages/builder/package.json index 69d111859e..b546f41f3a 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.0.106", + "version": "1.0.107", "license": "GPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^1.0.106", - "@budibase/client": "^1.0.106", - "@budibase/frontend-core": "^1.0.106", - "@budibase/string-templates": "^1.0.106", + "@budibase/bbui": "^1.0.107", + "@budibase/client": "^1.0.107", + "@budibase/frontend-core": "^1.0.107", + "@budibase/string-templates": "^1.0.107", "@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 f5dd335da0..9d93d7edf9 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "1.0.106", + "version": "1.0.107", "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 ae05385d3e..75dad5e9b0 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "1.0.106", + "version": "1.0.107", "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.106", - "@budibase/frontend-core": "^1.0.106", - "@budibase/string-templates": "^1.0.106", + "@budibase/bbui": "^1.0.107", + "@budibase/frontend-core": "^1.0.107", + "@budibase/string-templates": "^1.0.107", "@spectrum-css/button": "^3.0.3", "@spectrum-css/card": "^3.0.3", "@spectrum-css/divider": "^1.0.3", diff --git a/packages/frontend-core/package.json b/packages/frontend-core/package.json index 3162949b40..22e0214924 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "1.0.106", + "version": "1.0.107", "description": "Budibase frontend core libraries used in builder and client", "author": "Budibase", "license": "MPL-2.0", "svelte": "src/index.js", "dependencies": { - "@budibase/bbui": "^1.0.106", + "@budibase/bbui": "^1.0.107", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/server/package.json b/packages/server/package.json index 06cbe22d83..59177f6035 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.106", + "version": "1.0.107", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -68,9 +68,9 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "^10.0.3", - "@budibase/backend-core": "^1.0.106", - "@budibase/client": "^1.0.106", - "@budibase/string-templates": "^1.0.106", + "@budibase/backend-core": "^1.0.107", + "@budibase/client": "^1.0.107", + "@budibase/string-templates": "^1.0.107", "@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 4bd3901719..f4b0d8e8e1 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "1.0.106", + "version": "1.0.107", "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 b172fef4fc..dc9fcd1302 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.106", + "version": "1.0.107", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -31,8 +31,8 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "^1.0.106", - "@budibase/string-templates": "^1.0.106", + "@budibase/backend-core": "^1.0.107", + "@budibase/string-templates": "^1.0.107", "@koa/router": "^8.0.0", "@sentry/node": "^6.0.0", "@techpass/passport-openidconnect": "^0.3.0", From 496b582538903a1027906975fac16681f5c58f78 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Wed, 6 Apr 2022 10:32:58 +0000 Subject: [PATCH 008/129] v1.0.108 --- lerna.json | 2 +- packages/backend-core/package.json | 2 +- packages/bbui/package.json | 4 ++-- packages/builder/package.json | 10 +++++----- packages/cli/package.json | 2 +- packages/client/package.json | 8 ++++---- packages/frontend-core/package.json | 4 ++-- packages/server/package.json | 8 ++++---- packages/string-templates/package.json | 2 +- packages/worker/package.json | 6 +++--- 10 files changed, 24 insertions(+), 24 deletions(-) diff --git a/lerna.json b/lerna.json index 11cd10c009..fec2cd7c17 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.0.107", + "version": "1.0.108", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index a1b63e8c30..c5cb4b3ae0 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "1.0.107", + "version": "1.0.108", "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 cce726b82f..36378946d4 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.107", + "version": "1.0.108", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", @@ -38,7 +38,7 @@ ], "dependencies": { "@adobe/spectrum-css-workflow-icons": "^1.2.1", - "@budibase/string-templates": "^1.0.107", + "@budibase/string-templates": "^1.0.108", "@spectrum-css/actionbutton": "^1.0.1", "@spectrum-css/actiongroup": "^1.0.1", "@spectrum-css/avatar": "^3.0.2", diff --git a/packages/builder/package.json b/packages/builder/package.json index b546f41f3a..395be5d516 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.0.107", + "version": "1.0.108", "license": "GPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^1.0.107", - "@budibase/client": "^1.0.107", - "@budibase/frontend-core": "^1.0.107", - "@budibase/string-templates": "^1.0.107", + "@budibase/bbui": "^1.0.108", + "@budibase/client": "^1.0.108", + "@budibase/frontend-core": "^1.0.108", + "@budibase/string-templates": "^1.0.108", "@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 9d93d7edf9..7f7e7b6985 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "1.0.107", + "version": "1.0.108", "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 75dad5e9b0..a12bb093de 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "1.0.107", + "version": "1.0.108", "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.107", - "@budibase/frontend-core": "^1.0.107", - "@budibase/string-templates": "^1.0.107", + "@budibase/bbui": "^1.0.108", + "@budibase/frontend-core": "^1.0.108", + "@budibase/string-templates": "^1.0.108", "@spectrum-css/button": "^3.0.3", "@spectrum-css/card": "^3.0.3", "@spectrum-css/divider": "^1.0.3", diff --git a/packages/frontend-core/package.json b/packages/frontend-core/package.json index 22e0214924..3f3473dc7e 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "1.0.107", + "version": "1.0.108", "description": "Budibase frontend core libraries used in builder and client", "author": "Budibase", "license": "MPL-2.0", "svelte": "src/index.js", "dependencies": { - "@budibase/bbui": "^1.0.107", + "@budibase/bbui": "^1.0.108", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/server/package.json b/packages/server/package.json index 59177f6035..266853cab8 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.107", + "version": "1.0.108", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -68,9 +68,9 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "^10.0.3", - "@budibase/backend-core": "^1.0.107", - "@budibase/client": "^1.0.107", - "@budibase/string-templates": "^1.0.107", + "@budibase/backend-core": "^1.0.108", + "@budibase/client": "^1.0.108", + "@budibase/string-templates": "^1.0.108", "@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 f4b0d8e8e1..f77d89818e 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "1.0.107", + "version": "1.0.108", "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 dc9fcd1302..b478d689a3 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.107", + "version": "1.0.108", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -31,8 +31,8 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "^1.0.107", - "@budibase/string-templates": "^1.0.107", + "@budibase/backend-core": "^1.0.108", + "@budibase/string-templates": "^1.0.108", "@koa/router": "^8.0.0", "@sentry/node": "^6.0.0", "@techpass/passport-openidconnect": "^0.3.0", From 7a0e57f8b73f72f70245d48021645d14c315bef7 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Wed, 6 Apr 2022 15:09:51 +0100 Subject: [PATCH 009/129] Update smoke_test.yaml --- .github/workflows/smoke_test.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/smoke_test.yaml b/.github/workflows/smoke_test.yaml index 04c0c7b5e3..b26d0386fc 100644 --- a/.github/workflows/smoke_test.yaml +++ b/.github/workflows/smoke_test.yaml @@ -28,6 +28,7 @@ jobs: - name: Cypress run id: cypress + continue-on-error: true uses: cypress-io/github-action@v2 with: install: false From d0773466d35a4767a0127fbfe7bd5f5af9800ba2 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Wed, 6 Apr 2022 14:17:15 +0000 Subject: [PATCH 010/129] v1.0.109 --- lerna.json | 2 +- packages/backend-core/package.json | 2 +- packages/bbui/package.json | 4 ++-- packages/builder/package.json | 10 +++++----- packages/cli/package.json | 2 +- packages/client/package.json | 8 ++++---- packages/frontend-core/package.json | 4 ++-- packages/server/package.json | 8 ++++---- packages/string-templates/package.json | 2 +- packages/worker/package.json | 6 +++--- 10 files changed, 24 insertions(+), 24 deletions(-) diff --git a/lerna.json b/lerna.json index fec2cd7c17..9875870414 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.0.108", + "version": "1.0.109", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index c5cb4b3ae0..27aa0d7e63 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "1.0.108", + "version": "1.0.109", "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 36378946d4..3c4b17d7a2 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.108", + "version": "1.0.109", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", @@ -38,7 +38,7 @@ ], "dependencies": { "@adobe/spectrum-css-workflow-icons": "^1.2.1", - "@budibase/string-templates": "^1.0.108", + "@budibase/string-templates": "^1.0.109", "@spectrum-css/actionbutton": "^1.0.1", "@spectrum-css/actiongroup": "^1.0.1", "@spectrum-css/avatar": "^3.0.2", diff --git a/packages/builder/package.json b/packages/builder/package.json index 395be5d516..e94a0f6cfa 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.0.108", + "version": "1.0.109", "license": "GPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^1.0.108", - "@budibase/client": "^1.0.108", - "@budibase/frontend-core": "^1.0.108", - "@budibase/string-templates": "^1.0.108", + "@budibase/bbui": "^1.0.109", + "@budibase/client": "^1.0.109", + "@budibase/frontend-core": "^1.0.109", + "@budibase/string-templates": "^1.0.109", "@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 7f7e7b6985..2afb1d86bc 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "1.0.108", + "version": "1.0.109", "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 a12bb093de..f41dab49f7 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "1.0.108", + "version": "1.0.109", "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.108", - "@budibase/frontend-core": "^1.0.108", - "@budibase/string-templates": "^1.0.108", + "@budibase/bbui": "^1.0.109", + "@budibase/frontend-core": "^1.0.109", + "@budibase/string-templates": "^1.0.109", "@spectrum-css/button": "^3.0.3", "@spectrum-css/card": "^3.0.3", "@spectrum-css/divider": "^1.0.3", diff --git a/packages/frontend-core/package.json b/packages/frontend-core/package.json index 3f3473dc7e..b18e2b5f56 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "1.0.108", + "version": "1.0.109", "description": "Budibase frontend core libraries used in builder and client", "author": "Budibase", "license": "MPL-2.0", "svelte": "src/index.js", "dependencies": { - "@budibase/bbui": "^1.0.108", + "@budibase/bbui": "^1.0.109", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/server/package.json b/packages/server/package.json index 266853cab8..bd7962637c 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.108", + "version": "1.0.109", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -68,9 +68,9 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "^10.0.3", - "@budibase/backend-core": "^1.0.108", - "@budibase/client": "^1.0.108", - "@budibase/string-templates": "^1.0.108", + "@budibase/backend-core": "^1.0.109", + "@budibase/client": "^1.0.109", + "@budibase/string-templates": "^1.0.109", "@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 f77d89818e..0c4d31385e 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "1.0.108", + "version": "1.0.109", "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 b478d689a3..65d98b7b15 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.108", + "version": "1.0.109", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -31,8 +31,8 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "^1.0.108", - "@budibase/string-templates": "^1.0.108", + "@budibase/backend-core": "^1.0.109", + "@budibase/string-templates": "^1.0.109", "@koa/router": "^8.0.0", "@sentry/node": "^6.0.0", "@techpass/passport-openidconnect": "^0.3.0", From 2accebec7fc9f39a4997a0061140df24ba550416 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Thu, 7 Apr 2022 10:26:39 +0100 Subject: [PATCH 011/129] Fix for issue discovered in #5187 - expanding regex to cover all sorts of number coercion. --- packages/server/src/integrations/mysql.ts | 3 ++- packages/server/src/utilities/index.js | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/server/src/integrations/mysql.ts b/packages/server/src/integrations/mysql.ts index cd5dc77f9b..6efcdf53de 100644 --- a/packages/server/src/integrations/mysql.ts +++ b/packages/server/src/integrations/mysql.ts @@ -15,6 +15,7 @@ import { } from "./utils" import { DatasourcePlus } from "./base/datasourcePlus" import dayjs from "dayjs" +const { NUMBER_REGEX } = require("../utilities") module MySQLModule { const mysql = require("mysql2/promise") @@ -87,7 +88,7 @@ module MySQLModule { if (typeof binding !== "string") { continue } - const matches = binding.match(/^\d*$/g) + const matches = binding.match(NUMBER_REGEX) // check if number first if (matches && matches[0] !== "" && !isNaN(Number(matches[0]))) { bindings[i] = parseFloat(binding) diff --git a/packages/server/src/utilities/index.js b/packages/server/src/utilities/index.js index 221c2ff18b..66005fd9cd 100644 --- a/packages/server/src/utilities/index.js +++ b/packages/server/src/utilities/index.js @@ -11,6 +11,8 @@ exports.wait = ms => new Promise(resolve => setTimeout(resolve, ms)) exports.isDev = env.isDev +exports.NUMBER_REGEX = /^[+-]?([0-9]*[.])?[0-9]+$/g + exports.removeFromArray = (array, element) => { const index = array.indexOf(element) if (index !== -1) { From b2b1e76e30b40213decc833ef1d79f68df0b4273 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Fri, 8 Apr 2022 09:01:38 +0100 Subject: [PATCH 012/129] adding more descriptive error messages to query UI --- packages/builder/src/components/integration/QueryViewer.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/builder/src/components/integration/QueryViewer.svelte b/packages/builder/src/components/integration/QueryViewer.svelte index 19c1165d9e..8f6f9eeb53 100644 --- a/packages/builder/src/components/integration/QueryViewer.svelte +++ b/packages/builder/src/components/integration/QueryViewer.svelte @@ -72,7 +72,7 @@ fields = response.schema notifications.success("Query executed successfully") } catch (error) { - notifications.error("Error previewing query") + notifications.error(`Query Error: ${error.message}`) } } From 7eb13151f3d358326f3346e93f8459d353b0cec0 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Fri, 8 Apr 2022 09:34:45 +0000 Subject: [PATCH 013/129] v1.0.110 --- lerna.json | 2 +- packages/backend-core/package.json | 2 +- packages/bbui/package.json | 4 ++-- packages/builder/package.json | 10 +++++----- packages/cli/package.json | 2 +- packages/client/package.json | 8 ++++---- packages/frontend-core/package.json | 4 ++-- packages/server/package.json | 8 ++++---- packages/string-templates/package.json | 2 +- packages/worker/package.json | 6 +++--- 10 files changed, 24 insertions(+), 24 deletions(-) diff --git a/lerna.json b/lerna.json index 9875870414..542778f5e3 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.0.109", + "version": "1.0.110", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index 27aa0d7e63..746ec22fc5 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "1.0.109", + "version": "1.0.110", "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 3c4b17d7a2..eae83ed87a 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.109", + "version": "1.0.110", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", @@ -38,7 +38,7 @@ ], "dependencies": { "@adobe/spectrum-css-workflow-icons": "^1.2.1", - "@budibase/string-templates": "^1.0.109", + "@budibase/string-templates": "^1.0.110", "@spectrum-css/actionbutton": "^1.0.1", "@spectrum-css/actiongroup": "^1.0.1", "@spectrum-css/avatar": "^3.0.2", diff --git a/packages/builder/package.json b/packages/builder/package.json index e94a0f6cfa..51a94ea4e9 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.0.109", + "version": "1.0.110", "license": "GPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^1.0.109", - "@budibase/client": "^1.0.109", - "@budibase/frontend-core": "^1.0.109", - "@budibase/string-templates": "^1.0.109", + "@budibase/bbui": "^1.0.110", + "@budibase/client": "^1.0.110", + "@budibase/frontend-core": "^1.0.110", + "@budibase/string-templates": "^1.0.110", "@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 2afb1d86bc..0f924733c1 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "1.0.109", + "version": "1.0.110", "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 f41dab49f7..0feeeb6de6 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "1.0.109", + "version": "1.0.110", "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.109", - "@budibase/frontend-core": "^1.0.109", - "@budibase/string-templates": "^1.0.109", + "@budibase/bbui": "^1.0.110", + "@budibase/frontend-core": "^1.0.110", + "@budibase/string-templates": "^1.0.110", "@spectrum-css/button": "^3.0.3", "@spectrum-css/card": "^3.0.3", "@spectrum-css/divider": "^1.0.3", diff --git a/packages/frontend-core/package.json b/packages/frontend-core/package.json index b18e2b5f56..02a380742a 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "1.0.109", + "version": "1.0.110", "description": "Budibase frontend core libraries used in builder and client", "author": "Budibase", "license": "MPL-2.0", "svelte": "src/index.js", "dependencies": { - "@budibase/bbui": "^1.0.109", + "@budibase/bbui": "^1.0.110", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/server/package.json b/packages/server/package.json index bd7962637c..6208b06935 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.109", + "version": "1.0.110", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -68,9 +68,9 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "^10.0.3", - "@budibase/backend-core": "^1.0.109", - "@budibase/client": "^1.0.109", - "@budibase/string-templates": "^1.0.109", + "@budibase/backend-core": "^1.0.110", + "@budibase/client": "^1.0.110", + "@budibase/string-templates": "^1.0.110", "@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 0c4d31385e..b35bec224c 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "1.0.109", + "version": "1.0.110", "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 65d98b7b15..f0f247d531 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.109", + "version": "1.0.110", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -31,8 +31,8 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "^1.0.109", - "@budibase/string-templates": "^1.0.109", + "@budibase/backend-core": "^1.0.110", + "@budibase/string-templates": "^1.0.110", "@koa/router": "^8.0.0", "@sentry/node": "^6.0.0", "@techpass/passport-openidconnect": "^0.3.0", From c89b311e8174219359fe67a5e7a40bc24cc916ea Mon Sep 17 00:00:00 2001 From: Kacper Date: Fri, 8 Apr 2022 13:23:44 +0200 Subject: [PATCH 014/129] QUERY_THREAD_TIMEOUT is string instead of int fix --- packages/server/src/environment.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/server/src/environment.js b/packages/server/src/environment.js index bdbbbde79f..95407d87cb 100644 --- a/packages/server/src/environment.js +++ b/packages/server/src/environment.js @@ -71,7 +71,7 @@ module.exports = { DEPLOYMENT_CREDENTIALS_URL: process.env.DEPLOYMENT_CREDENTIALS_URL, ALLOW_DEV_AUTOMATIONS: process.env.ALLOW_DEV_AUTOMATIONS, DISABLE_THREADING: process.env.DISABLE_THREADING, - QUERY_THREAD_TIMEOUT: process.env.QUERY_THREAD_TIMEOUT, + QUERY_THREAD_TIMEOUT: parseInt(process.env.QUERY_THREAD_TIMEOUT), SQL_MAX_ROWS: process.env.SQL_MAX_ROWS, _set(key, value) { process.env[key] = value From 5c5debff48b42c3479c4b98a8a09ccbaac8ee9ea Mon Sep 17 00:00:00 2001 From: Kacper Date: Fri, 8 Apr 2022 16:17:19 +0200 Subject: [PATCH 015/129] added parseIntSafe function. --- packages/server/src/environment.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/server/src/environment.js b/packages/server/src/environment.js index 95407d87cb..d967df0398 100644 --- a/packages/server/src/environment.js +++ b/packages/server/src/environment.js @@ -24,6 +24,12 @@ if (!LOADED && isDev() && !isTest()) { LOADED = true } +function parseIntSafe(number) { + if (number) { + return parseInt(number) + } +} + let inThread = false module.exports = { @@ -71,7 +77,7 @@ module.exports = { DEPLOYMENT_CREDENTIALS_URL: process.env.DEPLOYMENT_CREDENTIALS_URL, ALLOW_DEV_AUTOMATIONS: process.env.ALLOW_DEV_AUTOMATIONS, DISABLE_THREADING: process.env.DISABLE_THREADING, - QUERY_THREAD_TIMEOUT: parseInt(process.env.QUERY_THREAD_TIMEOUT), + QUERY_THREAD_TIMEOUT: parseIntSafe(process.env.QUERY_THREAD_TIMEOUT), SQL_MAX_ROWS: process.env.SQL_MAX_ROWS, _set(key, value) { process.env[key] = value From 9eb2ab1687e6739ff86462dc70d875faf9839625 Mon Sep 17 00:00:00 2001 From: Kacper Date: Fri, 8 Apr 2022 16:20:55 +0200 Subject: [PATCH 016/129] Move out QUERY_THREAD_TIMEOUT from `to remove` section --- packages/server/src/environment.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/server/src/environment.js b/packages/server/src/environment.js index d967df0398..594a2aad28 100644 --- a/packages/server/src/environment.js +++ b/packages/server/src/environment.js @@ -68,6 +68,7 @@ module.exports = { SENDGRID_API_KEY: process.env.SENDGRID_API_KEY, DYNAMO_ENDPOINT: process.env.DYNAMO_ENDPOINT, POSTHOG_TOKEN: process.env.POSTHOG_TOKEN, + QUERY_THREAD_TIMEOUT: parseIntSafe(process.env.QUERY_THREAD_TIMEOUT), // old - to remove CLIENT_ID: process.env.CLIENT_ID, BUDIBASE_DIR: process.env.BUDIBASE_DIR, @@ -77,7 +78,6 @@ module.exports = { DEPLOYMENT_CREDENTIALS_URL: process.env.DEPLOYMENT_CREDENTIALS_URL, ALLOW_DEV_AUTOMATIONS: process.env.ALLOW_DEV_AUTOMATIONS, DISABLE_THREADING: process.env.DISABLE_THREADING, - QUERY_THREAD_TIMEOUT: parseIntSafe(process.env.QUERY_THREAD_TIMEOUT), SQL_MAX_ROWS: process.env.SQL_MAX_ROWS, _set(key, value) { process.env[key] = value From 37d723fa07fe8a89049244233c9eb95513ba5893 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Mon, 11 Apr 2022 08:38:36 +0000 Subject: [PATCH 017/129] v1.0.111 --- lerna.json | 2 +- packages/backend-core/package.json | 2 +- packages/bbui/package.json | 4 ++-- packages/builder/package.json | 10 +++++----- packages/cli/package.json | 2 +- packages/client/package.json | 8 ++++---- packages/frontend-core/package.json | 4 ++-- packages/server/package.json | 8 ++++---- packages/string-templates/package.json | 2 +- packages/worker/package.json | 6 +++--- 10 files changed, 24 insertions(+), 24 deletions(-) diff --git a/lerna.json b/lerna.json index 542778f5e3..5b67cbead1 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.0.110", + "version": "1.0.111", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index 746ec22fc5..1585d97106 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "1.0.110", + "version": "1.0.111", "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 eae83ed87a..c4464f21ca 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.110", + "version": "1.0.111", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", @@ -38,7 +38,7 @@ ], "dependencies": { "@adobe/spectrum-css-workflow-icons": "^1.2.1", - "@budibase/string-templates": "^1.0.110", + "@budibase/string-templates": "^1.0.111", "@spectrum-css/actionbutton": "^1.0.1", "@spectrum-css/actiongroup": "^1.0.1", "@spectrum-css/avatar": "^3.0.2", diff --git a/packages/builder/package.json b/packages/builder/package.json index 51a94ea4e9..79d187b7cb 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.0.110", + "version": "1.0.111", "license": "GPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^1.0.110", - "@budibase/client": "^1.0.110", - "@budibase/frontend-core": "^1.0.110", - "@budibase/string-templates": "^1.0.110", + "@budibase/bbui": "^1.0.111", + "@budibase/client": "^1.0.111", + "@budibase/frontend-core": "^1.0.111", + "@budibase/string-templates": "^1.0.111", "@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 0f924733c1..2817ca2628 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "1.0.110", + "version": "1.0.111", "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 0feeeb6de6..b93f5927bc 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "1.0.110", + "version": "1.0.111", "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.110", - "@budibase/frontend-core": "^1.0.110", - "@budibase/string-templates": "^1.0.110", + "@budibase/bbui": "^1.0.111", + "@budibase/frontend-core": "^1.0.111", + "@budibase/string-templates": "^1.0.111", "@spectrum-css/button": "^3.0.3", "@spectrum-css/card": "^3.0.3", "@spectrum-css/divider": "^1.0.3", diff --git a/packages/frontend-core/package.json b/packages/frontend-core/package.json index 02a380742a..d7cbaf3482 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "1.0.110", + "version": "1.0.111", "description": "Budibase frontend core libraries used in builder and client", "author": "Budibase", "license": "MPL-2.0", "svelte": "src/index.js", "dependencies": { - "@budibase/bbui": "^1.0.110", + "@budibase/bbui": "^1.0.111", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/server/package.json b/packages/server/package.json index 6208b06935..418fe32344 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.110", + "version": "1.0.111", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -68,9 +68,9 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "^10.0.3", - "@budibase/backend-core": "^1.0.110", - "@budibase/client": "^1.0.110", - "@budibase/string-templates": "^1.0.110", + "@budibase/backend-core": "^1.0.111", + "@budibase/client": "^1.0.111", + "@budibase/string-templates": "^1.0.111", "@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 b35bec224c..a34a60c4a7 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "1.0.110", + "version": "1.0.111", "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 f0f247d531..cd3958fd07 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.110", + "version": "1.0.111", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -31,8 +31,8 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "^1.0.110", - "@budibase/string-templates": "^1.0.110", + "@budibase/backend-core": "^1.0.111", + "@budibase/string-templates": "^1.0.111", "@koa/router": "^8.0.0", "@sentry/node": "^6.0.0", "@techpass/passport-openidconnect": "^0.3.0", From c7172739965130854f11c3ae147987ba71c17281 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Tue, 12 Apr 2022 11:03:43 +0000 Subject: [PATCH 018/129] v1.0.112 --- lerna.json | 2 +- packages/backend-core/package.json | 2 +- packages/bbui/package.json | 4 ++-- packages/builder/package.json | 10 +++++----- packages/cli/package.json | 2 +- packages/client/package.json | 8 ++++---- packages/frontend-core/package.json | 4 ++-- packages/server/package.json | 8 ++++---- packages/string-templates/package.json | 2 +- packages/worker/package.json | 6 +++--- 10 files changed, 24 insertions(+), 24 deletions(-) diff --git a/lerna.json b/lerna.json index 5b67cbead1..36d07358e9 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.0.111", + "version": "1.0.112", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index 1585d97106..5e497e0503 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "1.0.111", + "version": "1.0.112", "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 c4464f21ca..a1f4a3534b 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.111", + "version": "1.0.112", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", @@ -38,7 +38,7 @@ ], "dependencies": { "@adobe/spectrum-css-workflow-icons": "^1.2.1", - "@budibase/string-templates": "^1.0.111", + "@budibase/string-templates": "^1.0.112", "@spectrum-css/actionbutton": "^1.0.1", "@spectrum-css/actiongroup": "^1.0.1", "@spectrum-css/avatar": "^3.0.2", diff --git a/packages/builder/package.json b/packages/builder/package.json index 79d187b7cb..06a1750c03 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.0.111", + "version": "1.0.112", "license": "GPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^1.0.111", - "@budibase/client": "^1.0.111", - "@budibase/frontend-core": "^1.0.111", - "@budibase/string-templates": "^1.0.111", + "@budibase/bbui": "^1.0.112", + "@budibase/client": "^1.0.112", + "@budibase/frontend-core": "^1.0.112", + "@budibase/string-templates": "^1.0.112", "@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 2817ca2628..e9097619b5 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "1.0.111", + "version": "1.0.112", "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 b93f5927bc..5eced2ce2b 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "1.0.111", + "version": "1.0.112", "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.111", - "@budibase/frontend-core": "^1.0.111", - "@budibase/string-templates": "^1.0.111", + "@budibase/bbui": "^1.0.112", + "@budibase/frontend-core": "^1.0.112", + "@budibase/string-templates": "^1.0.112", "@spectrum-css/button": "^3.0.3", "@spectrum-css/card": "^3.0.3", "@spectrum-css/divider": "^1.0.3", diff --git a/packages/frontend-core/package.json b/packages/frontend-core/package.json index d7cbaf3482..2fd96dc1a6 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "1.0.111", + "version": "1.0.112", "description": "Budibase frontend core libraries used in builder and client", "author": "Budibase", "license": "MPL-2.0", "svelte": "src/index.js", "dependencies": { - "@budibase/bbui": "^1.0.111", + "@budibase/bbui": "^1.0.112", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/server/package.json b/packages/server/package.json index 418fe32344..39230ea9c0 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.111", + "version": "1.0.112", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -68,9 +68,9 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "^10.0.3", - "@budibase/backend-core": "^1.0.111", - "@budibase/client": "^1.0.111", - "@budibase/string-templates": "^1.0.111", + "@budibase/backend-core": "^1.0.112", + "@budibase/client": "^1.0.112", + "@budibase/string-templates": "^1.0.112", "@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 a34a60c4a7..1aaed6b640 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "1.0.111", + "version": "1.0.112", "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 cd3958fd07..540dfc2ebc 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.111", + "version": "1.0.112", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -31,8 +31,8 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "^1.0.111", - "@budibase/string-templates": "^1.0.111", + "@budibase/backend-core": "^1.0.112", + "@budibase/string-templates": "^1.0.112", "@koa/router": "^8.0.0", "@sentry/node": "^6.0.0", "@techpass/passport-openidconnect": "^0.3.0", From 94720c10aa550521ee201264c0df0b3a61f50e67 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Tue, 12 Apr 2022 18:49:46 +0100 Subject: [PATCH 019/129] Fixing issue #5322 - when endpoint is specified for DynamoDB and not in a the region that the whole instance expects it will throw an odd credentials error - making sure connection is commenced everywhere other than localhost. --- packages/server/src/integrations/dynamodb.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/server/src/integrations/dynamodb.ts b/packages/server/src/integrations/dynamodb.ts index be3668a08a..9ce4201a1e 100644 --- a/packages/server/src/integrations/dynamodb.ts +++ b/packages/server/src/integrations/dynamodb.ts @@ -131,11 +131,12 @@ module DynamoModule { constructor(config: DynamoDBConfig) { this.config = config - if (!this.config.endpoint) { + if (this.config.endpoint && !this.config.endpoint.includes("localhost")) { this.connect() } let options = { correctClockSkew: true, + region: this.config.region || AWS_REGION, endpoint: config.endpoint ? config.endpoint : undefined, } this.client = new AWS.DynamoDB.DocumentClient(options) From 57d1d9c2d5d77b1b15e7cfa3a3a908ec07140502 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Tue, 12 Apr 2022 16:27:14 +0100 Subject: [PATCH 020/129] Use the readable schema when generating search field options --- .../PropertiesPanel/PropertyControls/SearchFieldSelect.svelte | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/SearchFieldSelect.svelte b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/SearchFieldSelect.svelte index b3387fdd05..e609426b1e 100644 --- a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/SearchFieldSelect.svelte +++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/SearchFieldSelect.svelte @@ -15,9 +15,7 @@ const dispatch = createEventDispatcher() $: datasource = getDatasourceForProvider($currentAsset, componentInstance) - $: schema = getSchemaForDatasource($currentAsset, datasource, { - searchableSchema: true, - }).schema + $: schema = getSchemaForDatasource($currentAsset, datasource).schema $: options = getOptions(datasource, schema || {}) $: boundValue = getSelectedOption(value, options) From c9d0791a0ec09a61e3115ad54c5e86a843637a7a Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Tue, 12 Apr 2022 16:58:26 +0100 Subject: [PATCH 021/129] Remove table ID from custom queries to fix 500 errors when trying to fetch a table definition and passing up a query ID, and fix issue with search fields when no table ID exists --- .../PropertiesPanel/PropertyControls/DataSourceSelect.svelte | 1 - .../PropertiesPanel/PropertyControls/SearchFieldSelect.svelte | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/DataSourceSelect.svelte b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/DataSourceSelect.svelte index 73554b45db..1e19508744 100644 --- a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/DataSourceSelect.svelte +++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/DataSourceSelect.svelte @@ -52,7 +52,6 @@ .map(query => ({ label: query.name, name: query.name, - tableId: query._id, ...query, type: "query", })) diff --git a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/SearchFieldSelect.svelte b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/SearchFieldSelect.svelte index e609426b1e..41906d3ba1 100644 --- a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/SearchFieldSelect.svelte +++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/SearchFieldSelect.svelte @@ -22,7 +22,7 @@ function getOptions(ds, dsSchema) { let base = Object.values(dsSchema) if (!ds?.tableId) { - return base + return base.map(field => field.name) } const currentTable = $tables.list.find(table => table._id === ds.tableId) return getFields(base, { allowLinks: currentTable?.sql }).map( From adc6008c4ce9911feb44e89d61995f77279c1e49 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Wed, 13 Apr 2022 10:27:32 +0100 Subject: [PATCH 022/129] Ensure existing invalid datasource definitions are also fixed by checking data source type before fetching table definitions --- packages/client/src/components/app/forms/Form.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/client/src/components/app/forms/Form.svelte b/packages/client/src/components/app/forms/Form.svelte index 8e2e0b2510..8de729ae0a 100644 --- a/packages/client/src/components/app/forms/Form.svelte +++ b/packages/client/src/components/app/forms/Form.svelte @@ -76,7 +76,7 @@ } const fetchTable = async dataSource => { - if (dataSource?.tableId) { + if (dataSource?.tableId && dataSource?.type !== "query") { try { table = await API.fetchTableDefinition(dataSource.tableId) } catch (error) { From f2abbc83775839813f56e094010c73db10e8d274 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Wed, 13 Apr 2022 12:21:10 +0000 Subject: [PATCH 023/129] v1.0.113 --- lerna.json | 2 +- packages/backend-core/package.json | 2 +- packages/bbui/package.json | 4 ++-- packages/builder/package.json | 10 +++++----- packages/cli/package.json | 2 +- packages/client/package.json | 8 ++++---- packages/frontend-core/package.json | 4 ++-- packages/server/package.json | 8 ++++---- packages/string-templates/package.json | 2 +- packages/worker/package.json | 6 +++--- 10 files changed, 24 insertions(+), 24 deletions(-) diff --git a/lerna.json b/lerna.json index 36d07358e9..f3eb2b4647 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.0.112", + "version": "1.0.113", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index 5e497e0503..42e6d73ad3 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "1.0.112", + "version": "1.0.113", "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 a1f4a3534b..746315d6a3 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.112", + "version": "1.0.113", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", @@ -38,7 +38,7 @@ ], "dependencies": { "@adobe/spectrum-css-workflow-icons": "^1.2.1", - "@budibase/string-templates": "^1.0.112", + "@budibase/string-templates": "^1.0.113", "@spectrum-css/actionbutton": "^1.0.1", "@spectrum-css/actiongroup": "^1.0.1", "@spectrum-css/avatar": "^3.0.2", diff --git a/packages/builder/package.json b/packages/builder/package.json index 06a1750c03..7d6daea72c 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.0.112", + "version": "1.0.113", "license": "GPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^1.0.112", - "@budibase/client": "^1.0.112", - "@budibase/frontend-core": "^1.0.112", - "@budibase/string-templates": "^1.0.112", + "@budibase/bbui": "^1.0.113", + "@budibase/client": "^1.0.113", + "@budibase/frontend-core": "^1.0.113", + "@budibase/string-templates": "^1.0.113", "@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 e9097619b5..d8571d585d 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "1.0.112", + "version": "1.0.113", "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 5eced2ce2b..ecfcdd8bd3 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "1.0.112", + "version": "1.0.113", "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.112", - "@budibase/frontend-core": "^1.0.112", - "@budibase/string-templates": "^1.0.112", + "@budibase/bbui": "^1.0.113", + "@budibase/frontend-core": "^1.0.113", + "@budibase/string-templates": "^1.0.113", "@spectrum-css/button": "^3.0.3", "@spectrum-css/card": "^3.0.3", "@spectrum-css/divider": "^1.0.3", diff --git a/packages/frontend-core/package.json b/packages/frontend-core/package.json index 2fd96dc1a6..b08edb212d 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "1.0.112", + "version": "1.0.113", "description": "Budibase frontend core libraries used in builder and client", "author": "Budibase", "license": "MPL-2.0", "svelte": "src/index.js", "dependencies": { - "@budibase/bbui": "^1.0.112", + "@budibase/bbui": "^1.0.113", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/server/package.json b/packages/server/package.json index 39230ea9c0..4a03ede867 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.112", + "version": "1.0.113", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -68,9 +68,9 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "^10.0.3", - "@budibase/backend-core": "^1.0.112", - "@budibase/client": "^1.0.112", - "@budibase/string-templates": "^1.0.112", + "@budibase/backend-core": "^1.0.113", + "@budibase/client": "^1.0.113", + "@budibase/string-templates": "^1.0.113", "@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 1aaed6b640..59ae78744a 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "1.0.112", + "version": "1.0.113", "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 540dfc2ebc..33de4c1f6a 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.112", + "version": "1.0.113", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -31,8 +31,8 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "^1.0.112", - "@budibase/string-templates": "^1.0.112", + "@budibase/backend-core": "^1.0.113", + "@budibase/string-templates": "^1.0.113", "@koa/router": "^8.0.0", "@sentry/node": "^6.0.0", "@techpass/passport-openidconnect": "^0.3.0", From 5180603374c386e4da26aaf4c4acdee32abe65ba Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Thu, 14 Apr 2022 13:06:22 +0100 Subject: [PATCH 024/129] Fix for #5411 - trimming the various binding components for SQL in queries. Also moving SQL interpolation out into a Typescript - prep for further unit testing/improvements. --- .../scripts/integrations/mysql/init.sql | 1 + .../server/src/integrations/queries/sql.ts | 125 +++++++++++++++++ packages/server/src/threads/query.js | 126 +----------------- 3 files changed, 133 insertions(+), 119 deletions(-) create mode 100644 packages/server/src/integrations/queries/sql.ts diff --git a/packages/server/scripts/integrations/mysql/init.sql b/packages/server/scripts/integrations/mysql/init.sql index 9fa608f42d..15269f2f41 100644 --- a/packages/server/scripts/integrations/mysql/init.sql +++ b/packages/server/scripts/integrations/mysql/init.sql @@ -26,6 +26,7 @@ CREATE TABLE Products ( updated time ); INSERT INTO Persons (FirstName, LastName, Age, Address, City, CreatedAt) VALUES ('Mike', 'Hughes', 28.2, '123 Fake Street', 'Belfast', '2021-01-19 03:14:07'); +INSERT INTO Persons (FirstName, LastName, Age, Address, City, CreatedAt) VALUES ('Dave', 'Johnson', 29, '124 Fake Street', 'Belfast', '2022-04-01 00:11:11'); INSERT INTO Tasks (PersonID, TaskName, CreatedAt) VALUES (1, 'assembling', '2020-01-01'); INSERT INTO Tasks (PersonID, TaskName, CreatedAt) VALUES (2, 'processing', '2019-12-31'); INSERT INTO Products (name, updated) VALUES ('Meat', '11:00:22'), ('Fruit', '10:00:00'); diff --git a/packages/server/src/integrations/queries/sql.ts b/packages/server/src/integrations/queries/sql.ts new file mode 100644 index 0000000000..cf71f2ee2a --- /dev/null +++ b/packages/server/src/integrations/queries/sql.ts @@ -0,0 +1,125 @@ +import { findHBSBlocks, processStringSync } from "@budibase/string-templates" +import { Integration } from "../../definitions/datasource" +import { DatasourcePlus } from "../base/datasourcePlus" + +const CONST_CHAR_REGEX = new RegExp("'[^']*'", "g") + +export function enrichQueryFields( + fields: { [key: string]: any }, + parameters = {} +) { + const enrichedQuery: { [key: string]: any } = Array.isArray(fields) ? [] : {} + + // enrich the fields with dynamic parameters + for (let key of Object.keys(fields)) { + if (fields[key] == null) { + continue + } + if (typeof fields[key] === "object") { + // enrich nested fields object + enrichedQuery[key] = enrichQueryFields(fields[key], parameters) + } else if (typeof fields[key] === "string") { + // enrich string value as normal + enrichedQuery[key] = processStringSync(fields[key], parameters, { + noEscaping: true, + noHelpers: true, + escapeNewlines: true, + }) + } else { + enrichedQuery[key] = fields[key] + } + } + if ( + enrichedQuery.json || + enrichedQuery.customData || + enrichedQuery.requestBody + ) { + try { + enrichedQuery.json = JSON.parse( + enrichedQuery.json || + enrichedQuery.customData || + enrichedQuery.requestBody + ) + } catch (err) { + // no json found, ignore + } + delete enrichedQuery.customData + } + return enrichedQuery +} + +export function interpolateSQL( + fields: { [key: string]: any }, + parameters: { [key: string]: any }, + integration: DatasourcePlus +) { + let sql = fields.sql + if (!sql || typeof sql !== "string") { + return fields + } + const bindings = findHBSBlocks(sql) + let variables = [], + arrays = [] + for (let binding of bindings) { + // look for array/list operations in the SQL statement, which will need handled later + const listRegexMatch = sql.match( + new RegExp(`(in|IN|In|iN)( )+[(]?${binding}[)]?`) + ) + // check if the variable was used as part of a string concat e.g. 'Hello {{binding}}' + // start by finding all the instances of const character strings + const charConstMatch = sql.match(CONST_CHAR_REGEX) || [] + // now look within them to see if a binding is used + const charConstBindingMatch = charConstMatch.find((string: any) => + string.match(new RegExp(`'[^']*${binding}[^']*'`)) + ) + if (charConstBindingMatch) { + let [part1, part2] = charConstBindingMatch.split(binding) + part1 = `'${part1.substring(1)}'` + part2 = `'${part2.substring(0, part2.length - 1)}'` + sql = sql.replace( + charConstBindingMatch, + integration.getStringConcat([ + part1, + integration.getBindingIdentifier(), + part2, + ]) + ) + } + // generate SQL parameterised array + else if (listRegexMatch) { + arrays.push(binding) + // determine the length of the array + const value = enrichQueryFields([binding], parameters)[0] + .split(",") + .map((val: string) => val.trim()) + // build a string like ($1, $2, $3) + let replacement = `${Array.apply(null, Array(value.length)) + .map(() => integration.getBindingIdentifier()) + .join(",")}` + // check if parentheses are needed + if (!listRegexMatch[0].includes(`(${binding})`)) { + replacement = `(${replacement})` + } + sql = sql.replace(binding, replacement) + } else { + sql = sql.replace(binding, integration.getBindingIdentifier()) + } + variables.push(binding) + } + // replicate the knex structure + fields.sql = sql + fields.bindings = enrichQueryFields(variables, parameters) + // check for arrays in the data + let updated: string[] = [] + for (let i = 0; i < variables.length; i++) { + if (arrays.includes(variables[i])) { + updated = updated.concat( + fields.bindings[i].split(",").map((val: string) => val.trim()) + ) + } else { + updated.push(fields.bindings[i]) + } + } + fields.bindings = updated + return fields +} diff --git a/packages/server/src/threads/query.js b/packages/server/src/threads/query.js index d6089567b8..71994a7244 100644 --- a/packages/server/src/threads/query.js +++ b/packages/server/src/threads/query.js @@ -2,14 +2,13 @@ const threadUtils = require("./utils") threadUtils.threadSetup() const ScriptRunner = require("../utilities/scriptRunner") const { integrations } = require("../integrations") -const { - processStringSync, - findHBSBlocks, -} = require("@budibase/string-templates") +const { processStringSync } = require("@budibase/string-templates") const { doInAppContext, getAppDB } = require("@budibase/backend-core/context") const { isSQL } = require("../integrations/utils") - -const CONST_CHAR_REGEX = new RegExp("'[^']*'", "g") +const { + enrichQueryFields, + interpolateSQL, +} = require("../integrations/queries/sql") class QueryRunner { constructor(input, flags = { noRecursiveQuery: false }) { @@ -29,76 +28,6 @@ class QueryRunner { this.hasRerun = false } - interpolateSQL(fields, parameters, integration) { - let sql = fields.sql - if (!sql) { - return fields - } - const bindings = findHBSBlocks(sql) - let variables = [], - arrays = [] - for (let binding of bindings) { - // look for array/list operations in the SQL statement, which will need handled later - const listRegexMatch = sql.match( - new RegExp(`(in|IN|In|iN)( )+[(]?${binding}[)]?`) - ) - // check if the variable was used as part of a string concat e.g. 'Hello {{binding}}' - // start by finding all the instances of const character strings - const charConstMatch = sql.match(CONST_CHAR_REGEX) || [] - // now look within them to see if a binding is used - const charConstBindingMatch = charConstMatch.find(string => - string.match(new RegExp(`'[^']*${binding}[^']*'`)) - ) - if (charConstBindingMatch) { - let [part1, part2] = charConstBindingMatch.split(binding) - part1 = `'${part1.substring(1)}'` - part2 = `'${part2.substring(0, part2.length - 1)}'` - sql = sql.replace( - charConstBindingMatch, - integration.getStringConcat([ - part1, - integration.getBindingIdentifier(), - part2, - ]) - ) - } - // generate SQL parameterised array - else if (listRegexMatch) { - arrays.push(binding) - // determine the length of the array - const value = this.enrichQueryFields([binding], parameters)[0].split( - "," - ) - // build a string like ($1, $2, $3) - let replacement = `${Array.apply(null, Array(value.length)) - .map(() => integration.getBindingIdentifier()) - .join(",")}` - // check if parentheses are needed - if (!listRegexMatch[0].includes(`(${binding})`)) { - replacement = `(${replacement})` - } - sql = sql.replace(binding, replacement) - } else { - sql = sql.replace(binding, integration.getBindingIdentifier()) - } - variables.push(binding) - } - // replicate the knex structure - fields.sql = sql - fields.bindings = this.enrichQueryFields(variables, parameters) - // check for arrays in the data - let updated = [] - for (let i = 0; i < variables.length; i++) { - if (arrays.includes(variables[i])) { - updated = updated.concat(fields.bindings[i].split(",")) - } else { - updated.push(fields.bindings[i]) - } - } - fields.bindings = updated - return fields - } - async execute() { let { datasource, fields, queryVerb, transformer } = this const Integration = integrations[datasource.source] @@ -112,9 +41,9 @@ class QueryRunner { let query // handle SQL injections by interpolating the variables if (isSQL(datasource)) { - query = this.interpolateSQL(fields, parameters, integration) + query = interpolateSQL(fields, parameters, integration) } else { - query = this.enrichQueryFields(fields, parameters) + query = enrichQueryFields(fields, parameters) } // Add pagination values for REST queries @@ -259,47 +188,6 @@ class QueryRunner { } return parameters } - - enrichQueryFields(fields, parameters = {}) { - const enrichedQuery = Array.isArray(fields) ? [] : {} - - // enrich the fields with dynamic parameters - for (let key of Object.keys(fields)) { - if (fields[key] == null) { - continue - } - if (typeof fields[key] === "object") { - // enrich nested fields object - enrichedQuery[key] = this.enrichQueryFields(fields[key], parameters) - } else if (typeof fields[key] === "string") { - // enrich string value as normal - enrichedQuery[key] = processStringSync(fields[key], parameters, { - noEscaping: true, - noHelpers: true, - escapeNewlines: true, - }) - } else { - enrichedQuery[key] = fields[key] - } - } - if ( - enrichedQuery.json || - enrichedQuery.customData || - enrichedQuery.requestBody - ) { - try { - enrichedQuery.json = JSON.parse( - enrichedQuery.json || - enrichedQuery.customData || - enrichedQuery.requestBody - ) - } catch (err) { - // no json found, ignore - } - delete enrichedQuery.customData - } - return enrichedQuery - } } module.exports = (input, callback) => { From 80a41235dd118fdea03d759313b3b3fa350a2abc Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Thu, 14 Apr 2022 17:28:14 +0100 Subject: [PATCH 025/129] Fixing REST UI query error notification and adding better error for query timeout. --- .../[selectedDatasource]/rest/[query]/index.svelte | 2 +- packages/server/src/threads/index.js | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/rest/[query]/index.svelte b/packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/rest/[query]/index.svelte index 17e35eda31..e870c2f6db 100644 --- a/packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/rest/[query]/index.svelte +++ b/packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/rest/[query]/index.svelte @@ -136,7 +136,7 @@ notifications.success("Request sent successfully") } } catch (error) { - notifications.error("Error running query") + notifications.error(`Query Error: ${error.message}`) } } diff --git a/packages/server/src/threads/index.js b/packages/server/src/threads/index.js index 94571c31d1..b41acabb4c 100644 --- a/packages/server/src/threads/index.js +++ b/packages/server/src/threads/index.js @@ -36,6 +36,7 @@ class Thread { maxConcurrentWorkers: this.count, } if (opts.timeoutMs) { + this.timeoutMs = opts.timeoutMs workerOpts.maxCallTime = opts.timeoutMs } this.workers = workerFarm(workerOpts, typeToFile(type)) @@ -43,6 +44,7 @@ class Thread { } run(data) { + const timeoutMs = this.timeoutMs return new Promise((resolve, reject) => { let fncToCall // if in test then don't use threading @@ -52,7 +54,11 @@ class Thread { fncToCall = this.workers } fncToCall(data, (err, response) => { - if (err) { + if (err && err.type === "TimeoutError") { + reject( + new Error(`Query response time exceeded ${timeoutMs}ms timeout.`) + ) + } else if (err) { reject(err) } else { resolve(response) From 943ae42b273ccd869e8996362f612807385c88f1 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Tue, 19 Apr 2022 10:55:53 +0100 Subject: [PATCH 026/129] Fix sticky hover state for icons on mobile --- packages/client/src/components/app/Icon.svelte | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/client/src/components/app/Icon.svelte b/packages/client/src/components/app/Icon.svelte index 70eb69ce1a..829cc60227 100644 --- a/packages/client/src/components/app/Icon.svelte +++ b/packages/client/src/components/app/Icon.svelte @@ -36,8 +36,13 @@ div { font-style: italic; } - .hoverable:hover { + @media (hover: hover) { + .hoverable:hover { + color: var(--spectrum-alias-icon-color-selected-hover) !important; + cursor: pointer; + } + } + .hoverable:active { color: var(--spectrum-alias-icon-color-selected-hover) !important; - cursor: pointer; } From 26c19891bb3c2dab1ed04020addff5dd75ed4a71 Mon Sep 17 00:00:00 2001 From: Dean Date: Tue, 19 Apr 2022 14:38:09 +0100 Subject: [PATCH 027/129] Unpublish refactored to stop development applications being mistakenly deleted. Minor updates to the modal content component to allow the replacement of the header. Further work to implement the publishing workflow changes --- packages/backend-core/src/context/index.js | 2 + packages/bbui/src/Modal/ModalContent.svelte | 14 +- packages/bbui/src/Popover/Popover.svelte | 5 +- packages/bbui/src/Popover/PopoverMenu.svelte | 81 +++++++++ packages/bbui/src/index.js | 1 + .../FlowChart/ResultsModal.svelte | 14 +- .../src/components/deploy/DeployModal.svelte | 87 ++++++++- .../deploy/DeploymentHistory.svelte | 37 ++-- .../builder/src/components/deploy/utils.js | 25 +++ .../src/components/start/AppRow.svelte | 53 ++++-- .../builder/app/[application]/_layout.svelte | 171 +++++++++++++++++- .../pages/builder/portal/apps/index.svelte | 5 + .../server/src/api/controllers/application.js | 18 +- .../src/api/controllers/deploy/index.js | 3 + 14 files changed, 457 insertions(+), 59 deletions(-) create mode 100644 packages/bbui/src/Popover/PopoverMenu.svelte create mode 100644 packages/builder/src/components/deploy/utils.js diff --git a/packages/backend-core/src/context/index.js b/packages/backend-core/src/context/index.js index ba9a7831db..9cb61ea8c9 100644 --- a/packages/backend-core/src/context/index.js +++ b/packages/backend-core/src/context/index.js @@ -174,9 +174,11 @@ function getDB(key, opts) { if (db && isEqual(opts, storedOpts)) { return db } + const appId = exports.getAppId() const CouchDB = getCouch() let toUseAppId + switch (key) { case ContextKeys.CURRENT_DB: toUseAppId = appId diff --git a/packages/bbui/src/Modal/ModalContent.svelte b/packages/bbui/src/Modal/ModalContent.svelte index 89c10bb625..4c608f1025 100644 --- a/packages/bbui/src/Modal/ModalContent.svelte +++ b/packages/bbui/src/Modal/ModalContent.svelte @@ -72,12 +72,20 @@ class:header-spacing={$$slots.header} > {title} + + {:else if $$slots.header} +

- {#if showDivider} - - {/if} {/if} + {#if showDivider && (title || $$slots.header)} + + {/if} +
diff --git a/packages/bbui/src/Popover/Popover.svelte b/packages/bbui/src/Popover/Popover.svelte index 6c9c6cc9a3..b7a0f08aae 100644 --- a/packages/bbui/src/Popover/Popover.svelte +++ b/packages/bbui/src/Popover/Popover.svelte @@ -11,6 +11,9 @@ export let align = "right" export let portalTarget + let clazz + export { clazz as class } + export const show = () => { dispatch("open") open = true @@ -37,7 +40,7 @@ use:positionDropdown={{ anchor, align }} use:clickOutside={hide} on:keydown={handleEscape} - class="spectrum-Popover is-open" + class={"spectrum-Popover is-open " + clazz} role="presentation" > diff --git a/packages/bbui/src/Popover/PopoverMenu.svelte b/packages/bbui/src/Popover/PopoverMenu.svelte new file mode 100644 index 0000000000..7c9d52f499 --- /dev/null +++ b/packages/bbui/src/Popover/PopoverMenu.svelte @@ -0,0 +1,81 @@ + + +
+
+ +
+ + {#if showTip} + {@html tipSvg} + {/if} + +
+
+ +
+
+
+
+ + diff --git a/packages/bbui/src/index.js b/packages/bbui/src/index.js index 2b16f32b84..6a2d3824f0 100644 --- a/packages/bbui/src/index.js +++ b/packages/bbui/src/index.js @@ -25,6 +25,7 @@ export { default as RadioGroup } from "./Form/RadioGroup.svelte" export { default as Checkbox } from "./Form/Checkbox.svelte" export { default as DetailSummary } from "./DetailSummary/DetailSummary.svelte" export { default as Popover } from "./Popover/Popover.svelte" +export { default as PopoverMenu } from "./Popover/PopoverMenu.svelte" export { default as ProgressBar } from "./ProgressBar/ProgressBar.svelte" export { default as ProgressCircle } from "./ProgressCircle/ProgressCircle.svelte" export { default as Label } from "./Label/Label.svelte" diff --git a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/ResultsModal.svelte b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/ResultsModal.svelte index 7dfdff20a7..7e55deb6a2 100644 --- a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/ResultsModal.svelte +++ b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/ResultsModal.svelte @@ -10,11 +10,11 @@ -
-
+
+ Test Automation +
{#if isTrigger || testResult[0].outputs.success}
@@ -89,6 +89,14 @@ diff --git a/packages/builder/src/components/deploy/DeploymentHistory.svelte b/packages/builder/src/components/deploy/DeploymentHistory.svelte index e933142348..6b584b92e6 100644 --- a/packages/builder/src/components/deploy/DeploymentHistory.svelte +++ b/packages/builder/src/components/deploy/DeploymentHistory.svelte @@ -7,12 +7,10 @@ import { notifications } from "@budibase/bbui" import CreateWebhookDeploymentModal from "./CreateWebhookDeploymentModal.svelte" import { store } from "builderStore" - - const DeploymentStatus = { - SUCCESS: "SUCCESS", - PENDING: "PENDING", - FAILURE: "FAILURE", - } + import { + checkIncomingDeploymentStatus, + DeploymentStatus, + } from "components/deploy/utils" const DATE_OPTIONS = { fullDate: { @@ -42,30 +40,17 @@ const formatDate = (date, format) => Intl.DateTimeFormat("en-GB", DATE_OPTIONS[format]).format(date) - // Required to check any updated deployment statuses between polls - function checkIncomingDeploymentStatus(current, incoming) { - for (let incomingDeployment of incoming) { - if (incomingDeployment.status === DeploymentStatus.FAILURE) { - const currentDeployment = current.find( - deployment => deployment._id === incomingDeployment._id - ) - - // We have just been notified of an ongoing deployments failure - if ( - !currentDeployment || - currentDeployment.status === DeploymentStatus.PENDING - ) { - showErrorReasonModal(incomingDeployment.err) - } - } - } - } - async function fetchDeployments() { try { const newDeployments = await API.getAppDeployments() if (deployments.length > 0) { - checkIncomingDeploymentStatus(deployments, newDeployments) + const pendingDeployments = checkIncomingDeploymentStatus( + deployments, + newDeployments + ) + if (pendingDeployments.length) { + showErrorReasonModal(incomingDeployment.err) + } } deployments = newDeployments } catch (err) { diff --git a/packages/builder/src/components/deploy/utils.js b/packages/builder/src/components/deploy/utils.js new file mode 100644 index 0000000000..49cf7a49fa --- /dev/null +++ b/packages/builder/src/components/deploy/utils.js @@ -0,0 +1,25 @@ +export const DeploymentStatus = { + SUCCESS: "SUCCESS", + PENDING: "PENDING", + FAILURE: "FAILURE", +} + +// Required to check any updated deployment statuses between polls +export function checkIncomingDeploymentStatus(current, incoming) { + return incoming.reduce((acc, incomingDeployment) => { + if (incomingDeployment.status === DeploymentStatus.FAILURE) { + const currentDeployment = current.find( + deployment => deployment._id === incomingDeployment._id + ) + + //We have just been notified of an ongoing deployments failure + if ( + !currentDeployment || + currentDeployment.status === DeploymentStatus.PENDING + ) { + acc.push(incomingDeployment) + } + } + return acc; + }, []) +} \ No newline at end of file diff --git a/packages/builder/src/components/start/AppRow.svelte b/packages/builder/src/components/start/AppRow.svelte index d6dc4e1800..b4d73bfdc0 100644 --- a/packages/builder/src/components/start/AppRow.svelte +++ b/packages/builder/src/components/start/AppRow.svelte @@ -5,6 +5,7 @@ Icon, ActionMenu, MenuItem, + ButtonGroup, StatusLight, } from "@budibase/bbui" import { processStringSync } from "@budibase/string-templates" @@ -15,6 +16,7 @@ export let editApp export let updateApp export let deleteApp + export let previewApp export let unpublishApp export let releaseLock export let editIcon @@ -57,19 +59,36 @@
- - {#if app.deployed}Published{:else}Unpublished{/if} - +
+ {#if app.deployed} + + Published + {:else} + + Unpublished + {/if} +
- +
+ {#if app.deployed} + + {:else} + + {/if} + +
{#if app.deployed} @@ -97,6 +116,18 @@
From b3db4257f20d835d21163e8e765b74f4d6ad12af Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Mon, 25 Apr 2022 12:46:59 +0100 Subject: [PATCH 062/129] Update publish icon with normal tooltips --- .../builder/app/[application]/_layout.svelte | 38 +++++++------------ 1 file changed, 14 insertions(+), 24 deletions(-) diff --git a/packages/builder/src/pages/builder/app/[application]/_layout.svelte b/packages/builder/src/pages/builder/app/[application]/_layout.svelte index 645a2f621a..ee15226978 100644 --- a/packages/builder/src/pages/builder/app/[application]/_layout.svelte +++ b/packages/builder/src/pages/builder/app/[application]/_layout.svelte @@ -11,6 +11,7 @@ Layout, Button, Heading, + Body, } from "@budibase/bbui" import DeployModal from "components/deploy/DeployModal.svelte" import RevertModal from "components/deploy/RevertModal.svelte" @@ -33,7 +34,6 @@ let promise = getPackage() let unpublishModal let publishPopover - let notPublishedPopover $: enrichedApps = enrichApps($apps, $auth.user) const enrichApps = (apps, user) => { @@ -235,16 +235,17 @@
- Your app is live! -
+ Your published app + {#if isPublished} {processStringSync( - "Last Published: {{ duration time 'millisecond' }} ago", + "Last published {{ duration time 'millisecond' }} ago", { time: new Date().getTime() - @@ -252,7 +253,7 @@ } )} {/if} -
+
- +
{/if} {#if !isPublished} - -
{ - notPublishedPopover.show() - }} - on:mouseout={() => { - notPublishedPopover.hide() - }} - on:blur={() => void 0} - disabled={true} - > - -
- This app has not been published yet -
+ {/if} From f1d7220df7d4b7cfe8a013bff310f722557d8ac4 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Mon, 25 Apr 2022 14:40:22 +0100 Subject: [PATCH 063/129] adding larger limits to the NGINX ingress contoller --- charts/budibase/values.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/charts/budibase/values.yaml b/charts/budibase/values.yaml index 648b1d2dee..ce9fb13907 100644 --- a/charts/budibase/values.yaml +++ b/charts/budibase/values.yaml @@ -47,6 +47,8 @@ ingress: className: "" annotations: kubernetes.io/ingress.class: nginx + nginx.ingress.kubernetes.io/client-max-body-size: 150M + nginx.ingress.kubernetes.io/proxy-body-size: 50m hosts: - host: # change if using custom domain paths: From 971d8bf9d069f3ea62aad39d44778e027f0f3859 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Mon, 25 Apr 2022 14:44:14 +0100 Subject: [PATCH 064/129] bump chart version --- charts/budibase/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/budibase/Chart.yaml b/charts/budibase/Chart.yaml index 134d29441f..694c8c77fe 100644 --- a/charts/budibase/Chart.yaml +++ b/charts/budibase/Chart.yaml @@ -11,7 +11,7 @@ sources: - https://github.com/Budibase/budibase - https://budibase.com type: application -version: 0.2.8 +version: 0.2.9 appVersion: 1.0.48 dependencies: - name: couchdb From 45a65a03c392f6c52dcf1fc3af30de673c345670 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Mon, 25 Apr 2022 13:59:00 +0000 Subject: [PATCH 065/129] v1.0.121 --- lerna.json | 2 +- packages/backend-core/package.json | 2 +- packages/bbui/package.json | 4 ++-- packages/builder/package.json | 10 +++++----- packages/cli/package.json | 2 +- packages/client/package.json | 8 ++++---- packages/frontend-core/package.json | 4 ++-- packages/server/package.json | 8 ++++---- packages/string-templates/package.json | 2 +- packages/worker/package.json | 6 +++--- 10 files changed, 24 insertions(+), 24 deletions(-) diff --git a/lerna.json b/lerna.json index f2032e24aa..50270ae994 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.0.120", + "version": "1.0.121", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index c074252c54..cacbdf39b1 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "1.0.120", + "version": "1.0.121", "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 0a55d243c9..7ddec66a0c 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.120", + "version": "1.0.121", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", @@ -38,7 +38,7 @@ ], "dependencies": { "@adobe/spectrum-css-workflow-icons": "^1.2.1", - "@budibase/string-templates": "^1.0.120", + "@budibase/string-templates": "^1.0.121", "@spectrum-css/actionbutton": "^1.0.1", "@spectrum-css/actiongroup": "^1.0.1", "@spectrum-css/avatar": "^3.0.2", diff --git a/packages/builder/package.json b/packages/builder/package.json index 644fcf2029..89c90f86b8 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.0.120", + "version": "1.0.121", "license": "GPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^1.0.120", - "@budibase/client": "^1.0.120", - "@budibase/frontend-core": "^1.0.120", - "@budibase/string-templates": "^1.0.120", + "@budibase/bbui": "^1.0.121", + "@budibase/client": "^1.0.121", + "@budibase/frontend-core": "^1.0.121", + "@budibase/string-templates": "^1.0.121", "@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 13e582d6c5..b611818d5c 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "1.0.120", + "version": "1.0.121", "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 d776f06460..a121cda6b9 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "1.0.120", + "version": "1.0.121", "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.120", - "@budibase/frontend-core": "^1.0.120", - "@budibase/string-templates": "^1.0.120", + "@budibase/bbui": "^1.0.121", + "@budibase/frontend-core": "^1.0.121", + "@budibase/string-templates": "^1.0.121", "@spectrum-css/button": "^3.0.3", "@spectrum-css/card": "^3.0.3", "@spectrum-css/divider": "^1.0.3", diff --git a/packages/frontend-core/package.json b/packages/frontend-core/package.json index cb85e66ec2..0923c77e4a 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "1.0.120", + "version": "1.0.121", "description": "Budibase frontend core libraries used in builder and client", "author": "Budibase", "license": "MPL-2.0", "svelte": "src/index.js", "dependencies": { - "@budibase/bbui": "^1.0.120", + "@budibase/bbui": "^1.0.121", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/server/package.json b/packages/server/package.json index 59587398da..f4d0822ee2 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.120", + "version": "1.0.121", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -68,9 +68,9 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "^10.0.3", - "@budibase/backend-core": "^1.0.120", - "@budibase/client": "^1.0.120", - "@budibase/string-templates": "^1.0.120", + "@budibase/backend-core": "^1.0.121", + "@budibase/client": "^1.0.121", + "@budibase/string-templates": "^1.0.121", "@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 e6e1f2c76c..20a9b0d5f1 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "1.0.120", + "version": "1.0.121", "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 082cb8e38a..555531cc44 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.120", + "version": "1.0.121", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -31,8 +31,8 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "^1.0.120", - "@budibase/string-templates": "^1.0.120", + "@budibase/backend-core": "^1.0.121", + "@budibase/string-templates": "^1.0.121", "@koa/router": "^8.0.0", "@sentry/node": "^6.0.0", "@techpass/passport-openidconnect": "^0.3.0", From c00965d46f50cec31c0b97d3ebd58efeb272c9ee Mon Sep 17 00:00:00 2001 From: Mitch-Budibase Date: Mon, 25 Apr 2022 16:25:42 +0100 Subject: [PATCH 066/129] Update Commands.js Updating addDatasourceConfig Small change for getting the HOST_IP value --- packages/builder/cypress/support/commands.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/builder/cypress/support/commands.js b/packages/builder/cypress/support/commands.js index e4a7f44bac..de2b989d86 100644 --- a/packages/builder/cypress/support/commands.js +++ b/packages/builder/cypress/support/commands.js @@ -495,7 +495,7 @@ Cypress.Commands.add("addDatasourceConfig", (datasource, skipFetch) => { } else { cy.get("input") .clear({ force: true }) - .type(Cypress.env("mysql").HOST, { force: true }) + .type(Cypress.env("HOST_IP"), { force: true }) } }) }) From c94d8516c5bb08252278ef726f34510581f16238 Mon Sep 17 00:00:00 2001 From: Rory Powell Date: Mon, 25 Apr 2022 22:08:56 +0100 Subject: [PATCH 067/129] Fix: You must pass a 'distinctId' (public forms) --- packages/client/src/api/api.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/client/src/api/api.js b/packages/client/src/api/api.js index 35730ac9b7..51a9b82ee6 100644 --- a/packages/client/src/api/api.js +++ b/packages/client/src/api/api.js @@ -28,7 +28,7 @@ export const API = createAPIClient({ // Or we could check error.status and redirect to login on a 403 etc. onError: error => { const { status, method, url, message, handled } = error || {} - const ignoreErrorUrls = ["analytics", "/api/global/self"] + const ignoreErrorUrls = ["bbtel", "/api/global/self"] // Log any errors that we haven't manually handled if (!handled) { From d251a801235f6990f09175866cfe158972dfd312 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Tue, 26 Apr 2022 07:55:00 +0000 Subject: [PATCH 068/129] v1.0.122 --- lerna.json | 2 +- packages/backend-core/package.json | 2 +- packages/bbui/package.json | 4 ++-- packages/builder/package.json | 10 +++++----- packages/cli/package.json | 2 +- packages/client/package.json | 8 ++++---- packages/frontend-core/package.json | 4 ++-- packages/server/package.json | 8 ++++---- packages/string-templates/package.json | 2 +- packages/worker/package.json | 6 +++--- 10 files changed, 24 insertions(+), 24 deletions(-) diff --git a/lerna.json b/lerna.json index 50270ae994..96440d2573 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.0.121", + "version": "1.0.122", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index cacbdf39b1..322c81d402 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "1.0.121", + "version": "1.0.122", "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 7ddec66a0c..0a9a093dbb 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.121", + "version": "1.0.122", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", @@ -38,7 +38,7 @@ ], "dependencies": { "@adobe/spectrum-css-workflow-icons": "^1.2.1", - "@budibase/string-templates": "^1.0.121", + "@budibase/string-templates": "^1.0.122", "@spectrum-css/actionbutton": "^1.0.1", "@spectrum-css/actiongroup": "^1.0.1", "@spectrum-css/avatar": "^3.0.2", diff --git a/packages/builder/package.json b/packages/builder/package.json index 89c90f86b8..e13467a328 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.0.121", + "version": "1.0.122", "license": "GPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^1.0.121", - "@budibase/client": "^1.0.121", - "@budibase/frontend-core": "^1.0.121", - "@budibase/string-templates": "^1.0.121", + "@budibase/bbui": "^1.0.122", + "@budibase/client": "^1.0.122", + "@budibase/frontend-core": "^1.0.122", + "@budibase/string-templates": "^1.0.122", "@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 b611818d5c..056803a9fe 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "1.0.121", + "version": "1.0.122", "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 a121cda6b9..251f53ea03 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "1.0.121", + "version": "1.0.122", "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.121", - "@budibase/frontend-core": "^1.0.121", - "@budibase/string-templates": "^1.0.121", + "@budibase/bbui": "^1.0.122", + "@budibase/frontend-core": "^1.0.122", + "@budibase/string-templates": "^1.0.122", "@spectrum-css/button": "^3.0.3", "@spectrum-css/card": "^3.0.3", "@spectrum-css/divider": "^1.0.3", diff --git a/packages/frontend-core/package.json b/packages/frontend-core/package.json index 0923c77e4a..57e5f67f72 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "1.0.121", + "version": "1.0.122", "description": "Budibase frontend core libraries used in builder and client", "author": "Budibase", "license": "MPL-2.0", "svelte": "src/index.js", "dependencies": { - "@budibase/bbui": "^1.0.121", + "@budibase/bbui": "^1.0.122", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/server/package.json b/packages/server/package.json index f4d0822ee2..6e41a2506f 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.121", + "version": "1.0.122", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -68,9 +68,9 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "^10.0.3", - "@budibase/backend-core": "^1.0.121", - "@budibase/client": "^1.0.121", - "@budibase/string-templates": "^1.0.121", + "@budibase/backend-core": "^1.0.122", + "@budibase/client": "^1.0.122", + "@budibase/string-templates": "^1.0.122", "@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 20a9b0d5f1..97ba8fe089 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "1.0.121", + "version": "1.0.122", "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 555531cc44..f0c933d42d 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.121", + "version": "1.0.122", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -31,8 +31,8 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "^1.0.121", - "@budibase/string-templates": "^1.0.121", + "@budibase/backend-core": "^1.0.122", + "@budibase/string-templates": "^1.0.122", "@koa/router": "^8.0.0", "@sentry/node": "^6.0.0", "@techpass/passport-openidconnect": "^0.3.0", From 24a9656cbc7a0ca2e9882329560e865e5ae4b196 Mon Sep 17 00:00:00 2001 From: Dean Date: Tue, 26 Apr 2022 12:04:07 +0100 Subject: [PATCH 069/129] Test fixes and code review refactoring --- packages/bbui/src/Modal/ModalContent.svelte | 26 +-- packages/bbui/src/Popover/Popover.svelte | 26 ++- packages/bbui/src/Popover/PopoverMenu.svelte | 82 -------- packages/bbui/src/index.js | 1 - .../integration/appPublishWorkflow.spec.js | 14 +- .../cypress/integration/autoScreensUI.spec.js | 92 ++++----- .../integration/createAutomation.spec.js | 2 +- .../cypress/integration/createView.spec.js | 4 +- .../integration/renameAnApplication.spec.js | 2 +- .../cypress/integration/revertApp.spec.js | 6 +- .../AutomationPanel/AutomationPanel.svelte | 2 +- .../popovers/EditViewPopover.svelte | 2 +- .../src/components/deploy/DeployModal.svelte | 52 +++-- .../components/deploy/DeployNavigation.svelte | 189 ++++++++++++++++++ .../src/components/deploy/RevertModal.svelte | 7 +- .../src/components/start/AppRow.svelte | 2 +- .../builder/app/[application]/_layout.svelte | 187 +---------------- 17 files changed, 319 insertions(+), 377 deletions(-) delete mode 100644 packages/bbui/src/Popover/PopoverMenu.svelte create mode 100644 packages/builder/src/components/deploy/DeployNavigation.svelte diff --git a/packages/bbui/src/Modal/ModalContent.svelte b/packages/bbui/src/Modal/ModalContent.svelte index 830f2004ef..10cd4b10ba 100644 --- a/packages/bbui/src/Modal/ModalContent.svelte +++ b/packages/bbui/src/Modal/ModalContent.svelte @@ -67,19 +67,21 @@ data-cy={dataCy} >
-

- {#if title} - {title} - {:else if $$slots.header} - + {#if title || $$slots.header} +

+ {#if title} + {title} + {:else if $$slots.header} + + {/if} +

+ {#if showDivider} + {/if} -

- {#if showDivider && (title || $$slots.header)} - {/if} diff --git a/packages/bbui/src/Popover/Popover.svelte b/packages/bbui/src/Popover/Popover.svelte index ff59d41eff..1017ef71fc 100644 --- a/packages/bbui/src/Popover/Popover.svelte +++ b/packages/bbui/src/Popover/Popover.svelte @@ -12,8 +12,15 @@ export let portalTarget export let dataCy - let clazz - export { clazz as class } + export let direction = "bottom" + export let showTip = false + + let tipSvg = + ' ' + + $: tooltipClasses = showTip + ? `spectrum-Popover--withTip spectrum-Popover--${direction}` + : "" export const show = () => { dispatch("open") @@ -41,10 +48,14 @@ use:positionDropdown={{ anchor, align }} use:clickOutside={hide} on:keydown={handleEscape} - class={"spectrum-Popover is-open " + (clazz || "")} + class={"spectrum-Popover is-open " + (tooltipClasses || "")} role="presentation" data-cy={dataCy} > + {#if showTip} + {@html tipSvg} + {/if} +
@@ -54,4 +65,13 @@ .spectrum-Popover { min-width: var(--spectrum-global-dimension-size-2000) !important; } + .spectrum-Popover.is-open.spectrum-Popover--withTip { + margin-top: var(--spacing-xs); + margin-left: var(--spacing-xl); + } + :global(.spectrum-Popover--bottom .spectrum-Popover-tip), + :global(.spectrum-Popover--top .spectrum-Popover-tip) { + left: 90%; + margin-left: calc(var(--spectrum-global-dimension-size-150) * -1); + } diff --git a/packages/bbui/src/Popover/PopoverMenu.svelte b/packages/bbui/src/Popover/PopoverMenu.svelte deleted file mode 100644 index 11a3f4893f..0000000000 --- a/packages/bbui/src/Popover/PopoverMenu.svelte +++ /dev/null @@ -1,82 +0,0 @@ - - -
-
- -
- - {#if showTip} - {@html tipSvg} - {/if} - -
-
- -
-
-
-
- - diff --git a/packages/bbui/src/index.js b/packages/bbui/src/index.js index 6a2d3824f0..2b16f32b84 100644 --- a/packages/bbui/src/index.js +++ b/packages/bbui/src/index.js @@ -25,7 +25,6 @@ export { default as RadioGroup } from "./Form/RadioGroup.svelte" export { default as Checkbox } from "./Form/Checkbox.svelte" export { default as DetailSummary } from "./DetailSummary/DetailSummary.svelte" export { default as Popover } from "./Popover/Popover.svelte" -export { default as PopoverMenu } from "./Popover/PopoverMenu.svelte" export { default as ProgressBar } from "./ProgressBar/ProgressBar.svelte" export { default as ProgressCircle } from "./ProgressCircle/ProgressCircle.svelte" export { default as Label } from "./Label/Label.svelte" diff --git a/packages/builder/cypress/integration/appPublishWorkflow.spec.js b/packages/builder/cypress/integration/appPublishWorkflow.spec.js index efcd6c0a53..d18233e0e7 100644 --- a/packages/builder/cypress/integration/appPublishWorkflow.spec.js +++ b/packages/builder/cypress/integration/appPublishWorkflow.spec.js @@ -23,8 +23,8 @@ filterTests(['all'], () => { cy.get(".spectrum-Button").contains("Edit").click({ force: true }) }) - cy.get(".app-status-icon svg[aria-label='GlobeStrike']").should("exist") - cy.get(".app-status-icon svg[aria-label='Globe']").should("not.exist") + cy.get(".deployment-top-nav svg[aria-label='GlobeStrike']").should("exist") + cy.get(".deployment-top-nav svg[aria-label='Globe']").should("not.exist") }) it("Should publish an application and correctly reflect that", () => { @@ -61,13 +61,13 @@ filterTests(['all'], () => { cy.get(".spectrum-Button").contains("Edit").click({ force: true }) }) - cy.get(".app-status-icon svg[aria-label='Globe']").should("exist").click({ force: true }) + cy.get(".deployment-top-nav svg[aria-label='Globe']").should("exist").click({ force: true }) cy.get("[data-cy='publish-popover-menu']").should("be.visible") .within(() => { cy.get("[data-cy='publish-popover-action']").should("exist") - cy.get("button").contains("View App").should("exist") - cy.get(".publish-popover-message").should("have.text", "Last Published: a few seconds ago") + cy.get("button").contains("View app").should("exist") + cy.get(".publish-popover-message").should("have.text", "Last published a few seconds ago") }) }) @@ -89,7 +89,7 @@ filterTests(['all'], () => { }) //The published status - cy.get(".app-status-icon svg[aria-label='Globe']").should("exist") + cy.get(".deployment-top-nav svg[aria-label='Globe']").should("exist") .click({ force: true }) cy.get("[data-cy='publish-popover-menu']").should("be.visible") @@ -101,7 +101,7 @@ filterTests(['all'], () => { cy.get(".confirm-wrap button").click({ force: true } )}) - cy.get(".app-status-icon svg[aria-label='GlobeStrike']").should("exist") + cy.get(".deployment-top-nav svg[aria-label='GlobeStrike']").should("exist") cy.visit(`${Cypress.config().baseUrl}/builder`) diff --git a/packages/builder/cypress/integration/autoScreensUI.spec.js b/packages/builder/cypress/integration/autoScreensUI.spec.js index ab65e6561f..2997bd052a 100644 --- a/packages/builder/cypress/integration/autoScreensUI.spec.js +++ b/packages/builder/cypress/integration/autoScreensUI.spec.js @@ -1,51 +1,51 @@ import filterTests from "../support/filterTests" filterTests(['smoke', 'all'], () => { - context("Auto Screens UI", () => { - before(() => { - cy.login() - cy.createTestApp() - }) - - it("should generate internal table screens", () => { - // Create autogenerated screens from the internal table - cy.createAutogeneratedScreens(["Cypress Tests"]) - // Confirm screens have been auto generated - cy.get(".nav-items-container").contains("cypress-tests").click({ force: true }) - cy.get(".nav-items-container").should('contain', 'cypress-tests/:id') - .and('contain', 'cypress-tests/new/row') - }) - - it("should generate multiple internal table screens at once", () => { - // Create a second internal table - const initialTable = "Cypress Tests" - const secondTable = "Table Two" - cy.createTable(secondTable) - // Create autogenerated screens from the internal tables - cy.createAutogeneratedScreens([initialTable, secondTable]) - // Confirm screens have been auto generated - cy.get(".nav-items-container").contains("cypress-tests").click({ force: true }) - // Previously generated tables are suffixed with numbers - as expected - cy.get(".nav-items-container").should('contain', 'cypress-tests-2/:id') - .and('contain', 'cypress-tests-2/new/row') - cy.get(".nav-items-container").contains("table-two").click() - cy.get(".nav-items-container").should('contain', 'table-two/:id') - .and('contain', 'table-two/new/row') - }) - - if (Cypress.env("TEST_ENV")) { - it("should generate data source screens", () => { - // Using MySQL data source for testing this - const datasource = "MySQL" - // Select & configure MySQL data source - cy.selectExternalDatasource(datasource) - cy.addDatasourceConfig(datasource) - // Create autogenerated screens from a MySQL table - MySQL contains books table - cy.createAutogeneratedScreens(["books"]) - cy.get(".nav-items-container").contains("books").click() - cy.get(".nav-items-container").should('contain', 'books/:id') - .and('contain', 'books/new/row') - }) - } + context("Auto Screens UI", () => { + before(() => { + cy.login() + cy.createTestApp() }) + + it("should generate internal table screens", () => { + // Create autogenerated screens from the internal table + cy.createAutogeneratedScreens(["Cypress Tests"]) + // Confirm screens have been auto generated + cy.get(".nav-items-container").contains("cypress-tests").click({ force: true }) + cy.get(".nav-items-container").should('contain', 'cypress-tests/:id') + .and('contain', 'cypress-tests/new/row') + }) + + it("should generate multiple internal table screens at once", () => { + // Create a second internal table + const initialTable = "Cypress Tests" + const secondTable = "Table Two" + cy.createTable(secondTable) + // Create autogenerated screens from the internal tables + cy.createAutogeneratedScreens([initialTable, secondTable]) + // Confirm screens have been auto generated + cy.get(".nav-items-container").contains("cypress-tests").click({ force: true }) + // Previously generated tables are suffixed with numbers - as expected + cy.get(".nav-items-container").should('contain', 'cypress-tests-2/:id') + .and('contain', 'cypress-tests-2/new/row') + cy.get(".nav-items-container").contains("table-two").click() + cy.get(".nav-items-container").should('contain', 'table-two/:id') + .and('contain', 'table-two/new/row') + }) + + if (Cypress.env("TEST_ENV")) { + it("should generate data source screens", () => { + // Using MySQL data source for testing this + const datasource = "MySQL" + // Select & configure MySQL data source + cy.selectExternalDatasource(datasource) + cy.addDatasourceConfig(datasource) + // Create autogenerated screens from a MySQL table - MySQL contains books table + cy.createAutogeneratedScreens(["books"]) + cy.get(".nav-items-container").contains("books").click() + cy.get(".nav-items-container").should('contain', 'books/:id') + .and('contain', 'books/new/row') + }) + } + }) }) diff --git a/packages/builder/cypress/integration/createAutomation.spec.js b/packages/builder/cypress/integration/createAutomation.spec.js index ff8065f544..69ef3f98a3 100644 --- a/packages/builder/cypress/integration/createAutomation.spec.js +++ b/packages/builder/cypress/integration/createAutomation.spec.js @@ -11,7 +11,7 @@ filterTests(['smoke', 'all'], () => { cy.createTestTableWithData() cy.wait(2000) cy.contains("Automate").click() - cy.get("[data-cy='new-screen'] > .spectrum-Icon").click() + cy.get(".add-button .spectrum-Icon").click() cy.get(".modal-inner-wrapper").within(() => { cy.get("input").type("Add Row") cy.contains("Row Created").click({ force: true }) diff --git a/packages/builder/cypress/integration/createView.spec.js b/packages/builder/cypress/integration/createView.spec.js index a8c3b03cee..feaf1c3b5f 100644 --- a/packages/builder/cypress/integration/createView.spec.js +++ b/packages/builder/cypress/integration/createView.spec.js @@ -125,7 +125,7 @@ filterTests(['smoke', 'all'], () => { it("renames a view", () => { cy.contains(".nav-item", "Test View") - .find(".actions .icon") + .find(".actions .icon.open-popover") .click({ force: true }) cy.get(".spectrum-Menu-itemLabel").contains("Edit").click() cy.get(".modal-inner-wrapper").within(() => { @@ -138,7 +138,7 @@ filterTests(['smoke', 'all'], () => { it("deletes a view", () => { cy.contains(".nav-item", "Test View Updated") - .find(".actions .icon") + .find(".actions .icon.open-popover") .click({ force: true }) cy.contains("Delete").click() cy.contains("Delete View").click() diff --git a/packages/builder/cypress/integration/renameAnApplication.spec.js b/packages/builder/cypress/integration/renameAnApplication.spec.js index 73e682cce0..120c0d54d7 100644 --- a/packages/builder/cypress/integration/renameAnApplication.spec.js +++ b/packages/builder/cypress/integration/renameAnApplication.spec.js @@ -99,7 +99,7 @@ filterTests(['all'], () => { cy.searchForApplication(originalName) cy.get(".appTable") .within(() => { - cy.get("[data-cy='app-row-actions-menu']").eq(0).click() + cy.get("[aria-label='More']").eq(0).click() }) // Check for when an app is published if (published == true) { diff --git a/packages/builder/cypress/integration/revertApp.spec.js b/packages/builder/cypress/integration/revertApp.spec.js index aeb1847b46..71dd93a4cf 100644 --- a/packages/builder/cypress/integration/revertApp.spec.js +++ b/packages/builder/cypress/integration/revertApp.spec.js @@ -10,7 +10,7 @@ filterTests(['smoke', 'all'], () => { it("should try to revert an unpublished app", () => { // Click revert icon cy.get(".toprightnav").within(() => { - cy.get("[data-cy='revert-application-topnav']").click({ force: true }) + cy.get("[aria-label='Revert']").click({ force: true }) }) cy.get(".spectrum-Dialog-grid").within(() => { // Enter app name before revert @@ -41,7 +41,7 @@ filterTests(['smoke', 'all'], () => { cy.addComponent("Elements", "Button") // Click Revert cy.get(".toprightnav").within(() => { - cy.get("[data-cy='revert-application-topnav']").click({ force: true }) + cy.get("[aria-label='Revert']").click({ force: true }) }) cy.get(".spectrum-Dialog-grid").within(() => { // Click Revert @@ -58,7 +58,7 @@ filterTests(['smoke', 'all'], () => { it("should enter incorrect app name when reverting", () => { // Click Revert cy.get(".toprightnav").within(() => { - cy.get("[data-cy='revert-application-topnav']").click({ force: true }) + cy.get("[aria-label='Revert']").click({ force: true }) }) // Enter incorrect app name cy.get(".spectrum-Dialog-grid").within(() => { diff --git a/packages/builder/src/components/automation/AutomationPanel/AutomationPanel.svelte b/packages/builder/src/components/automation/AutomationPanel/AutomationPanel.svelte index 2c67a3966c..2f57767863 100644 --- a/packages/builder/src/components/automation/AutomationPanel/AutomationPanel.svelte +++ b/packages/builder/src/components/automation/AutomationPanel/AutomationPanel.svelte @@ -16,7 +16,7 @@ -
+
diff --git a/packages/builder/src/components/backend/TableNavigator/popovers/EditViewPopover.svelte b/packages/builder/src/components/backend/TableNavigator/popovers/EditViewPopover.svelte index 0ab5d4326f..6eba5070fc 100644 --- a/packages/builder/src/components/backend/TableNavigator/popovers/EditViewPopover.svelte +++ b/packages/builder/src/components/backend/TableNavigator/popovers/EditViewPopover.svelte @@ -40,7 +40,7 @@ -
+
Edit diff --git a/packages/builder/src/components/deploy/DeployModal.svelte b/packages/builder/src/components/deploy/DeployModal.svelte index ffda399440..0d9bfb7539 100644 --- a/packages/builder/src/components/deploy/DeployModal.svelte +++ b/packages/builder/src/components/deploy/DeployModal.svelte @@ -96,33 +96,31 @@ - - - -
- - - - App Published! -
- -
-
-
+ + +
+ + + + App Published! +
+ +
+
diff --git a/packages/builder/src/components/deploy/RevertModal.svelte b/packages/builder/src/components/deploy/RevertModal.svelte index fabd97fbca..717c55f05e 100644 --- a/packages/builder/src/components/deploy/RevertModal.svelte +++ b/packages/builder/src/components/deploy/RevertModal.svelte @@ -28,12 +28,7 @@ } - +
- + {#if app.lockedYou} releaseLock(app)} icon="LockOpen"> Release lock diff --git a/packages/builder/src/pages/builder/app/[application]/_layout.svelte b/packages/builder/src/pages/builder/app/[application]/_layout.svelte index ee15226978..ebe5e32653 100644 --- a/packages/builder/src/pages/builder/app/[application]/_layout.svelte +++ b/packages/builder/src/pages/builder/app/[application]/_layout.svelte @@ -1,67 +1,22 @@ {#await promise} @@ -223,84 +112,16 @@ - - {#if isPublished} - -
- -
- - Your published app - - {#if isPublished} - {processStringSync( - "Last published {{ duration time 'millisecond' }} ago", - { - time: - new Date().getTime() - - new Date(latestDeployments[0].updatedAt).getTime(), - } - )} - {/if} - -
- - -
-
-
- {/if} - - {#if !isPublished} - - {/if} - - +
- - Are you sure you want to unpublish the app {selectedApp?.name}? -
{:catch error}

Something went wrong: {error.message}

{/await}