From 592d9f2787bdb1d4b99ca467ef5eee7221aff69f Mon Sep 17 00:00:00 2001 From: Joe <49767913+joebudi@users.noreply.github.com> Date: Wed, 23 Jun 2021 11:59:57 +0100 Subject: [PATCH 01/31] Update README.md --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 10757a6a8e..2e6b446ad7 100644 --- a/README.md +++ b/README.md @@ -71,8 +71,7 @@
-## 🏁 Getting Started with Budibase in 5 minutes - +## 🏁 Get started Currently there are two ways to get started with Budibase; Digital Ocean, and Docker.

@@ -143,7 +142,7 @@ If you have a question or would like to talk with other Budibase users and join
-## ❗ Code of Conduct +## ❗ Code of conduct Budibase is dedicated to providing a welcoming, diverse, and harrassment-free experience for everyone. We expect everyone in the Budibase community to abide by our [**Code of Conduct**](https://github.com/Budibase/budibase/blob/HEAD/.github/CODE_OF_CONDUCT.md). Please read it.
From 157208ea76bf9aa51aa880e620fef78c87a7e22b Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Wed, 23 Jun 2021 11:09:48 +0000 Subject: [PATCH 02/31] v0.9.59 --- lerna.json | 2 +- packages/auth/package.json | 2 +- packages/bbui/package.json | 2 +- packages/builder/package.json | 8 ++++---- packages/cli/package.json | 2 +- packages/client/package.json | 8 ++++---- packages/server/package.json | 10 +++++----- packages/standard-components/package.json | 4 ++-- 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 8282497a6c..e75391dd48 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "0.9.58", + "version": "0.9.59", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/auth/package.json b/packages/auth/package.json index f750f5a8db..bee9f365d3 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/auth", - "version": "0.9.58", + "version": "0.9.59", "description": "Authentication middlewares for budibase builder and apps", "main": "src/index.js", "author": "Budibase", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 7420cf7599..7774d829ca 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": "0.9.58", + "version": "0.9.59", "license": "AGPL-3.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", diff --git a/packages/builder/package.json b/packages/builder/package.json index 2816cbb72d..9c6a68f1e0 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "0.9.58", + "version": "0.9.59", "license": "AGPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^0.9.58", - "@budibase/client": "^0.9.58", + "@budibase/bbui": "^0.9.59", + "@budibase/client": "^0.9.59", "@budibase/colorpicker": "1.1.2", - "@budibase/string-templates": "^0.9.58", + "@budibase/string-templates": "^0.9.59", "@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 4267fb3f4f..b274ff8ac7 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "0.9.58", + "version": "0.9.59", "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 b8c5c41e0c..88cccb2a4d 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "0.9.58", + "version": "0.9.59", "license": "MPL-2.0", "module": "dist/budibase-client.js", "main": "dist/budibase-client.js", @@ -18,9 +18,9 @@ "dev:builder": "rollup -cw" }, "dependencies": { - "@budibase/bbui": "^0.9.58", - "@budibase/standard-components": "^0.9.58", - "@budibase/string-templates": "^0.9.58", + "@budibase/bbui": "^0.9.59", + "@budibase/standard-components": "^0.9.59", + "@budibase/string-templates": "^0.9.59", "regexparam": "^1.3.0", "shortid": "^2.2.15", "svelte-spa-router": "^3.0.5" diff --git a/packages/server/package.json b/packages/server/package.json index 2dd963c2c1..0b109c23bf 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "0.9.58", + "version": "0.9.59", "description": "Budibase Web Server", "main": "src/electron.js", "repository": { @@ -55,9 +55,9 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.58", - "@budibase/client": "^0.9.58", - "@budibase/string-templates": "^0.9.58", + "@budibase/auth": "^0.9.59", + "@budibase/client": "^0.9.59", + "@budibase/string-templates": "^0.9.59", "@elastic/elasticsearch": "7.10.0", "@koa/router": "8.0.0", "@sendgrid/mail": "7.1.1", @@ -110,7 +110,7 @@ "devDependencies": { "@babel/core": "^7.14.3", "@babel/preset-env": "^7.14.4", - "@budibase/standard-components": "^0.9.58", + "@budibase/standard-components": "^0.9.59", "@jest/test-sequencer": "^24.8.0", "babel-jest": "^27.0.2", "docker-compose": "^0.23.6", diff --git a/packages/standard-components/package.json b/packages/standard-components/package.json index 1cdcffcff1..c2fb82ba73 100644 --- a/packages/standard-components/package.json +++ b/packages/standard-components/package.json @@ -29,11 +29,11 @@ "keywords": [ "svelte" ], - "version": "0.9.58", + "version": "0.9.59", "license": "MIT", "gitHead": "d1836a898cab3f8ab80ee6d8f42be1a9eed7dcdc", "dependencies": { - "@budibase/bbui": "^0.9.58", + "@budibase/bbui": "^0.9.59", "@spectrum-css/link": "^3.1.3", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index 5fa3aece01..2e4f17ef51 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "0.9.58", + "version": "0.9.59", "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 8bb313355f..e1f947ebd6 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "0.9.58", + "version": "0.9.59", "description": "Budibase background service", "main": "src/index.js", "repository": { @@ -21,8 +21,8 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.58", - "@budibase/string-templates": "^0.9.58", + "@budibase/auth": "^0.9.59", + "@budibase/string-templates": "^0.9.59", "@koa/router": "^8.0.0", "aws-sdk": "^2.811.0", "bcryptjs": "^2.4.3", From efe1866dbed3f32188a18bc19f99d325834b972b Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Wed, 23 Jun 2021 12:44:54 +0100 Subject: [PATCH 03/31] Fixing an issue I found with postgres schema generator, it was applying all primary keys to all tables. --- .../server/scripts/integrations/postgres/init.sql | 10 +++++++++- packages/server/src/integrations/postgres.js | 13 ++++++++----- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/packages/server/scripts/integrations/postgres/init.sql b/packages/server/scripts/integrations/postgres/init.sql index baa7022f87..8d76f54a10 100644 --- a/packages/server/scripts/integrations/postgres/init.sql +++ b/packages/server/scripts/integrations/postgres/init.sql @@ -1,9 +1,17 @@ SELECT 'CREATE DATABASE main' WHERE NOT EXISTS (SELECT FROM pg_database WHERE datname = 'main')\gexec CREATE TABLE Persons ( - PersonID int NOT NULL PRIMARY KEY, + PersonID INT NOT NULL PRIMARY KEY, LastName varchar(255), FirstName varchar(255), Address varchar(255), City varchar(255) ); +CREATE TABLE Tasks ( + TaskID INT NOT NULL PRIMARY KEY, + PersonID INT, + TaskName varchar(255), + CONSTRAINT fkPersons + FOREIGN KEY(PersonID) + REFERENCES Persons(PersonID) +); diff --git a/packages/server/src/integrations/postgres.js b/packages/server/src/integrations/postgres.js index 94cdad30ed..6266e6ca64 100644 --- a/packages/server/src/integrations/postgres.js +++ b/packages/server/src/integrations/postgres.js @@ -118,15 +118,18 @@ class PostgresIntegration extends Sql { * @param {*} datasourceId - datasourceId to fetch */ async buildSchema(datasourceId) { - let keys = [] + let tableKeys = {} try { const primaryKeysResponse = await this.client.query(this.PRIMARY_KEYS_SQL) for (let table of primaryKeysResponse.rows) { - keys.push(table.column_name || table.primary_key) + const tableName = table.table_name + if (!tableKeys[tableName]) { + tableKeys[tableName] = [] + } + tableKeys[tableName].push(table.column_name || table.primary_key) } } catch (err) { - // TODO: this try catch method isn't right - keys = ["id"] + tableKeys = {} } const columnsResponse = await this.client.query(this.COLUMNS_SQL) @@ -140,7 +143,7 @@ class PostgresIntegration extends Sql { if (!tables[tableName]) { tables[tableName] = { _id: buildExternalTableId(datasourceId, tableName), - primary: keys, + primary: tableKeys[tableName] || ["id"], name: tableName, schema: {}, } From 6d822ee4c254d23b595c6e1f81611b7bb9a99ca1 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Wed, 23 Jun 2021 12:53:57 +0000 Subject: [PATCH 04/31] v0.9.60 --- lerna.json | 2 +- packages/auth/package.json | 2 +- packages/bbui/package.json | 2 +- packages/builder/package.json | 8 ++++---- packages/cli/package.json | 2 +- packages/client/package.json | 8 ++++---- packages/server/package.json | 10 +++++----- packages/standard-components/package.json | 4 ++-- 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 e75391dd48..940bc56d25 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "0.9.59", + "version": "0.9.60", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/auth/package.json b/packages/auth/package.json index bee9f365d3..1c58cccd9f 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/auth", - "version": "0.9.59", + "version": "0.9.60", "description": "Authentication middlewares for budibase builder and apps", "main": "src/index.js", "author": "Budibase", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 7774d829ca..ea85d20296 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": "0.9.59", + "version": "0.9.60", "license": "AGPL-3.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", diff --git a/packages/builder/package.json b/packages/builder/package.json index 9c6a68f1e0..727ad9edb1 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "0.9.59", + "version": "0.9.60", "license": "AGPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^0.9.59", - "@budibase/client": "^0.9.59", + "@budibase/bbui": "^0.9.60", + "@budibase/client": "^0.9.60", "@budibase/colorpicker": "1.1.2", - "@budibase/string-templates": "^0.9.59", + "@budibase/string-templates": "^0.9.60", "@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 b274ff8ac7..810cc05377 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "0.9.59", + "version": "0.9.60", "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 88cccb2a4d..dc1a717018 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "0.9.59", + "version": "0.9.60", "license": "MPL-2.0", "module": "dist/budibase-client.js", "main": "dist/budibase-client.js", @@ -18,9 +18,9 @@ "dev:builder": "rollup -cw" }, "dependencies": { - "@budibase/bbui": "^0.9.59", - "@budibase/standard-components": "^0.9.59", - "@budibase/string-templates": "^0.9.59", + "@budibase/bbui": "^0.9.60", + "@budibase/standard-components": "^0.9.60", + "@budibase/string-templates": "^0.9.60", "regexparam": "^1.3.0", "shortid": "^2.2.15", "svelte-spa-router": "^3.0.5" diff --git a/packages/server/package.json b/packages/server/package.json index 0b109c23bf..216f9b438c 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "0.9.59", + "version": "0.9.60", "description": "Budibase Web Server", "main": "src/electron.js", "repository": { @@ -55,9 +55,9 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.59", - "@budibase/client": "^0.9.59", - "@budibase/string-templates": "^0.9.59", + "@budibase/auth": "^0.9.60", + "@budibase/client": "^0.9.60", + "@budibase/string-templates": "^0.9.60", "@elastic/elasticsearch": "7.10.0", "@koa/router": "8.0.0", "@sendgrid/mail": "7.1.1", @@ -110,7 +110,7 @@ "devDependencies": { "@babel/core": "^7.14.3", "@babel/preset-env": "^7.14.4", - "@budibase/standard-components": "^0.9.59", + "@budibase/standard-components": "^0.9.60", "@jest/test-sequencer": "^24.8.0", "babel-jest": "^27.0.2", "docker-compose": "^0.23.6", diff --git a/packages/standard-components/package.json b/packages/standard-components/package.json index c2fb82ba73..7697275e85 100644 --- a/packages/standard-components/package.json +++ b/packages/standard-components/package.json @@ -29,11 +29,11 @@ "keywords": [ "svelte" ], - "version": "0.9.59", + "version": "0.9.60", "license": "MIT", "gitHead": "d1836a898cab3f8ab80ee6d8f42be1a9eed7dcdc", "dependencies": { - "@budibase/bbui": "^0.9.59", + "@budibase/bbui": "^0.9.60", "@spectrum-css/link": "^3.1.3", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index 2e4f17ef51..8b7be42ae3 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "0.9.59", + "version": "0.9.60", "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 e1f947ebd6..141dad5bb9 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "0.9.59", + "version": "0.9.60", "description": "Budibase background service", "main": "src/index.js", "repository": { @@ -21,8 +21,8 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.59", - "@budibase/string-templates": "^0.9.59", + "@budibase/auth": "^0.9.60", + "@budibase/string-templates": "^0.9.60", "@koa/router": "^8.0.0", "aws-sdk": "^2.811.0", "bcryptjs": "^2.4.3", From 1dbc56adf4971498e860a726c795430fe451ee24 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Wed, 23 Jun 2021 19:28:33 +0100 Subject: [PATCH 05/31] Fixing some issues discovered with POSTing JSON. --- .../src/automations/steps/outgoingWebhook.js | 23 ++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/packages/server/src/automations/steps/outgoingWebhook.js b/packages/server/src/automations/steps/outgoingWebhook.js index f476d57ac5..3e56834d3f 100644 --- a/packages/server/src/automations/steps/outgoingWebhook.js +++ b/packages/server/src/automations/steps/outgoingWebhook.js @@ -77,14 +77,31 @@ module.exports.run = async function ({ inputs }) { requestBody.length !== 0 && BODY_REQUESTS.indexOf(requestMethod) !== -1 ) { - request.body = JSON.parse(requestBody) + request.body = requestBody + request.headers = { + "Content-Type": "application/json", + } } try { + // do a quick JSON parse if there is a body, to generate an error if its invalid + if (request.body) { + JSON.parse(request.body) + } const response = await fetch(url, request) + const contentType = response.headers.get("content-type") + const success = response.status === 200 + let resp + if (!success) { + resp = response.statusText + } else if (contentType && contentType.indexOf("application/json") !== -1) { + resp = await response.json() + } else { + resp = await response.text() + } return { - response: await response.json(), - success: response.status === 200, + response: resp, + success: success, } } catch (err) { /* istanbul ignore next */ From 6e0f18de87401beb4a3f07921a890211883a883e Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Wed, 23 Jun 2021 20:11:05 +0100 Subject: [PATCH 06/31] Fixing issue with automation webhook URL being undefined. --- .../Shared/CreateWebhookModal.svelte | 12 +++--- .../automation/Shared/WebhookDisplay.svelte | 3 ++ .../server/src/api/controllers/automation.js | 37 ++++++++++++------- 3 files changed, 33 insertions(+), 19 deletions(-) diff --git a/packages/builder/src/components/automation/Shared/CreateWebhookModal.svelte b/packages/builder/src/components/automation/Shared/CreateWebhookModal.svelte index 44e91efd50..04656c1e2e 100644 --- a/packages/builder/src/components/automation/Shared/CreateWebhookModal.svelte +++ b/packages/builder/src/components/automation/Shared/CreateWebhookModal.svelte @@ -16,11 +16,13 @@ $: automation = $automationStore.selectedAutomation?.automation onMount(async () => { - // save the automation initially - await automationStore.actions.save({ - instanceId, - automation, - }) + if (!automation?.definition?.trigger?.inputs.schemaUrl) { + // save the automation initially + await automationStore.actions.save({ + instanceId, + automation, + }) + } interval = setInterval(async () => { await automationStore.actions.fetch() const outputs = automation?.definition?.trigger.schema.outputs?.properties diff --git a/packages/builder/src/components/automation/Shared/WebhookDisplay.svelte b/packages/builder/src/components/automation/Shared/WebhookDisplay.svelte index e1f2fe78d8..fc5e20f241 100644 --- a/packages/builder/src/components/automation/Shared/WebhookDisplay.svelte +++ b/packages/builder/src/components/automation/Shared/WebhookDisplay.svelte @@ -9,6 +9,9 @@ $: appUrl = $hostingStore.appUrl function fullWebhookURL(uri) { + if (!uri) { + return "" + } if (production) { return `${appUrl}/${uri}` } else { diff --git a/packages/server/src/api/controllers/automation.js b/packages/server/src/api/controllers/automation.js index e1e721b347..2d164b415d 100644 --- a/packages/server/src/api/controllers/automation.js +++ b/packages/server/src/api/controllers/automation.js @@ -88,6 +88,8 @@ async function checkForCronTriggers({ appId, oldAuto, newAuto }) { async function checkForWebhooks({ appId, oldAuto, newAuto }) { const oldTrigger = oldAuto ? oldAuto.definition.trigger : null const newTrigger = newAuto ? newAuto.definition.trigger : null + const triggerChanged = + oldTrigger && newTrigger && oldTrigger.id !== newTrigger.id function isWebhookTrigger(auto) { return ( auto && @@ -98,25 +100,32 @@ async function checkForWebhooks({ appId, oldAuto, newAuto }) { // need to delete webhook if ( isWebhookTrigger(oldAuto) && - !isWebhookTrigger(newAuto) && + (!isWebhookTrigger(newAuto) || triggerChanged) && oldTrigger.webhookId ) { - let db = new CouchDB(appId) - // need to get the webhook to get the rev - const webhook = await db.get(oldTrigger.webhookId) - const ctx = { - appId, - params: { id: webhook._id, rev: webhook._rev }, + try { + let db = new CouchDB(appId) + // need to get the webhook to get the rev + const webhook = await db.get(oldTrigger.webhookId) + const ctx = { + appId, + params: { id: webhook._id, rev: webhook._rev }, + } + // might be updating - reset the inputs to remove the URLs + if (newTrigger) { + delete newTrigger.webhookId + newTrigger.inputs = {} + } + await webhooks.destroy(ctx) + } catch (err) { + // don't worry about not being able to delete, if it doesn't exist all good } - // might be updating - reset the inputs to remove the URLs - if (newTrigger) { - delete newTrigger.webhookId - newTrigger.inputs = {} - } - await webhooks.destroy(ctx) } // need to create webhook - else if (!isWebhookTrigger(oldAuto) && isWebhookTrigger(newAuto)) { + if ( + (!isWebhookTrigger(oldAuto) || triggerChanged) && + isWebhookTrigger(newAuto) + ) { const ctx = { appId, request: { From bfc4a7cc7ba556e8220e05f26ed269caf6380a49 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Wed, 23 Jun 2021 20:18:21 +0100 Subject: [PATCH 07/31] Fixing test case and removing console.log. --- .../automation/AutomationBuilder/FlowChart/FlowItem.svelte | 1 - packages/server/__mocks__/node-fetch.js | 5 +++++ packages/server/src/automations/steps/outgoingWebhook.js | 5 ++++- .../server/src/automations/tests/outgoingWebhook.spec.js | 2 +- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItem.svelte b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItem.svelte index 45594c0f0d..439db62639 100644 --- a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItem.svelte +++ b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItem.svelte @@ -14,7 +14,6 @@ $: allowDeleteTrigger = !steps.length function deleteStep() { - console.log("Running") automationStore.actions.deleteAutomationBlock(block) } diff --git a/packages/server/__mocks__/node-fetch.js b/packages/server/__mocks__/node-fetch.js index dfca7fd379..a06d026f38 100644 --- a/packages/server/__mocks__/node-fetch.js +++ b/packages/server/__mocks__/node-fetch.js @@ -4,6 +4,11 @@ module.exports = async (url, opts) => { function json(body, status = 200) { return { status, + headers: { + get: () => { + return ["application/json"] + }, + }, json: async () => { return body }, diff --git a/packages/server/src/automations/steps/outgoingWebhook.js b/packages/server/src/automations/steps/outgoingWebhook.js index 3e56834d3f..269e075018 100644 --- a/packages/server/src/automations/steps/outgoingWebhook.js +++ b/packages/server/src/automations/steps/outgoingWebhook.js @@ -77,7 +77,10 @@ module.exports.run = async function ({ inputs }) { requestBody.length !== 0 && BODY_REQUESTS.indexOf(requestMethod) !== -1 ) { - request.body = requestBody + request.body = + typeof requestBody === "string" + ? requestBody + : JSON.stringify(requestBody) request.headers = { "Content-Type": "application/json", } diff --git a/packages/server/src/automations/tests/outgoingWebhook.spec.js b/packages/server/src/automations/tests/outgoingWebhook.spec.js index f1d8d25ba8..9f82fb7604 100644 --- a/packages/server/src/automations/tests/outgoingWebhook.spec.js +++ b/packages/server/src/automations/tests/outgoingWebhook.spec.js @@ -25,7 +25,7 @@ describe("test the outgoing webhook action", () => { expect(res.success).toEqual(true) expect(res.response.url).toEqual("http://www.test.com") expect(res.response.method).toEqual("POST") - expect(res.response.body.a).toEqual(1) + expect(JSON.parse(res.response.body).a).toEqual(1) }) it("should return an error if something goes wrong in fetch", async () => { From 4af9574178637fdadd0dcf17906bfad03ebbdfe3 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Wed, 23 Jun 2021 19:53:30 +0000 Subject: [PATCH 08/31] v0.9.61 --- lerna.json | 2 +- packages/auth/package.json | 2 +- packages/bbui/package.json | 2 +- packages/builder/package.json | 8 ++++---- packages/cli/package.json | 2 +- packages/client/package.json | 8 ++++---- packages/server/package.json | 10 +++++----- packages/standard-components/package.json | 4 ++-- 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 940bc56d25..2f2d34f6d1 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "0.9.60", + "version": "0.9.61", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/auth/package.json b/packages/auth/package.json index 1c58cccd9f..30c3565d64 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/auth", - "version": "0.9.60", + "version": "0.9.61", "description": "Authentication middlewares for budibase builder and apps", "main": "src/index.js", "author": "Budibase", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index ea85d20296..264a291c52 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": "0.9.60", + "version": "0.9.61", "license": "AGPL-3.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", diff --git a/packages/builder/package.json b/packages/builder/package.json index 727ad9edb1..8b067ba287 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "0.9.60", + "version": "0.9.61", "license": "AGPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^0.9.60", - "@budibase/client": "^0.9.60", + "@budibase/bbui": "^0.9.61", + "@budibase/client": "^0.9.61", "@budibase/colorpicker": "1.1.2", - "@budibase/string-templates": "^0.9.60", + "@budibase/string-templates": "^0.9.61", "@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 810cc05377..2da2c3da67 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "0.9.60", + "version": "0.9.61", "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 dc1a717018..b810d256f0 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "0.9.60", + "version": "0.9.61", "license": "MPL-2.0", "module": "dist/budibase-client.js", "main": "dist/budibase-client.js", @@ -18,9 +18,9 @@ "dev:builder": "rollup -cw" }, "dependencies": { - "@budibase/bbui": "^0.9.60", - "@budibase/standard-components": "^0.9.60", - "@budibase/string-templates": "^0.9.60", + "@budibase/bbui": "^0.9.61", + "@budibase/standard-components": "^0.9.61", + "@budibase/string-templates": "^0.9.61", "regexparam": "^1.3.0", "shortid": "^2.2.15", "svelte-spa-router": "^3.0.5" diff --git a/packages/server/package.json b/packages/server/package.json index 216f9b438c..ed77b961c7 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "0.9.60", + "version": "0.9.61", "description": "Budibase Web Server", "main": "src/electron.js", "repository": { @@ -55,9 +55,9 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.60", - "@budibase/client": "^0.9.60", - "@budibase/string-templates": "^0.9.60", + "@budibase/auth": "^0.9.61", + "@budibase/client": "^0.9.61", + "@budibase/string-templates": "^0.9.61", "@elastic/elasticsearch": "7.10.0", "@koa/router": "8.0.0", "@sendgrid/mail": "7.1.1", @@ -110,7 +110,7 @@ "devDependencies": { "@babel/core": "^7.14.3", "@babel/preset-env": "^7.14.4", - "@budibase/standard-components": "^0.9.60", + "@budibase/standard-components": "^0.9.61", "@jest/test-sequencer": "^24.8.0", "babel-jest": "^27.0.2", "docker-compose": "^0.23.6", diff --git a/packages/standard-components/package.json b/packages/standard-components/package.json index 7697275e85..b52f9f8171 100644 --- a/packages/standard-components/package.json +++ b/packages/standard-components/package.json @@ -29,11 +29,11 @@ "keywords": [ "svelte" ], - "version": "0.9.60", + "version": "0.9.61", "license": "MIT", "gitHead": "d1836a898cab3f8ab80ee6d8f42be1a9eed7dcdc", "dependencies": { - "@budibase/bbui": "^0.9.60", + "@budibase/bbui": "^0.9.61", "@spectrum-css/link": "^3.1.3", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index 8b7be42ae3..7d49453a8c 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "0.9.60", + "version": "0.9.61", "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 141dad5bb9..bce3b7a510 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "0.9.60", + "version": "0.9.61", "description": "Budibase background service", "main": "src/index.js", "repository": { @@ -21,8 +21,8 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.60", - "@budibase/string-templates": "^0.9.60", + "@budibase/auth": "^0.9.61", + "@budibase/string-templates": "^0.9.61", "@koa/router": "^8.0.0", "aws-sdk": "^2.811.0", "bcryptjs": "^2.4.3", From f6549b0c7f00879f0d49831e09e1a3afcc585783 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Wed, 23 Jun 2021 23:15:16 +0100 Subject: [PATCH 09/31] string based keyProps not being parsed properly by handlebars --- packages/server/src/integrations/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/server/src/integrations/utils.js b/packages/server/src/integrations/utils.js index d3deb50963..1829ff4124 100644 --- a/packages/server/src/integrations/utils.js +++ b/packages/server/src/integrations/utils.js @@ -24,7 +24,7 @@ exports.generateRowIdField = (keyProps = []) => { keyProps = [keyProps] } // this conserves order and types - return encodeURIComponent(JSON.stringify(keyProps)) + return encodeURIComponent(JSON.stringify(keyProps).replace(/"/g, '')) } // should always return an array From 85121db2c53942b1bd1af2e8aee2b2579953e1a7 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Wed, 23 Jun 2021 23:19:41 +0100 Subject: [PATCH 10/31] fix external data sources key parsing with double quote strings --- packages/server/src/integrations/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/server/src/integrations/utils.js b/packages/server/src/integrations/utils.js index 1829ff4124..cb2bbab365 100644 --- a/packages/server/src/integrations/utils.js +++ b/packages/server/src/integrations/utils.js @@ -24,7 +24,7 @@ exports.generateRowIdField = (keyProps = []) => { keyProps = [keyProps] } // this conserves order and types - return encodeURIComponent(JSON.stringify(keyProps).replace(/"/g, '')) + return encodeURIComponent(JSON.stringify(keyProps).replace(/"/g, "")) } // should always return an array From 53a2707086e6627621eb4c164cae21e63b827810 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Wed, 23 Jun 2021 22:27:33 +0000 Subject: [PATCH 11/31] v0.9.62 --- lerna.json | 2 +- packages/auth/package.json | 2 +- packages/bbui/package.json | 2 +- packages/builder/package.json | 8 ++++---- packages/cli/package.json | 2 +- packages/client/package.json | 8 ++++---- packages/server/package.json | 10 +++++----- packages/standard-components/package.json | 4 ++-- 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 2f2d34f6d1..5f3f5e48d9 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "0.9.61", + "version": "0.9.62", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/auth/package.json b/packages/auth/package.json index 30c3565d64..5b8903bb2d 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/auth", - "version": "0.9.61", + "version": "0.9.62", "description": "Authentication middlewares for budibase builder and apps", "main": "src/index.js", "author": "Budibase", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 264a291c52..a4ca564fb0 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": "0.9.61", + "version": "0.9.62", "license": "AGPL-3.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", diff --git a/packages/builder/package.json b/packages/builder/package.json index 8b067ba287..754f87627f 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "0.9.61", + "version": "0.9.62", "license": "AGPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^0.9.61", - "@budibase/client": "^0.9.61", + "@budibase/bbui": "^0.9.62", + "@budibase/client": "^0.9.62", "@budibase/colorpicker": "1.1.2", - "@budibase/string-templates": "^0.9.61", + "@budibase/string-templates": "^0.9.62", "@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 2da2c3da67..b6ade6987e 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "0.9.61", + "version": "0.9.62", "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 b810d256f0..46fd6cc0a4 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "0.9.61", + "version": "0.9.62", "license": "MPL-2.0", "module": "dist/budibase-client.js", "main": "dist/budibase-client.js", @@ -18,9 +18,9 @@ "dev:builder": "rollup -cw" }, "dependencies": { - "@budibase/bbui": "^0.9.61", - "@budibase/standard-components": "^0.9.61", - "@budibase/string-templates": "^0.9.61", + "@budibase/bbui": "^0.9.62", + "@budibase/standard-components": "^0.9.62", + "@budibase/string-templates": "^0.9.62", "regexparam": "^1.3.0", "shortid": "^2.2.15", "svelte-spa-router": "^3.0.5" diff --git a/packages/server/package.json b/packages/server/package.json index ed77b961c7..8267ac59a4 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "0.9.61", + "version": "0.9.62", "description": "Budibase Web Server", "main": "src/electron.js", "repository": { @@ -55,9 +55,9 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.61", - "@budibase/client": "^0.9.61", - "@budibase/string-templates": "^0.9.61", + "@budibase/auth": "^0.9.62", + "@budibase/client": "^0.9.62", + "@budibase/string-templates": "^0.9.62", "@elastic/elasticsearch": "7.10.0", "@koa/router": "8.0.0", "@sendgrid/mail": "7.1.1", @@ -110,7 +110,7 @@ "devDependencies": { "@babel/core": "^7.14.3", "@babel/preset-env": "^7.14.4", - "@budibase/standard-components": "^0.9.61", + "@budibase/standard-components": "^0.9.62", "@jest/test-sequencer": "^24.8.0", "babel-jest": "^27.0.2", "docker-compose": "^0.23.6", diff --git a/packages/standard-components/package.json b/packages/standard-components/package.json index b52f9f8171..1c2c58eb13 100644 --- a/packages/standard-components/package.json +++ b/packages/standard-components/package.json @@ -29,11 +29,11 @@ "keywords": [ "svelte" ], - "version": "0.9.61", + "version": "0.9.62", "license": "MIT", "gitHead": "d1836a898cab3f8ab80ee6d8f42be1a9eed7dcdc", "dependencies": { - "@budibase/bbui": "^0.9.61", + "@budibase/bbui": "^0.9.62", "@spectrum-css/link": "^3.1.3", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index 7d49453a8c..aecd289a60 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "0.9.61", + "version": "0.9.62", "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 bce3b7a510..3888dfc3bb 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "0.9.61", + "version": "0.9.62", "description": "Budibase background service", "main": "src/index.js", "repository": { @@ -21,8 +21,8 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.61", - "@budibase/string-templates": "^0.9.61", + "@budibase/auth": "^0.9.62", + "@budibase/string-templates": "^0.9.62", "@koa/router": "^8.0.0", "aws-sdk": "^2.811.0", "bcryptjs": "^2.4.3", From 0de6038551a003d9983cdb2a6759dbabb5666ac0 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Wed, 23 Jun 2021 23:35:53 +0100 Subject: [PATCH 12/31] strip double quotes and use single in ID --- packages/server/src/integrations/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/server/src/integrations/utils.js b/packages/server/src/integrations/utils.js index cb2bbab365..a643030397 100644 --- a/packages/server/src/integrations/utils.js +++ b/packages/server/src/integrations/utils.js @@ -24,7 +24,7 @@ exports.generateRowIdField = (keyProps = []) => { keyProps = [keyProps] } // this conserves order and types - return encodeURIComponent(JSON.stringify(keyProps).replace(/"/g, "")) + return encodeURIComponent(JSON.stringify(keyProps).replace(/"/g, "'")) } // should always return an array From 91f2d5a07563386360b61fd3c0595a7374261360 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Wed, 23 Jun 2021 22:43:56 +0000 Subject: [PATCH 13/31] v0.9.63 --- lerna.json | 2 +- packages/auth/package.json | 2 +- packages/bbui/package.json | 2 +- packages/builder/package.json | 8 ++++---- packages/cli/package.json | 2 +- packages/client/package.json | 8 ++++---- packages/server/package.json | 10 +++++----- packages/standard-components/package.json | 4 ++-- 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 5f3f5e48d9..feb4334e5e 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "0.9.62", + "version": "0.9.63", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/auth/package.json b/packages/auth/package.json index 5b8903bb2d..b84d3384fd 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/auth", - "version": "0.9.62", + "version": "0.9.63", "description": "Authentication middlewares for budibase builder and apps", "main": "src/index.js", "author": "Budibase", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index a4ca564fb0..4164a2c212 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": "0.9.62", + "version": "0.9.63", "license": "AGPL-3.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", diff --git a/packages/builder/package.json b/packages/builder/package.json index 754f87627f..f5e95aebe8 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "0.9.62", + "version": "0.9.63", "license": "AGPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^0.9.62", - "@budibase/client": "^0.9.62", + "@budibase/bbui": "^0.9.63", + "@budibase/client": "^0.9.63", "@budibase/colorpicker": "1.1.2", - "@budibase/string-templates": "^0.9.62", + "@budibase/string-templates": "^0.9.63", "@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 b6ade6987e..5ad065921e 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "0.9.62", + "version": "0.9.63", "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 46fd6cc0a4..1b14a75d69 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "0.9.62", + "version": "0.9.63", "license": "MPL-2.0", "module": "dist/budibase-client.js", "main": "dist/budibase-client.js", @@ -18,9 +18,9 @@ "dev:builder": "rollup -cw" }, "dependencies": { - "@budibase/bbui": "^0.9.62", - "@budibase/standard-components": "^0.9.62", - "@budibase/string-templates": "^0.9.62", + "@budibase/bbui": "^0.9.63", + "@budibase/standard-components": "^0.9.63", + "@budibase/string-templates": "^0.9.63", "regexparam": "^1.3.0", "shortid": "^2.2.15", "svelte-spa-router": "^3.0.5" diff --git a/packages/server/package.json b/packages/server/package.json index 8267ac59a4..6ef8c5e52c 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "0.9.62", + "version": "0.9.63", "description": "Budibase Web Server", "main": "src/electron.js", "repository": { @@ -55,9 +55,9 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.62", - "@budibase/client": "^0.9.62", - "@budibase/string-templates": "^0.9.62", + "@budibase/auth": "^0.9.63", + "@budibase/client": "^0.9.63", + "@budibase/string-templates": "^0.9.63", "@elastic/elasticsearch": "7.10.0", "@koa/router": "8.0.0", "@sendgrid/mail": "7.1.1", @@ -110,7 +110,7 @@ "devDependencies": { "@babel/core": "^7.14.3", "@babel/preset-env": "^7.14.4", - "@budibase/standard-components": "^0.9.62", + "@budibase/standard-components": "^0.9.63", "@jest/test-sequencer": "^24.8.0", "babel-jest": "^27.0.2", "docker-compose": "^0.23.6", diff --git a/packages/standard-components/package.json b/packages/standard-components/package.json index 1c2c58eb13..867dddc9b6 100644 --- a/packages/standard-components/package.json +++ b/packages/standard-components/package.json @@ -29,11 +29,11 @@ "keywords": [ "svelte" ], - "version": "0.9.62", + "version": "0.9.63", "license": "MIT", "gitHead": "d1836a898cab3f8ab80ee6d8f42be1a9eed7dcdc", "dependencies": { - "@budibase/bbui": "^0.9.62", + "@budibase/bbui": "^0.9.63", "@spectrum-css/link": "^3.1.3", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index aecd289a60..81d54ebe12 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "0.9.62", + "version": "0.9.63", "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 3888dfc3bb..7b8d3f5f34 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "0.9.62", + "version": "0.9.63", "description": "Budibase background service", "main": "src/index.js", "repository": { @@ -21,8 +21,8 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.62", - "@budibase/string-templates": "^0.9.62", + "@budibase/auth": "^0.9.63", + "@budibase/string-templates": "^0.9.63", "@koa/router": "^8.0.0", "aws-sdk": "^2.811.0", "bcryptjs": "^2.4.3", From 1df459a5bf119cf958c84a179a48d99306a8574a Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Thu, 24 Jun 2021 11:37:26 +0100 Subject: [PATCH 14/31] Fixing issues discovered with hbs escaping. --- .../src/api/controllers/static/templates/app.hbs | 13 ------------- packages/string-templates/src/helpers/index.js | 9 ++++++--- packages/string-templates/test/helpers.spec.js | 11 +++++++++++ 3 files changed, 17 insertions(+), 16 deletions(-) delete mode 100644 packages/server/src/api/controllers/static/templates/app.hbs diff --git a/packages/server/src/api/controllers/static/templates/app.hbs b/packages/server/src/api/controllers/static/templates/app.hbs deleted file mode 100644 index 60497a05df..0000000000 --- a/packages/server/src/api/controllers/static/templates/app.hbs +++ /dev/null @@ -1,13 +0,0 @@ - - - - - {{{head}}} - - - - - {{{body}}} - \ No newline at end of file diff --git a/packages/string-templates/src/helpers/index.js b/packages/string-templates/src/helpers/index.js index 05145f7c7a..1ff729d187 100644 --- a/packages/string-templates/src/helpers/index.js +++ b/packages/string-templates/src/helpers/index.js @@ -20,10 +20,13 @@ const HELPERS = [ // this help is applied to all statements new Helper(HelperFunctionNames.ALL, value => { // null/undefined values produce bad results - if (value == null) { - return "" + if (value == null || typeof value !== "string") { + return value || "" } - let text = new SafeString(unescape(value).replace(/&/g, "&")) + if (value && value.string) { + value = value.string + } + let text = new SafeString(value.replace(/&/g, "&")) if (text == null || typeof text !== "string") { return text } diff --git a/packages/string-templates/test/helpers.spec.js b/packages/string-templates/test/helpers.spec.js index e43bb5fbe1..b380fd9315 100644 --- a/packages/string-templates/test/helpers.spec.js +++ b/packages/string-templates/test/helpers.spec.js @@ -442,4 +442,15 @@ describe("Cover a few complex use cases", () => { const output = await processObject(input, tableJson) expect(output.dataProvider).not.toBe("Invalid Binding") }) + + it("should be able to handle external ids", async () => { + const input = { + dataProvider: "{{ literal [_id] }}", + } + const context = { + _id: "%5B%221%22%2C%221%22%5D", + } + const output = await processObject(input, context) + expect(output.dataProvider).toBe("%5B%221%22%2C%221%22%5D") + }) }) From 1263b642989b20df0f94725f2e8a9f6b58a49d44 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Thu, 24 Jun 2021 11:40:31 +0100 Subject: [PATCH 15/31] Adding back app.hbs as it is still required. --- .../src/api/controllers/static/templates/app.hbs | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 packages/server/src/api/controllers/static/templates/app.hbs diff --git a/packages/server/src/api/controllers/static/templates/app.hbs b/packages/server/src/api/controllers/static/templates/app.hbs new file mode 100644 index 0000000000..4a04054f21 --- /dev/null +++ b/packages/server/src/api/controllers/static/templates/app.hbs @@ -0,0 +1,13 @@ + + + + + {{{head}}} + + + + +{{{body}}} + \ No newline at end of file From b7aa28f98129046fd8cff9ed867c4ef4c110a324 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Thu, 24 Jun 2021 11:44:33 +0100 Subject: [PATCH 16/31] Add some container settings to repeaters to allow control of layout of children, and enable settings bar --- packages/standard-components/manifest.json | 88 +++++++++++++++++++ .../standard-components/src/Repeater.svelte | 10 ++- 2 files changed, 95 insertions(+), 3 deletions(-) diff --git a/packages/standard-components/manifest.json b/packages/standard-components/manifest.json index 450a0d823c..e214cfcdb7 100644 --- a/packages/standard-components/manifest.json +++ b/packages/standard-components/manifest.json @@ -242,6 +242,7 @@ "styleable": true, "illegalChildren": ["section"], "hasChildren": true, + "showSettingsBar": true, "settings": [ { "type": "dataProvider", @@ -258,6 +259,93 @@ "type": "filter", "label": "Filtering", "key": "filter" + }, + { + "type": "select", + "label": "Direction", + "key": "direction", + "showInBar": true, + "options": [ + { + "label": "Column", + "value": "column", + "barIcon": "ViewRow", + "barTitle": "Column layout" + }, + { + "label": "Row", + "value": "row", + "barIcon": "ViewColumn", + "barTitle": "Row layout" + } + ], + "defaultValue": "column" + }, + { + "type": "select", + "label": "Horiz. Align", + "key": "hAlign", + "showInBar": true, + "options": [ + { + "label": "Left", + "value": "left", + "barIcon": "AlignLeft", + "barTitle": "Align left" + }, + { + "label": "Center", + "value": "center", + "barIcon": "AlignCenter", + "barTitle": "Align center" + }, + { + "label": "Right", + "value": "right", + "barIcon": "AlignRight", + "barTitle": "Align right" + }, + { + "label": "Stretch", + "value": "stretch", + "barIcon": "MoveLeftRight", + "barTitle": "Align stretched horizontally" + } + ], + "defaultValue": "stretch" + }, + { + "type": "select", + "label": "Vert. Align", + "key": "vAlign", + "showInBar": "true", + "options": [ + { + "label": "Top", + "value": "top", + "barIcon": "AlignTop", + "barTitle": "Align top" + }, + { + "label": "Middle", + "value": "middle", + "barIcon": "AlignMiddle", + "barTitle": "Align middle" + }, + { + "label": "Bottom", + "value": "bottom", + "barIcon": "AlignBottom", + "barTitle": "Align bottom" + }, + { + "label": "Stretch", + "value": "stretch", + "barIcon": "MoveUpDown", + "barTitle": "Align stretched vertically" + } + ], + "defaultValue": "top" } ], "context": { diff --git a/packages/standard-components/src/Repeater.svelte b/packages/standard-components/src/Repeater.svelte index c53789afd6..97694303f5 100644 --- a/packages/standard-components/src/Repeater.svelte +++ b/packages/standard-components/src/Repeater.svelte @@ -1,18 +1,22 @@ -
+ {#if $component.empty} {:else if rows.length > 0} @@ -24,7 +28,7 @@ {:else if loaded && noRowsMessage}
{noRowsMessage}
{/if} -
+