From 0143de5020d11c591d66cff3ff80451b0bdd4ab5 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Thu, 28 Apr 2022 16:35:38 +0100 Subject: [PATCH 1/7] Deregister field validation when unmounting form fields --- .../client/src/components/app/forms/Field.svelte | 6 +++++- .../client/src/components/app/forms/InnerForm.svelte | 12 ++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/packages/client/src/components/app/forms/Field.svelte b/packages/client/src/components/app/forms/Field.svelte index 3ebfc5084f..b267f6caff 100644 --- a/packages/client/src/components/app/forms/Field.svelte +++ b/packages/client/src/components/app/forms/Field.svelte @@ -44,7 +44,6 @@ fieldApi = value?.fieldApi fieldSchema = value?.fieldSchema }) - onDestroy(() => unsubscribe?.()) // Determine label class from position $: labelClass = labelPos === "above" ? "" : `spectrum-FieldLabel--${labelPos}` @@ -52,6 +51,11 @@ const updateLabel = e => { builderStore.actions.updateProp("label", e.target.textContent) } + + onDestroy(() => { + fieldApi?.deregister() + unsubscribe?.() + }) diff --git a/packages/client/src/components/app/forms/InnerForm.svelte b/packages/client/src/components/app/forms/InnerForm.svelte index 99dcbf4d5e..752bc9a2eb 100644 --- a/packages/client/src/components/app/forms/InnerForm.svelte +++ b/packages/client/src/components/app/forms/InnerForm.svelte @@ -329,6 +329,17 @@ } } + // We don't want to actually remove the field state when deregistering, just + // remove any errors and validation + const deregister = () => { + const fieldInfo = getField(field) + fieldInfo.update(state => { + state.fieldState.validator = null + state.fieldState.error = null + return state + }) + } + // Updates the disabled state of a certain field const setDisabled = fieldDisabled => { const fieldInfo = getField(field) @@ -348,6 +359,7 @@ reset, updateValidation, setDisabled, + deregister, validate: () => { // Validate the field by force setting the same value again const { fieldState } = get(getField(field)) From 075cd99f94b0a9a696aeab48ae0ba1a386d2a322 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Wed, 4 May 2022 12:25:09 +0000 Subject: [PATCH 2/7] v1.0.139 --- 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 2f7203e4cf..096cc2fe9e 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.0.138", + "version": "1.0.139", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index 9ab70185e0..e70980bacd 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "1.0.138", + "version": "1.0.139", "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 b6283ab345..996150d32f 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.138", + "version": "1.0.139", "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.138", + "@budibase/string-templates": "^1.0.139", "@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 7c28ee850b..3a9874b2c4 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.0.138", + "version": "1.0.139", "license": "GPL-3.0", "private": true, "scripts": { @@ -67,10 +67,10 @@ } }, "dependencies": { - "@budibase/bbui": "^1.0.138", - "@budibase/client": "^1.0.138", - "@budibase/frontend-core": "^1.0.138", - "@budibase/string-templates": "^1.0.138", + "@budibase/bbui": "^1.0.139", + "@budibase/client": "^1.0.139", + "@budibase/frontend-core": "^1.0.139", + "@budibase/string-templates": "^1.0.139", "@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 d15a2d1b14..b697117c0c 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "1.0.138", + "version": "1.0.139", "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 128c4f66a5..69aadb6e10 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "1.0.138", + "version": "1.0.139", "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.138", - "@budibase/frontend-core": "^1.0.138", - "@budibase/string-templates": "^1.0.138", + "@budibase/bbui": "^1.0.139", + "@budibase/frontend-core": "^1.0.139", + "@budibase/string-templates": "^1.0.139", "@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 2f54e127cb..d37723d5ba 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "1.0.138", + "version": "1.0.139", "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.138", + "@budibase/bbui": "^1.0.139", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/server/package.json b/packages/server/package.json index 9307a7358d..e2ae8b4464 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.138", + "version": "1.0.139", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -68,10 +68,10 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "^10.0.3", - "@budibase/backend-core": "^1.0.138", - "@budibase/client": "^1.0.138", + "@budibase/backend-core": "^1.0.139", + "@budibase/client": "^1.0.139", "@budibase/pro": "1.0.138", - "@budibase/string-templates": "^1.0.138", + "@budibase/string-templates": "^1.0.139", "@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 7b6071d639..d4de4e712c 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "1.0.138", + "version": "1.0.139", "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 03282f44c0..bd42a424e0 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.138", + "version": "1.0.139", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -31,9 +31,9 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "^1.0.138", + "@budibase/backend-core": "^1.0.139", "@budibase/pro": "1.0.138", - "@budibase/string-templates": "^1.0.138", + "@budibase/string-templates": "^1.0.139", "@koa/router": "^8.0.0", "@sentry/node": "6.17.7", "@techpass/passport-openidconnect": "^0.3.0", From dfbedb9a8a4ca1f20709d5ae57734c29a3ee361a Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Wed, 4 May 2022 13:25:46 +0100 Subject: [PATCH 3/7] account for objects in failure condition --- packages/server/src/threads/automation.js | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/packages/server/src/threads/automation.js b/packages/server/src/threads/automation.js index 63a3ea8bf3..16a230e263 100644 --- a/packages/server/src/threads/automation.js +++ b/packages/server/src/threads/automation.js @@ -144,6 +144,7 @@ class Orchestrator { (loopStep.inputs.option === "String" && typeof newInput.binding !== "string") ) { + console.log("hello") this.updateContextAndOutput(loopStepNumber, step, tempOutput, { status: AutomationErrors.INCORRECT_TYPE, success: false, @@ -191,7 +192,6 @@ class Orchestrator { } } } - if ( index === parseInt(env.AUTOMATION_MAX_ITERATIONS) || index === loopStep.inputs.iterations @@ -205,10 +205,26 @@ class Orchestrator { break } + let isFailure = false if ( - this._context.steps[loopStepNumber]?.currentItem === - loopStep.inputs.failure + typeof this._context.steps[loopStepNumber]?.currentItem === "object" ) { + isFailure = Object.keys( + this._context.steps[loopStepNumber].currentItem + ).some(value => { + return ( + this._context.steps[loopStepNumber].currentItem[value] === + loopStep.inputs.failure + ) + }) + } else { + isFailure = + this._context.steps[loopStepNumber]?.currentItem === + loopStep.inputs.failure + } + console.log(isFailure) + + if (isFailure) { this.updateContextAndOutput(loopStepNumber, step, tempOutput, { status: AutomationErrors.FAILURE_CONDITION, success: false, From fb33fedeee7061fd844314c10251f0b04f0776de Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Wed, 4 May 2022 12:26:31 +0000 Subject: [PATCH 4/7] Update pro version to 1.0.139 --- packages/server/package.json | 2 +- packages/worker/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/server/package.json b/packages/server/package.json index e2ae8b4464..211c956543 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -70,7 +70,7 @@ "@apidevtools/swagger-parser": "^10.0.3", "@budibase/backend-core": "^1.0.139", "@budibase/client": "^1.0.139", - "@budibase/pro": "1.0.138", + "@budibase/pro": "1.0.139", "@budibase/string-templates": "^1.0.139", "@bull-board/api": "^3.7.0", "@bull-board/koa": "^3.7.0", diff --git a/packages/worker/package.json b/packages/worker/package.json index bd42a424e0..db029d8850 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -32,7 +32,7 @@ "license": "GPL-3.0", "dependencies": { "@budibase/backend-core": "^1.0.139", - "@budibase/pro": "1.0.138", + "@budibase/pro": "1.0.139", "@budibase/string-templates": "^1.0.139", "@koa/router": "^8.0.0", "@sentry/node": "6.17.7", From 65c97c331ba7a4e67c5e0587bc046b20e246f762 Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Wed, 4 May 2022 13:30:08 +0100 Subject: [PATCH 5/7] remove log --- packages/server/src/threads/automation.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/server/src/threads/automation.js b/packages/server/src/threads/automation.js index 16a230e263..98c45e4af3 100644 --- a/packages/server/src/threads/automation.js +++ b/packages/server/src/threads/automation.js @@ -144,7 +144,6 @@ class Orchestrator { (loopStep.inputs.option === "String" && typeof newInput.binding !== "string") ) { - console.log("hello") this.updateContextAndOutput(loopStepNumber, step, tempOutput, { status: AutomationErrors.INCORRECT_TYPE, success: false, @@ -222,7 +221,6 @@ class Orchestrator { this._context.steps[loopStepNumber]?.currentItem === loopStep.inputs.failure } - console.log(isFailure) if (isFailure) { this.updateContextAndOutput(loopStepNumber, step, tempOutput, { From c2cf200413cc49faebca0bca9508f645417c2051 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Wed, 4 May 2022 12:40:27 +0000 Subject: [PATCH 6/7] v1.0.140 --- 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 096cc2fe9e..a6ef43f669 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.0.139", + "version": "1.0.140", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index e70980bacd..d2b359835e 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "1.0.139", + "version": "1.0.140", "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 996150d32f..387ae0b7d8 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.139", + "version": "1.0.140", "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.139", + "@budibase/string-templates": "^1.0.140", "@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 3a9874b2c4..eb909c72fd 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.0.139", + "version": "1.0.140", "license": "GPL-3.0", "private": true, "scripts": { @@ -67,10 +67,10 @@ } }, "dependencies": { - "@budibase/bbui": "^1.0.139", - "@budibase/client": "^1.0.139", - "@budibase/frontend-core": "^1.0.139", - "@budibase/string-templates": "^1.0.139", + "@budibase/bbui": "^1.0.140", + "@budibase/client": "^1.0.140", + "@budibase/frontend-core": "^1.0.140", + "@budibase/string-templates": "^1.0.140", "@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 b697117c0c..b28a3bfb1a 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "1.0.139", + "version": "1.0.140", "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 69aadb6e10..75b4c62e8e 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "1.0.139", + "version": "1.0.140", "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.139", - "@budibase/frontend-core": "^1.0.139", - "@budibase/string-templates": "^1.0.139", + "@budibase/bbui": "^1.0.140", + "@budibase/frontend-core": "^1.0.140", + "@budibase/string-templates": "^1.0.140", "@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 d37723d5ba..33d5c974f6 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "1.0.139", + "version": "1.0.140", "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.139", + "@budibase/bbui": "^1.0.140", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/server/package.json b/packages/server/package.json index 211c956543..97397c4a26 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.139", + "version": "1.0.140", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -68,10 +68,10 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "^10.0.3", - "@budibase/backend-core": "^1.0.139", - "@budibase/client": "^1.0.139", + "@budibase/backend-core": "^1.0.140", + "@budibase/client": "^1.0.140", "@budibase/pro": "1.0.139", - "@budibase/string-templates": "^1.0.139", + "@budibase/string-templates": "^1.0.140", "@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 d4de4e712c..81d4fb96b5 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "1.0.139", + "version": "1.0.140", "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 db029d8850..d6590f4970 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.139", + "version": "1.0.140", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -31,9 +31,9 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "^1.0.139", + "@budibase/backend-core": "^1.0.140", "@budibase/pro": "1.0.139", - "@budibase/string-templates": "^1.0.139", + "@budibase/string-templates": "^1.0.140", "@koa/router": "^8.0.0", "@sentry/node": "6.17.7", "@techpass/passport-openidconnect": "^0.3.0", From 9f705acdb589d61327471ce965febd6f08fb0611 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Wed, 4 May 2022 12:41:57 +0000 Subject: [PATCH 7/7] Update pro version to 1.0.140 --- packages/server/package.json | 2 +- packages/worker/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/server/package.json b/packages/server/package.json index 97397c4a26..97c745b8ba 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -70,7 +70,7 @@ "@apidevtools/swagger-parser": "^10.0.3", "@budibase/backend-core": "^1.0.140", "@budibase/client": "^1.0.140", - "@budibase/pro": "1.0.139", + "@budibase/pro": "1.0.140", "@budibase/string-templates": "^1.0.140", "@bull-board/api": "^3.7.0", "@bull-board/koa": "^3.7.0", diff --git a/packages/worker/package.json b/packages/worker/package.json index d6590f4970..873ddb0786 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -32,7 +32,7 @@ "license": "GPL-3.0", "dependencies": { "@budibase/backend-core": "^1.0.140", - "@budibase/pro": "1.0.139", + "@budibase/pro": "1.0.140", "@budibase/string-templates": "^1.0.140", "@koa/router": "^8.0.0", "@sentry/node": "6.17.7",