From 738cd50030a433fdc1f5f357017778779c5eb986 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Mon, 21 Feb 2022 15:01:42 +0000 Subject: [PATCH 1/3] Fixing issue with formula column validation breaking row save. --- packages/builder/src/constants/backend/index.js | 5 +---- packages/server/src/api/controllers/row/utils.js | 10 ++++------ 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/packages/builder/src/constants/backend/index.js b/packages/builder/src/constants/backend/index.js index d07c245b21..4d6a7e3884 100644 --- a/packages/builder/src/constants/backend/index.js +++ b/packages/builder/src/constants/backend/index.js @@ -84,10 +84,7 @@ export const FIELDS = { FORMULA: { name: "Formula", type: "formula", - constraints: { - type: "string", - presence: false, - }, + constraints: {}, }, JSON: { name: "JSON", diff --git a/packages/server/src/api/controllers/row/utils.js b/packages/server/src/api/controllers/row/utils.js index 4235e70127..9ff6b085af 100644 --- a/packages/server/src/api/controllers/row/utils.js +++ b/packages/server/src/api/controllers/row/utils.js @@ -3,7 +3,6 @@ const { cloneDeep } = require("lodash/fp") const { InternalTables } = require("../../../db/utils") const userController = require("../user") const { FieldTypes } = require("../../../constants") -const { processStringSync } = require("@budibase/string-templates") const { makeExternalQuery } = require("../../../integrations/base/utils") const { getAppDB } = require("@budibase/backend-core/context") @@ -52,6 +51,10 @@ exports.validate = async ({ tableId, row, table }) => { for (let fieldName of Object.keys(table.schema)) { const constraints = cloneDeep(table.schema[fieldName].constraints) const type = table.schema[fieldName].type + // formulas shouldn't validated, data will be deleted anyway + if (type === FieldTypes.FORMULA) { + continue + } // special case for options, need to always allow unselected (null) if (type === FieldTypes.OPTIONS && constraints.inclusion) { constraints.inclusion.push(null) @@ -77,11 +80,6 @@ exports.validate = async ({ tableId, row, table }) => { } catch (err) { errors[fieldName] = [`Contains invalid JSON`] } - } else if (type === FieldTypes.FORMULA) { - res = validateJs.single( - processStringSync(table.schema[fieldName].formula, row), - constraints - ) } else { res = validateJs.single(row[fieldName], constraints) } From ed9c6c4ec8750bcb951ece4f4325307a76c80335 Mon Sep 17 00:00:00 2001 From: Rory Powell Date: Mon, 21 Feb 2022 15:27:51 +0000 Subject: [PATCH 2/3] Respect custom tenantIds in run migrations endpoint --- packages/backend-core/src/migrations/index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/backend-core/src/migrations/index.js b/packages/backend-core/src/migrations/index.js index 94ce6c78be..4d59f1925d 100644 --- a/packages/backend-core/src/migrations/index.js +++ b/packages/backend-core/src/migrations/index.js @@ -95,6 +95,8 @@ exports.runMigrations = async (CouchDB, migrations, options = {}) => { if (!options.tenantIds || !options.tenantIds.length) { // run for all tenants tenantIds = await getTenantIds() + } else { + tenantIds = options.tenantIds } } else { // single tenancy From f7d7f1693f6cb559394e75d53972e265051ac788 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Mon, 21 Feb 2022 16:10:18 +0000 Subject: [PATCH 3/3] v1.0.73 --- lerna.json | 2 +- packages/backend-core/package.json | 2 +- packages/bbui/package.json | 2 +- 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, 23 insertions(+), 23 deletions(-) diff --git a/lerna.json b/lerna.json index a4bb084916..ee364aec23 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.0.72", + "version": "1.0.73", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index 92ae1fd165..4e1e5b169b 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "1.0.72", + "version": "1.0.73", "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 537fc3f989..a0ab14d1ed 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.72", + "version": "1.0.73", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", diff --git a/packages/builder/package.json b/packages/builder/package.json index b17707f8fb..966f9d49fd 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.0.72", + "version": "1.0.73", "license": "GPL-3.0", "private": true, "scripts": { @@ -64,10 +64,10 @@ } }, "dependencies": { - "@budibase/bbui": "^1.0.72", - "@budibase/client": "^1.0.72", - "@budibase/frontend-core": "^1.0.72", - "@budibase/string-templates": "^1.0.72", + "@budibase/bbui": "^1.0.73", + "@budibase/client": "^1.0.73", + "@budibase/frontend-core": "^1.0.73", + "@budibase/string-templates": "^1.0.73", "@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 628fa2d287..6a7443f4ad 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "1.0.72", + "version": "1.0.73", "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 b88f490b2f..bd211b80c4 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "1.0.72", + "version": "1.0.73", "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.72", - "@budibase/frontend-core": "^1.0.72", - "@budibase/string-templates": "^1.0.72", + "@budibase/bbui": "^1.0.73", + "@budibase/frontend-core": "^1.0.73", + "@budibase/string-templates": "^1.0.73", "regexparam": "^1.3.0", "rollup-plugin-polyfill-node": "^0.8.0", "shortid": "^2.2.15", diff --git a/packages/frontend-core/package.json b/packages/frontend-core/package.json index 6a4524560b..5c782765e8 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "1.0.72", + "version": "1.0.73", "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.72", + "@budibase/bbui": "^1.0.73", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/server/package.json b/packages/server/package.json index 06de4a6bd5..964d6e42fd 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.72", + "version": "1.0.73", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -73,9 +73,9 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "^10.0.3", - "@budibase/backend-core": "^1.0.72", - "@budibase/client": "^1.0.72", - "@budibase/string-templates": "^1.0.72", + "@budibase/backend-core": "^1.0.73", + "@budibase/client": "^1.0.73", + "@budibase/string-templates": "^1.0.73", "@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 5ce1e2a51b..69a2b0422f 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "1.0.72", + "version": "1.0.73", "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 10dc284bbd..f901f8f74b 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.72", + "version": "1.0.73", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -34,8 +34,8 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "^1.0.72", - "@budibase/string-templates": "^1.0.72", + "@budibase/backend-core": "^1.0.73", + "@budibase/string-templates": "^1.0.73", "@koa/router": "^8.0.0", "@sentry/node": "^6.0.0", "@techpass/passport-openidconnect": "^0.3.0",