From 95136a54f2731d800102f02340e8195a56e6ae53 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Thu, 29 Sep 2022 19:30:53 +0100 Subject: [PATCH 01/21] Adding ability for datasource plugins to have a custom icon svg. --- .../backend-core/src/objectStore/index.ts | 5 +++ .../DatasourceNavigator.svelte | 10 ++--- .../IntegrationIcon.svelte | 40 +++++++++++++++++++ .../_components/DatasourceCard.svelte | 8 +--- .../DatasourceNavigator/icons/index.js | 11 +++-- .../src/components/common/CustomSVG.svelte | 23 +++++++++++ packages/server/src/integrations/index.ts | 3 ++ packages/types/src/documents/global/plugin.ts | 1 + packages/types/src/sdk/datasources.ts | 1 + 9 files changed, 88 insertions(+), 14 deletions(-) create mode 100644 packages/builder/src/components/backend/DatasourceNavigator/IntegrationIcon.svelte create mode 100644 packages/builder/src/components/common/CustomSVG.svelte diff --git a/packages/backend-core/src/objectStore/index.ts b/packages/backend-core/src/objectStore/index.ts index a97aa8f65d..17e002cc49 100644 --- a/packages/backend-core/src/objectStore/index.ts +++ b/packages/backend-core/src/objectStore/index.ts @@ -182,6 +182,11 @@ export const streamUpload = async ( ...extra, ContentType: "application/javascript", } + } else if (filename?.endsWith(".svg")) { + extra = { + ...extra, + ContentType: "image", + } } const params = { diff --git a/packages/builder/src/components/backend/DatasourceNavigator/DatasourceNavigator.svelte b/packages/builder/src/components/backend/DatasourceNavigator/DatasourceNavigator.svelte index 19946a2386..a3531513fb 100644 --- a/packages/builder/src/components/backend/DatasourceNavigator/DatasourceNavigator.svelte +++ b/packages/builder/src/components/backend/DatasourceNavigator/DatasourceNavigator.svelte @@ -13,7 +13,7 @@ customQueryIconColor, customQueryText, } from "helpers/data/utils" - import { getIcon } from "./icons" + import IntegrationIcon from "./IntegrationIcon.svelte" import { notifications } from "@budibase/bbui" let openDataSources = [] @@ -123,10 +123,10 @@ on:iconClick={() => toggleNode(datasource)} >
-
{#if datasource._id !== BUDIBASE_INTERNAL_DB} diff --git a/packages/builder/src/components/backend/DatasourceNavigator/IntegrationIcon.svelte b/packages/builder/src/components/backend/DatasourceNavigator/IntegrationIcon.svelte new file mode 100644 index 0000000000..54afa35e74 --- /dev/null +++ b/packages/builder/src/components/backend/DatasourceNavigator/IntegrationIcon.svelte @@ -0,0 +1,40 @@ + + +{#if iconInfo.icon} + +{:else if iconInfo.url} + {#await getSvgFromUrl(iconInfo) then retrievedSvg} + + {/await} +{/if} diff --git a/packages/builder/src/components/backend/DatasourceNavigator/_components/DatasourceCard.svelte b/packages/builder/src/components/backend/DatasourceNavigator/_components/DatasourceCard.svelte index 6dffc70a63..1e966ebb2b 100644 --- a/packages/builder/src/components/backend/DatasourceNavigator/_components/DatasourceCard.svelte +++ b/packages/builder/src/components/backend/DatasourceNavigator/_components/DatasourceCard.svelte @@ -1,7 +1,7 @@ + +{@html substituteSize(svgHtml)} diff --git a/packages/server/src/integrations/index.ts b/packages/server/src/integrations/index.ts index 000ab65a33..a542ff8455 100644 --- a/packages/server/src/integrations/index.ts +++ b/packages/server/src/integrations/index.ts @@ -78,6 +78,9 @@ module.exports = { ...plugin.schema["schema"], custom: true, } + if (plugin.iconUrl) { + pluginSchemas[sourceId].iconUrl = plugin.iconUrl + } } } return { diff --git a/packages/types/src/documents/global/plugin.ts b/packages/types/src/documents/global/plugin.ts index a374d5496c..7f6d4f4995 100644 --- a/packages/types/src/documents/global/plugin.ts +++ b/packages/types/src/documents/global/plugin.ts @@ -21,6 +21,7 @@ export interface Plugin extends Document { name: string version: string jsUrl?: string + iconUrl?: string source: PluginSource package: { [key: string]: any } hash: string diff --git a/packages/types/src/sdk/datasources.ts b/packages/types/src/sdk/datasources.ts index 970613b322..d01d636b86 100644 --- a/packages/types/src/sdk/datasources.ts +++ b/packages/types/src/sdk/datasources.ts @@ -96,6 +96,7 @@ export interface Integration { description: string friendlyName: string type?: string + iconUrl?: string datasource: {} query: { [key: string]: QueryDefinition From c40ce20a388cf1a06f301554e0246b73a58cef2b Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Fri, 30 Sep 2022 09:17:38 +0100 Subject: [PATCH 02/21] Improving regex for processing custom SVG. --- packages/builder/src/components/common/CustomSVG.svelte | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/builder/src/components/common/CustomSVG.svelte b/packages/builder/src/components/common/CustomSVG.svelte index 5ae428c12d..ce6e964c38 100644 --- a/packages/builder/src/components/common/CustomSVG.svelte +++ b/packages/builder/src/components/common/CustomSVG.svelte @@ -5,13 +5,13 @@ function substituteSize(svg) { if (svg.includes("height=")) { - svg = svg.replace(/height="\d*"/, `height="${size}"`) + svg = svg.replace(/height="[^"]+"/, `height="${size}"`) } if (svg.includes("width=")) { - svg = svg.replace(/width="\d*"/, `width="${size}"`) + svg = svg.replace(/width="[^"]+"/, `width="${size}"`) } if (svg.includes("id=")) { - const matches = svg.match(/id="(.*)"/g) + const matches = svg.match(/id="([^"]+)"/g) for (let match of matches) { svg = svg.replace(new RegExp(match, "g"), Helpers.uuid()) } From 3b0518296dad7894bad3612dd8f56225cc7c21c8 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Fri, 30 Sep 2022 14:32:32 +0100 Subject: [PATCH 03/21] Removing some un-necessary duplicated statements. --- .../DatasourceNavigator/IntegrationIcon.svelte | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/packages/builder/src/components/backend/DatasourceNavigator/IntegrationIcon.svelte b/packages/builder/src/components/backend/DatasourceNavigator/IntegrationIcon.svelte index 54afa35e74..e6cfbf7db8 100644 --- a/packages/builder/src/components/backend/DatasourceNavigator/IntegrationIcon.svelte +++ b/packages/builder/src/components/backend/DatasourceNavigator/IntegrationIcon.svelte @@ -15,19 +15,11 @@ const url = `${pluginsUrl}/${info.url}` const resp = await fetch(url, { headers: { - pragma: "no-cache", - "cache-control": "no-cache", + ["pragma"]: "no-cache", + ["cache-control"]: "no-cache", }, }) - let text = await resp.text() - // explicitly only want to replace the first instance - if (text.includes("height=")) { - text = text.replace(/height="\d*"/, `height="${size}"`) - } - if (text.includes("width=")) { - text = text.replace(/width="\d*"/, `width="${size}"`) - } - return text + return resp.text() } From 0212e9ef15a6df4ae79b77b5bdc2ee0462b2eea3 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Fri, 30 Sep 2022 14:18:54 +0000 Subject: [PATCH 04/21] v2.0.10 --- lerna.json | 2 +- packages/backend-core/package.json | 4 ++-- packages/bbui/package.json | 4 ++-- packages/builder/package.json | 10 +++++----- packages/cli/package.json | 8 ++++---- packages/client/package.json | 8 ++++---- packages/frontend-core/package.json | 4 ++-- packages/sdk/package.json | 2 +- packages/server/package.json | 10 +++++----- packages/string-templates/package.json | 2 +- packages/types/package.json | 2 +- packages/worker/package.json | 8 ++++---- 12 files changed, 32 insertions(+), 32 deletions(-) diff --git a/lerna.json b/lerna.json index 8d65ca329f..cfe39fbb01 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.0.9", + "version": "2.0.10", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index 2cb965fc18..acb419e720 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "2.0.9", + "version": "2.0.10", "description": "Budibase backend core libraries used in server and worker", "main": "dist/src/index.js", "types": "dist/src/index.d.ts", @@ -20,7 +20,7 @@ "test:watch": "jest --watchAll" }, "dependencies": { - "@budibase/types": "^2.0.9", + "@budibase/types": "^2.0.10", "@shopify/jest-koa-mocks": "5.0.1", "@techpass/passport-openidconnect": "0.3.2", "aws-sdk": "2.1030.0", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 5b177b0097..67020e3f03 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": "2.0.9", + "version": "2.0.10", "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": "^2.0.9", + "@budibase/string-templates": "^2.0.10", "@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 c1d6d6e88b..454dd09ea7 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "2.0.9", + "version": "2.0.10", "license": "GPL-3.0", "private": true, "scripts": { @@ -71,10 +71,10 @@ } }, "dependencies": { - "@budibase/bbui": "^2.0.9", - "@budibase/client": "^2.0.9", - "@budibase/frontend-core": "^2.0.9", - "@budibase/string-templates": "^2.0.9", + "@budibase/bbui": "^2.0.10", + "@budibase/client": "^2.0.10", + "@budibase/frontend-core": "^2.0.10", + "@budibase/string-templates": "^2.0.10", "@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 f8a17ef173..2675fefea5 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "2.0.9", + "version": "2.0.10", "description": "Budibase CLI, for developers, self hosting and migrations.", "main": "src/index.js", "bin": { @@ -26,9 +26,9 @@ "outputPath": "build" }, "dependencies": { - "@budibase/backend-core": "^2.0.9", - "@budibase/string-templates": "^2.0.9", - "@budibase/types": "^2.0.9", + "@budibase/backend-core": "^2.0.10", + "@budibase/string-templates": "^2.0.10", + "@budibase/types": "^2.0.10", "axios": "0.21.2", "chalk": "4.1.0", "cli-progress": "3.11.2", diff --git a/packages/client/package.json b/packages/client/package.json index 11590f806c..283e7cf002 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "2.0.9", + "version": "2.0.10", "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": "^2.0.9", - "@budibase/frontend-core": "^2.0.9", - "@budibase/string-templates": "^2.0.9", + "@budibase/bbui": "^2.0.10", + "@budibase/frontend-core": "^2.0.10", + "@budibase/string-templates": "^2.0.10", "@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 d259cfe859..cdda6a0e34 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "2.0.9", + "version": "2.0.10", "description": "Budibase frontend core libraries used in builder and client", "author": "Budibase", "license": "MPL-2.0", "svelte": "src/index.js", "dependencies": { - "@budibase/bbui": "^2.0.9", + "@budibase/bbui": "^2.0.10", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/sdk/package.json b/packages/sdk/package.json index f491c55e19..d56bdb1238 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/sdk", - "version": "2.0.9", + "version": "2.0.10", "description": "Budibase Public API SDK", "author": "Budibase", "license": "MPL-2.0", diff --git a/packages/server/package.json b/packages/server/package.json index 55a5fc9352..24d0883705 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "2.0.9", + "version": "2.0.10", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -77,11 +77,11 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "10.0.3", - "@budibase/backend-core": "^2.0.9", - "@budibase/client": "^2.0.9", + "@budibase/backend-core": "^2.0.10", + "@budibase/client": "^2.0.10", "@budibase/pro": "2.0.9", - "@budibase/string-templates": "^2.0.9", - "@budibase/types": "^2.0.9", + "@budibase/string-templates": "^2.0.10", + "@budibase/types": "^2.0.10", "@bull-board/api": "3.7.0", "@bull-board/koa": "3.9.4", "@elastic/elasticsearch": "7.10.0", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index f6ca5d9007..5a584208cf 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "2.0.9", + "version": "2.0.10", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/types/package.json b/packages/types/package.json index 6d151fcbe7..53d8b823d0 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/types", - "version": "2.0.9", + "version": "2.0.10", "description": "Budibase types", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/worker/package.json b/packages/worker/package.json index d21a3596ff..2c2a6387d5 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "2.0.9", + "version": "2.0.10", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -36,10 +36,10 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "^2.0.9", + "@budibase/backend-core": "^2.0.10", "@budibase/pro": "2.0.9", - "@budibase/string-templates": "^2.0.9", - "@budibase/types": "^2.0.9", + "@budibase/string-templates": "^2.0.10", + "@budibase/types": "^2.0.10", "@koa/router": "8.0.8", "@sentry/node": "6.17.7", "@techpass/passport-openidconnect": "0.3.2", From 476bb79c29d16da1e1d5bdaf1291383a5da5e86f Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Fri, 30 Sep 2022 15:19:34 +0100 Subject: [PATCH 05/21] Quick fix for development machines, when running Budibase development stack on systems that are not oracle compatiable it would fail to start due to the lack of dependency. --- packages/server/src/integrations/index.ts | 6 +++++- packages/server/src/integrations/oracle.ts | 19 ++++++++++++++----- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/packages/server/src/integrations/index.ts b/packages/server/src/integrations/index.ts index 99cd391278..240f68ed91 100644 --- a/packages/server/src/integrations/index.ts +++ b/packages/server/src/integrations/index.ts @@ -57,7 +57,11 @@ const INTEGRATIONS: { [key: string]: any } = { } // optionally add oracle integration if the oracle binary can be installed -if (process.arch && !process.arch.startsWith("arm")) { +if ( + process.arch && + !process.arch.startsWith("arm") && + oracle.integration.isInstalled() +) { DEFINITIONS[SourceName.ORACLE] = oracle.schema INTEGRATIONS[SourceName.ORACLE] = oracle.integration } diff --git a/packages/server/src/integrations/oracle.ts b/packages/server/src/integrations/oracle.ts index 5f35935e12..101d459ec0 100644 --- a/packages/server/src/integrations/oracle.ts +++ b/packages/server/src/integrations/oracle.ts @@ -15,17 +15,22 @@ import { getSqlQuery, SqlClient, } from "./utils" -import oracledb, { +import Sql from "./base/sql" +import { FieldTypes } from "../constants" +import { BindParameters, Connection, ConnectionAttributes, ExecuteOptions, Result, } from "oracledb" -import Sql from "./base/sql" -import { FieldTypes } from "../constants" - -oracledb.outFormat = oracledb.OUT_FORMAT_OBJECT +let oracledb: any +try { + oracledb = require("oracledb") + oracledb.outFormat = oracledb.OUT_FORMAT_OBJECT +} catch (err) { + console.log("ORACLEDB is not installed") +} interface OracleConfig { host: string @@ -183,6 +188,10 @@ class OracleIntegration extends Sql implements DatasourcePlus { return parts.join(" || ") } + static isInstalled() { + return oracledb != null + } + /** * Map the flat tabular columns and constraints data into a nested object */ From 91207adc7707fbd2a89d8ee9897c6d82e302c589 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Fri, 30 Sep 2022 14:22:12 +0000 Subject: [PATCH 06/21] Update pro version to 2.0.10 --- packages/server/package.json | 2 +- packages/server/yarn.lock | 30 +++++++++++++++--------------- packages/worker/package.json | 2 +- packages/worker/yarn.lock | 30 +++++++++++++++--------------- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/packages/server/package.json b/packages/server/package.json index 24d0883705..89b7520691 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -79,7 +79,7 @@ "@apidevtools/swagger-parser": "10.0.3", "@budibase/backend-core": "^2.0.10", "@budibase/client": "^2.0.10", - "@budibase/pro": "2.0.9", + "@budibase/pro": "2.0.10", "@budibase/string-templates": "^2.0.10", "@budibase/types": "^2.0.10", "@bull-board/api": "3.7.0", diff --git a/packages/server/yarn.lock b/packages/server/yarn.lock index 5685c1b33d..e47cc0561a 100644 --- a/packages/server/yarn.lock +++ b/packages/server/yarn.lock @@ -1094,12 +1094,12 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@2.0.9": - version "2.0.9" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.0.9.tgz#ccd3cc2aa319e93c2e983da9bf91c163f85bd3e1" - integrity sha512-53ItGnxXlgKEbx5JsxprAdid5RjrYXK9sEY+CLLlCo96JLxfpRCqxlid1uTh9wP4KMpwRMYeuHMAaPwg068iTA== +"@budibase/backend-core@2.0.10": + version "2.0.10" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.0.10.tgz#beafa625c3728c11e51fb448685ff6f77447ea01" + integrity sha512-Q67qg2+eHyGOfaf1YxgNuogyQVSHkM12EOdPTk0X1XnE687tn/RjxUPEJg/Rj/6WnMZz3CO78e41OyN4NukStA== dependencies: - "@budibase/types" "^2.0.9" + "@budibase/types" "^2.0.10" "@shopify/jest-koa-mocks" "5.0.1" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" @@ -1180,13 +1180,13 @@ svelte-flatpickr "^3.2.3" svelte-portal "^1.0.0" -"@budibase/pro@2.0.9": - version "2.0.9" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.0.9.tgz#ac97626c84eeec1723a8dfb717480f3899c9ef8b" - integrity sha512-9Gqk6q39zbhldVTDGKRjkS388I3g2WmWl3qStCItvJD9wrrsKV7EflTYYwJsT37X/Ed1BoLldYGIzjaEmpKgpQ== +"@budibase/pro@2.0.10": + version "2.0.10" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.0.10.tgz#3bbb64d46de41b7b037b0878a11fcf5bac37d608" + integrity sha512-RwqnlBe8+s42ndGgmy4rVvQGgku26KIi93w7Z93MO20B+NQyJp8JZJ4KTHpJE+LgeUFlZuJihDWk15iRtLHvkQ== dependencies: - "@budibase/backend-core" "2.0.9" - "@budibase/types" "2.0.9" + "@budibase/backend-core" "2.0.10" + "@budibase/types" "2.0.10" "@koa/router" "8.0.8" joi "17.6.0" node-fetch "^2.6.1" @@ -1209,10 +1209,10 @@ svelte-apexcharts "^1.0.2" svelte-flatpickr "^3.1.0" -"@budibase/types@2.0.9", "@budibase/types@^2.0.9": - version "2.0.9" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.0.9.tgz#3337a4fa94c6a4cb831e97fb93fbe9beacfc3cf8" - integrity sha512-L0oLlg2XYEuir34NvTzQXk2fREvIKVXbZPFNcRT/y2fqIWeWhjXdDLQ3FBAFK66SrTy6kEcejgICosVcBOhWyQ== +"@budibase/types@2.0.10", "@budibase/types@^2.0.10": + version "2.0.10" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.0.10.tgz#bad0fa19be2106974b440374b581c63c72c07a4f" + integrity sha512-MczMV35j+FyioqpftssIJo4pppzUw2tQpH5zBb4geozUiBb0vg/YyxBfCC+T69jzWHlEaZ/EbIBCQHvnv8nA2A== "@bull-board/api@3.7.0": version "3.7.0" diff --git a/packages/worker/package.json b/packages/worker/package.json index 2c2a6387d5..839226da39 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -37,7 +37,7 @@ "license": "GPL-3.0", "dependencies": { "@budibase/backend-core": "^2.0.10", - "@budibase/pro": "2.0.9", + "@budibase/pro": "2.0.10", "@budibase/string-templates": "^2.0.10", "@budibase/types": "^2.0.10", "@koa/router": "8.0.8", diff --git a/packages/worker/yarn.lock b/packages/worker/yarn.lock index 73ea346e0e..cdf60a7a1b 100644 --- a/packages/worker/yarn.lock +++ b/packages/worker/yarn.lock @@ -291,12 +291,12 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@2.0.9": - version "2.0.9" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.0.9.tgz#ccd3cc2aa319e93c2e983da9bf91c163f85bd3e1" - integrity sha512-53ItGnxXlgKEbx5JsxprAdid5RjrYXK9sEY+CLLlCo96JLxfpRCqxlid1uTh9wP4KMpwRMYeuHMAaPwg068iTA== +"@budibase/backend-core@2.0.10": + version "2.0.10" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.0.10.tgz#beafa625c3728c11e51fb448685ff6f77447ea01" + integrity sha512-Q67qg2+eHyGOfaf1YxgNuogyQVSHkM12EOdPTk0X1XnE687tn/RjxUPEJg/Rj/6WnMZz3CO78e41OyN4NukStA== dependencies: - "@budibase/types" "^2.0.9" + "@budibase/types" "^2.0.10" "@shopify/jest-koa-mocks" "5.0.1" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" @@ -327,21 +327,21 @@ uuid "8.3.2" zlib "1.0.5" -"@budibase/pro@2.0.9": - version "2.0.9" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.0.9.tgz#ac97626c84eeec1723a8dfb717480f3899c9ef8b" - integrity sha512-9Gqk6q39zbhldVTDGKRjkS388I3g2WmWl3qStCItvJD9wrrsKV7EflTYYwJsT37X/Ed1BoLldYGIzjaEmpKgpQ== +"@budibase/pro@2.0.10": + version "2.0.10" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.0.10.tgz#3bbb64d46de41b7b037b0878a11fcf5bac37d608" + integrity sha512-RwqnlBe8+s42ndGgmy4rVvQGgku26KIi93w7Z93MO20B+NQyJp8JZJ4KTHpJE+LgeUFlZuJihDWk15iRtLHvkQ== dependencies: - "@budibase/backend-core" "2.0.9" - "@budibase/types" "2.0.9" + "@budibase/backend-core" "2.0.10" + "@budibase/types" "2.0.10" "@koa/router" "8.0.8" joi "17.6.0" node-fetch "^2.6.1" -"@budibase/types@2.0.9", "@budibase/types@^2.0.9": - version "2.0.9" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.0.9.tgz#3337a4fa94c6a4cb831e97fb93fbe9beacfc3cf8" - integrity sha512-L0oLlg2XYEuir34NvTzQXk2fREvIKVXbZPFNcRT/y2fqIWeWhjXdDLQ3FBAFK66SrTy6kEcejgICosVcBOhWyQ== +"@budibase/types@2.0.10", "@budibase/types@^2.0.10": + version "2.0.10" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.0.10.tgz#bad0fa19be2106974b440374b581c63c72c07a4f" + integrity sha512-MczMV35j+FyioqpftssIJo4pppzUw2tQpH5zBb4geozUiBb0vg/YyxBfCC+T69jzWHlEaZ/EbIBCQHvnv8nA2A== "@cspotcode/source-map-consumer@0.8.0": version "0.8.0" From 9bd60ab44865bdaf2d8c98cdc8ac729415988fc2 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Fri, 30 Sep 2022 14:59:22 +0000 Subject: [PATCH 07/21] v2.0.11 --- lerna.json | 2 +- packages/backend-core/package.json | 4 ++-- packages/bbui/package.json | 4 ++-- packages/builder/package.json | 10 +++++----- packages/cli/package.json | 8 ++++---- packages/client/package.json | 8 ++++---- packages/frontend-core/package.json | 4 ++-- packages/sdk/package.json | 2 +- packages/server/package.json | 10 +++++----- packages/string-templates/package.json | 2 +- packages/types/package.json | 2 +- packages/worker/package.json | 8 ++++---- 12 files changed, 32 insertions(+), 32 deletions(-) diff --git a/lerna.json b/lerna.json index cfe39fbb01..7a699cf25b 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.0.10", + "version": "2.0.11", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index acb419e720..366e4fc02c 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "2.0.10", + "version": "2.0.11", "description": "Budibase backend core libraries used in server and worker", "main": "dist/src/index.js", "types": "dist/src/index.d.ts", @@ -20,7 +20,7 @@ "test:watch": "jest --watchAll" }, "dependencies": { - "@budibase/types": "^2.0.10", + "@budibase/types": "^2.0.11", "@shopify/jest-koa-mocks": "5.0.1", "@techpass/passport-openidconnect": "0.3.2", "aws-sdk": "2.1030.0", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 67020e3f03..53955be64a 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": "2.0.10", + "version": "2.0.11", "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": "^2.0.10", + "@budibase/string-templates": "^2.0.11", "@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 454dd09ea7..ee9e035ef0 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "2.0.10", + "version": "2.0.11", "license": "GPL-3.0", "private": true, "scripts": { @@ -71,10 +71,10 @@ } }, "dependencies": { - "@budibase/bbui": "^2.0.10", - "@budibase/client": "^2.0.10", - "@budibase/frontend-core": "^2.0.10", - "@budibase/string-templates": "^2.0.10", + "@budibase/bbui": "^2.0.11", + "@budibase/client": "^2.0.11", + "@budibase/frontend-core": "^2.0.11", + "@budibase/string-templates": "^2.0.11", "@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 2675fefea5..76b21be4ff 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "2.0.10", + "version": "2.0.11", "description": "Budibase CLI, for developers, self hosting and migrations.", "main": "src/index.js", "bin": { @@ -26,9 +26,9 @@ "outputPath": "build" }, "dependencies": { - "@budibase/backend-core": "^2.0.10", - "@budibase/string-templates": "^2.0.10", - "@budibase/types": "^2.0.10", + "@budibase/backend-core": "^2.0.11", + "@budibase/string-templates": "^2.0.11", + "@budibase/types": "^2.0.11", "axios": "0.21.2", "chalk": "4.1.0", "cli-progress": "3.11.2", diff --git a/packages/client/package.json b/packages/client/package.json index 283e7cf002..98a1c84994 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "2.0.10", + "version": "2.0.11", "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": "^2.0.10", - "@budibase/frontend-core": "^2.0.10", - "@budibase/string-templates": "^2.0.10", + "@budibase/bbui": "^2.0.11", + "@budibase/frontend-core": "^2.0.11", + "@budibase/string-templates": "^2.0.11", "@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 cdda6a0e34..50764b0c3e 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "2.0.10", + "version": "2.0.11", "description": "Budibase frontend core libraries used in builder and client", "author": "Budibase", "license": "MPL-2.0", "svelte": "src/index.js", "dependencies": { - "@budibase/bbui": "^2.0.10", + "@budibase/bbui": "^2.0.11", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/sdk/package.json b/packages/sdk/package.json index d56bdb1238..52507f3e54 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/sdk", - "version": "2.0.10", + "version": "2.0.11", "description": "Budibase Public API SDK", "author": "Budibase", "license": "MPL-2.0", diff --git a/packages/server/package.json b/packages/server/package.json index 89b7520691..845b42e9eb 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "2.0.10", + "version": "2.0.11", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -77,11 +77,11 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "10.0.3", - "@budibase/backend-core": "^2.0.10", - "@budibase/client": "^2.0.10", + "@budibase/backend-core": "^2.0.11", + "@budibase/client": "^2.0.11", "@budibase/pro": "2.0.10", - "@budibase/string-templates": "^2.0.10", - "@budibase/types": "^2.0.10", + "@budibase/string-templates": "^2.0.11", + "@budibase/types": "^2.0.11", "@bull-board/api": "3.7.0", "@bull-board/koa": "3.9.4", "@elastic/elasticsearch": "7.10.0", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index 5a584208cf..522420746a 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "2.0.10", + "version": "2.0.11", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/types/package.json b/packages/types/package.json index 53d8b823d0..827c26655e 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/types", - "version": "2.0.10", + "version": "2.0.11", "description": "Budibase types", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/worker/package.json b/packages/worker/package.json index 839226da39..3523ebd386 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "2.0.10", + "version": "2.0.11", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -36,10 +36,10 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "^2.0.10", + "@budibase/backend-core": "^2.0.11", "@budibase/pro": "2.0.10", - "@budibase/string-templates": "^2.0.10", - "@budibase/types": "^2.0.10", + "@budibase/string-templates": "^2.0.11", + "@budibase/types": "^2.0.11", "@koa/router": "8.0.8", "@sentry/node": "6.17.7", "@techpass/passport-openidconnect": "0.3.2", From ce95d66206472e811cee4ae4fbd3bc1fa49aa720 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Fri, 30 Sep 2022 15:02:32 +0000 Subject: [PATCH 08/21] Update pro version to 2.0.11 --- packages/server/package.json | 2 +- packages/server/yarn.lock | 30 +++++++++++++++--------------- packages/worker/package.json | 2 +- packages/worker/yarn.lock | 30 +++++++++++++++--------------- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/packages/server/package.json b/packages/server/package.json index 845b42e9eb..6d359400de 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -79,7 +79,7 @@ "@apidevtools/swagger-parser": "10.0.3", "@budibase/backend-core": "^2.0.11", "@budibase/client": "^2.0.11", - "@budibase/pro": "2.0.10", + "@budibase/pro": "2.0.11", "@budibase/string-templates": "^2.0.11", "@budibase/types": "^2.0.11", "@bull-board/api": "3.7.0", diff --git a/packages/server/yarn.lock b/packages/server/yarn.lock index e47cc0561a..44fea69535 100644 --- a/packages/server/yarn.lock +++ b/packages/server/yarn.lock @@ -1094,12 +1094,12 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@2.0.10": - version "2.0.10" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.0.10.tgz#beafa625c3728c11e51fb448685ff6f77447ea01" - integrity sha512-Q67qg2+eHyGOfaf1YxgNuogyQVSHkM12EOdPTk0X1XnE687tn/RjxUPEJg/Rj/6WnMZz3CO78e41OyN4NukStA== +"@budibase/backend-core@2.0.11": + version "2.0.11" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.0.11.tgz#1cf6e78bae48eddf3e005d361985713fd100c7ca" + integrity sha512-zI9jNWMl7kRW7iDl24wmZW7uV2zvVLTvZhkyoGFBxz26YFL3kEoMD7JNz13lvdfQ+iQPNtUCPjAnxeD0hsSeAQ== dependencies: - "@budibase/types" "^2.0.10" + "@budibase/types" "^2.0.11" "@shopify/jest-koa-mocks" "5.0.1" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" @@ -1180,13 +1180,13 @@ svelte-flatpickr "^3.2.3" svelte-portal "^1.0.0" -"@budibase/pro@2.0.10": - version "2.0.10" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.0.10.tgz#3bbb64d46de41b7b037b0878a11fcf5bac37d608" - integrity sha512-RwqnlBe8+s42ndGgmy4rVvQGgku26KIi93w7Z93MO20B+NQyJp8JZJ4KTHpJE+LgeUFlZuJihDWk15iRtLHvkQ== +"@budibase/pro@2.0.11": + version "2.0.11" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.0.11.tgz#0d208be662ea87064d1ac753fbcab0726069a224" + integrity sha512-/8G3xeVqC04AwOa2C08PV1g2FrjwdYjIht/Zfaa+hLrAF3tHwsjtEdoikLfuwkAm1znxgcwtJnqyPE+QFGmusA== dependencies: - "@budibase/backend-core" "2.0.10" - "@budibase/types" "2.0.10" + "@budibase/backend-core" "2.0.11" + "@budibase/types" "2.0.11" "@koa/router" "8.0.8" joi "17.6.0" node-fetch "^2.6.1" @@ -1209,10 +1209,10 @@ svelte-apexcharts "^1.0.2" svelte-flatpickr "^3.1.0" -"@budibase/types@2.0.10", "@budibase/types@^2.0.10": - version "2.0.10" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.0.10.tgz#bad0fa19be2106974b440374b581c63c72c07a4f" - integrity sha512-MczMV35j+FyioqpftssIJo4pppzUw2tQpH5zBb4geozUiBb0vg/YyxBfCC+T69jzWHlEaZ/EbIBCQHvnv8nA2A== +"@budibase/types@2.0.11", "@budibase/types@^2.0.11": + version "2.0.11" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.0.11.tgz#b08bcd08dc2ee05c609ef81056ee362146356da5" + integrity sha512-9DChubigi50uW+ta7kbgieaTa6miE4yKZhj3orHHXo7rFLDVT8sG7vGId5E81L63NMrGZdJsOBgz6AUGYBOeMw== "@bull-board/api@3.7.0": version "3.7.0" diff --git a/packages/worker/package.json b/packages/worker/package.json index 3523ebd386..ab23f4e021 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -37,7 +37,7 @@ "license": "GPL-3.0", "dependencies": { "@budibase/backend-core": "^2.0.11", - "@budibase/pro": "2.0.10", + "@budibase/pro": "2.0.11", "@budibase/string-templates": "^2.0.11", "@budibase/types": "^2.0.11", "@koa/router": "8.0.8", diff --git a/packages/worker/yarn.lock b/packages/worker/yarn.lock index cdf60a7a1b..0cc66fa177 100644 --- a/packages/worker/yarn.lock +++ b/packages/worker/yarn.lock @@ -291,12 +291,12 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@2.0.10": - version "2.0.10" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.0.10.tgz#beafa625c3728c11e51fb448685ff6f77447ea01" - integrity sha512-Q67qg2+eHyGOfaf1YxgNuogyQVSHkM12EOdPTk0X1XnE687tn/RjxUPEJg/Rj/6WnMZz3CO78e41OyN4NukStA== +"@budibase/backend-core@2.0.11": + version "2.0.11" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.0.11.tgz#1cf6e78bae48eddf3e005d361985713fd100c7ca" + integrity sha512-zI9jNWMl7kRW7iDl24wmZW7uV2zvVLTvZhkyoGFBxz26YFL3kEoMD7JNz13lvdfQ+iQPNtUCPjAnxeD0hsSeAQ== dependencies: - "@budibase/types" "^2.0.10" + "@budibase/types" "^2.0.11" "@shopify/jest-koa-mocks" "5.0.1" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" @@ -327,21 +327,21 @@ uuid "8.3.2" zlib "1.0.5" -"@budibase/pro@2.0.10": - version "2.0.10" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.0.10.tgz#3bbb64d46de41b7b037b0878a11fcf5bac37d608" - integrity sha512-RwqnlBe8+s42ndGgmy4rVvQGgku26KIi93w7Z93MO20B+NQyJp8JZJ4KTHpJE+LgeUFlZuJihDWk15iRtLHvkQ== +"@budibase/pro@2.0.11": + version "2.0.11" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.0.11.tgz#0d208be662ea87064d1ac753fbcab0726069a224" + integrity sha512-/8G3xeVqC04AwOa2C08PV1g2FrjwdYjIht/Zfaa+hLrAF3tHwsjtEdoikLfuwkAm1znxgcwtJnqyPE+QFGmusA== dependencies: - "@budibase/backend-core" "2.0.10" - "@budibase/types" "2.0.10" + "@budibase/backend-core" "2.0.11" + "@budibase/types" "2.0.11" "@koa/router" "8.0.8" joi "17.6.0" node-fetch "^2.6.1" -"@budibase/types@2.0.10", "@budibase/types@^2.0.10": - version "2.0.10" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.0.10.tgz#bad0fa19be2106974b440374b581c63c72c07a4f" - integrity sha512-MczMV35j+FyioqpftssIJo4pppzUw2tQpH5zBb4geozUiBb0vg/YyxBfCC+T69jzWHlEaZ/EbIBCQHvnv8nA2A== +"@budibase/types@2.0.11", "@budibase/types@^2.0.11": + version "2.0.11" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.0.11.tgz#b08bcd08dc2ee05c609ef81056ee362146356da5" + integrity sha512-9DChubigi50uW+ta7kbgieaTa6miE4yKZhj3orHHXo7rFLDVT8sG7vGId5E81L63NMrGZdJsOBgz6AUGYBOeMw== "@cspotcode/source-map-consumer@0.8.0": version "0.8.0" From 0840bcb7d7694f10bb839e659e316b5bb4d4ea2b Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 30 Sep 2022 10:13:06 +0100 Subject: [PATCH 09/21] Fix custom components not working properly with generated bindings --- packages/builder/src/builderStore/componentUtils.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/builder/src/builderStore/componentUtils.js b/packages/builder/src/builderStore/componentUtils.js index 2ad7e82075..e7787dea72 100644 --- a/packages/builder/src/builderStore/componentUtils.js +++ b/packages/builder/src/builderStore/componentUtils.js @@ -143,7 +143,10 @@ export const getComponentSettings = componentType => { } // Ensure whole component name is used - if (!componentType.startsWith("@budibase")) { + if ( + !componentType.startsWith("plugin/") && + !componentType.startsWith("@budibase") + ) { componentType = `@budibase/standard-components/${componentType}` } From 34ec25af1dd15c36ba6f47441ed87b53c83039c3 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 30 Sep 2022 10:13:26 +0100 Subject: [PATCH 10/21] Fix fetchRow not working in internal API --- packages/frontend-core/src/api/rows.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/frontend-core/src/api/rows.js b/packages/frontend-core/src/api/rows.js index 70030d7f80..3734310eed 100644 --- a/packages/frontend-core/src/api/rows.js +++ b/packages/frontend-core/src/api/rows.js @@ -8,10 +8,9 @@ export const buildRowEndpoints = API => ({ if (!tableId || !rowId) { return null } - const row = await API.get({ + return await API.get({ url: `/api/${tableId}/rows/${rowId}`, }) - return (await API.enrichRows([row], tableId))[0] }, /** From 293ab376363ecc0735389dc8f6959a663e282d56 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 30 Sep 2022 11:26:33 +0100 Subject: [PATCH 11/21] Use friendly name when adding instances of custom components --- packages/builder/src/builderStore/store/frontend.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/builder/src/builderStore/store/frontend.js b/packages/builder/src/builderStore/store/frontend.js index b74261a7e8..86b8ff1c43 100644 --- a/packages/builder/src/builderStore/store/frontend.js +++ b/packages/builder/src/builderStore/store/frontend.js @@ -428,7 +428,7 @@ export const getFrontendStore = () => { _id: Helpers.uuid(), _component: definition.component, _styles: { normal: {}, hover: {}, active: {} }, - _instanceName: `New ${definition.name}`, + _instanceName: `New ${definition.friendlyName || definition.name}`, ...cloneDeep(props), ...extras, } From b3a3cec40a286309a68d0141e24803d7c3ff2bb4 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 30 Sep 2022 11:38:12 +0100 Subject: [PATCH 12/21] Show notification when a plugin is hot reloaded --- packages/client/src/websocket.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/client/src/websocket.js b/packages/client/src/websocket.js index 827453fad6..0ad445863d 100644 --- a/packages/client/src/websocket.js +++ b/packages/client/src/websocket.js @@ -1,4 +1,8 @@ -import { builderStore, environmentStore } from "./stores/index.js" +import { + builderStore, + environmentStore, + notificationStore, +} from "./stores/index.js" import { get } from "svelte/store" import { io } from "socket.io-client" @@ -31,5 +35,6 @@ export const initWebsocket = () => { // Event handlers socket.on("plugin-update", data => { builderStore.actions.updateUsedPlugin(data.name, data.hash) + notificationStore.actions.info(`"${data.name}" plugin reloaded`) }) } From ef9650136a806d0de4d2895cf5688dc9d4bf43eb Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 30 Sep 2022 12:01:25 +0100 Subject: [PATCH 13/21] Hot reload custom component settings in the builder --- .../src/builderStore/store/frontend.js | 40 +++++++++++-------- .../[screenId]/_components/AppPreview.svelte | 2 + packages/client/src/stores/builder.js | 3 ++ 3 files changed, 29 insertions(+), 16 deletions(-) diff --git a/packages/builder/src/builderStore/store/frontend.js b/packages/builder/src/builderStore/store/frontend.js index 86b8ff1c43..aefdba9fb2 100644 --- a/packages/builder/src/builderStore/store/frontend.js +++ b/packages/builder/src/builderStore/store/frontend.js @@ -88,27 +88,12 @@ export const getFrontendStore = () => { initialise: async pkg => { const { layouts, screens, application, clientLibPath } = pkg - // Fetch component definitions. - // Allow errors to propagate. - const components = await API.fetchComponentLibDefinitions( - application.appId - ) - - // Filter out custom component keys so we can flag them - const customComponents = Object.keys(components).filter(name => - name.startsWith("plugin/") - ) + await store.actions.components.refreshDefinitions(application.appId) // Reset store state store.update(state => ({ ...state, libraries: application.componentLibraries, - components, - customComponents, - clientFeatures: { - ...INITIAL_FRONTEND_STATE.clientFeatures, - ...components.features, - }, name: application.name, description: application.description, appId: application.appId, @@ -385,6 +370,29 @@ export const getFrontendStore = () => { }, }, components: { + refreshDefinitions: async appId => { + if (!appId) { + appId = get(store).appId + } + + // Fetch definitions and filter out custom component definitions so we + // can flag them + const components = await API.fetchComponentLibDefinitions(appId) + const customComponents = Object.keys(components).filter(name => + name.startsWith("plugin/") + ) + + // Update store + store.update(state => ({ + ...state, + components, + customComponents, + clientFeatures: { + ...INITIAL_FRONTEND_STATE.clientFeatures, + ...components.features, + }, + })) + }, getDefinition: componentName => { if (!componentName) { return null diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/AppPreview.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/AppPreview.svelte index bc42eadff2..9f21a6a29f 100644 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/AppPreview.svelte +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/AppPreview.svelte @@ -198,6 +198,8 @@ block: "center", }) } + } else if (type === "reload-plugin") { + await store.actions.components.refreshDefinitions() } else { console.warn(`Client sent unknown event type: ${type}`) } diff --git a/packages/client/src/stores/builder.js b/packages/client/src/stores/builder.js index 608a058e01..fea070c27c 100644 --- a/packages/client/src/stores/builder.js +++ b/packages/client/src/stores/builder.js @@ -98,6 +98,9 @@ const createBuilderStore = () => { return state }) } + + // Notify the builder so we can reload component definitions + dispatchEvent("reload-plugin") }, } return { From 568af7bb7afb888003197435a010020acea62339 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 30 Sep 2022 12:01:56 +0100 Subject: [PATCH 14/21] Ensure only one instance of the client websocket exists and reduce reconnection attemps --- packages/client/src/websocket.js | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/packages/client/src/websocket.js b/packages/client/src/websocket.js index 0ad445863d..0a99fa8606 100644 --- a/packages/client/src/websocket.js +++ b/packages/client/src/websocket.js @@ -6,12 +6,14 @@ import { import { get } from "svelte/store" import { io } from "socket.io-client" +let socket + export const initWebsocket = () => { const { inBuilder, location } = get(builderStore) const { cloud } = get(environmentStore) // Only connect when we're inside the builder preview, for now - if (!inBuilder || !location || cloud) { + if (!inBuilder || !location || cloud || socket) { return } @@ -20,16 +22,15 @@ export const initWebsocket = () => { const proto = tls ? "wss:" : "ws:" const host = location.hostname const port = location.port || (tls ? 443 : 80) - const socket = io(`${proto}//${host}:${port}`, { + socket = io(`${proto}//${host}:${port}`, { path: "/socket/client", - // Cap reconnection attempts to 10 (total of 95 seconds before giving up) - reconnectionAttempts: 10, - // Delay initial reconnection attempt by 5 seconds + // Cap reconnection attempts to 3 (total of 15 seconds before giving up) + reconnectionAttempts: 3, + // Delay reconnection attempt by 5 seconds reconnectionDelay: 5000, - // Then decrease to 10 second intervals - reconnectionDelayMax: 10000, - // Timeout after 5 seconds so we never stack requests - timeout: 5000, + reconnectionDelayMax: 5000, + // Timeout after 4 seconds so we never stack requests + timeout: 4000, }) // Event handlers From ea35b9bff67c9b1e49c9e1efb277bc68c3b9428a Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 30 Sep 2022 15:43:47 +0100 Subject: [PATCH 15/21] Fix table setting type --- .../settings/controls/TableSelect.svelte | 42 ++++++++++--------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/packages/builder/src/components/design/settings/controls/TableSelect.svelte b/packages/builder/src/components/design/settings/controls/TableSelect.svelte index b41098da2d..384bbe1e3a 100644 --- a/packages/builder/src/components/design/settings/controls/TableSelect.svelte +++ b/packages/builder/src/components/design/settings/controls/TableSelect.svelte @@ -1,26 +1,28 @@ -
- -
- - +