From 8ce3aab2a7c383a0765948552d49a0dc92e65994 Mon Sep 17 00:00:00 2001 From: kevmodrome Date: Wed, 16 Dec 2020 11:35:12 +0100 Subject: [PATCH 01/11] adds try/catch to API key validation --- packages/builder/src/analytics.js | 26 +++++++++++-------- .../components/start/CreateAppModal.svelte | 1 - 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/packages/builder/src/analytics.js b/packages/builder/src/analytics.js index a7166f00f6..10d67addb3 100644 --- a/packages/builder/src/analytics.js +++ b/packages/builder/src/analytics.js @@ -39,19 +39,23 @@ function identify(id) { async function identifyByApiKey(apiKey) { if (!analyticsEnabled) return true - const response = await fetch( - `https://03gaine137.execute-api.eu-west-1.amazonaws.com/prod/account/id?api_key=${apiKey.trim()}` - ) - - if (response.status === 200) { - const id = await response.json() - - await api.put("/api/keys/userId", { value: id }) - identify(id) - return true + try { + const response = await fetch( + `https://03gaine137.execute-api.eu-west-1.amazonaws.com/prod/account/id?api_key=${apiKey.trim()}` + ) + if (response.status === 200) { + const id = await response.json() + + await api.put("/api/keys/userId", { value: id }) + identify(id) + return true + } + + return false + } catch (error) { + console.log(error) } - return false } function captureException(err) { diff --git a/packages/builder/src/components/start/CreateAppModal.svelte b/packages/builder/src/components/start/CreateAppModal.svelte index b88397b6c4..184eaeb2d6 100644 --- a/packages/builder/src/components/start/CreateAppModal.svelte +++ b/packages/builder/src/components/start/CreateAppModal.svelte @@ -27,7 +27,6 @@ // make sure we only fetch once, unless API Key is changed if (isApiKeyValid === undefined || apiKey !== lastApiKey) { - lastApiKey = apiKey // svelte reactivity was causing a requst to get fired mutiple times // so, we make everything await the same promise, if one exists if (!fetchApiKeyPromise) { From 146176f137599f02d7d94233882028d4ddd6f08e Mon Sep 17 00:00:00 2001 From: kevmodrome Date: Wed, 16 Dec 2020 12:30:03 +0100 Subject: [PATCH 02/11] fix: corrects the overflowing multiselect when used with long-form type --- packages/standard-components/package.json | 2 +- packages/standard-components/yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/standard-components/package.json b/packages/standard-components/package.json index 440784e4bb..6a8325eefc 100644 --- a/packages/standard-components/package.json +++ b/packages/standard-components/package.json @@ -33,7 +33,7 @@ "license": "MIT", "gitHead": "284cceb9b703c38566c6e6363c022f79a08d5691", "dependencies": { - "@budibase/bbui": "^1.52.1", + "@budibase/bbui": "^1.52.4", "@budibase/svelte-ag-grid": "^0.0.16", "@fortawesome/fontawesome-free": "^5.14.0", "apexcharts": "^3.22.1", diff --git a/packages/standard-components/yarn.lock b/packages/standard-components/yarn.lock index 2e0a12c25a..507dd84674 100644 --- a/packages/standard-components/yarn.lock +++ b/packages/standard-components/yarn.lock @@ -39,10 +39,10 @@ lodash "^4.17.19" to-fast-properties "^2.0.0" -"@budibase/bbui@^1.52.1": - version "1.52.1" - resolved "https://registry.yarnpkg.com/@budibase/bbui/-/bbui-1.52.1.tgz#7f1612616205debeac0c65242b4856cce07e4cd0" - integrity sha512-950HXR4Z8b0TgJH3Dt7gLgeHlgtBVMTtG+KkFTtID/zeiXohf60wr2cyAuttCZ3yb4rFRHC+SDXo2NOsKdenKw== +"@budibase/bbui@^1.52.4": + version "1.52.4" + resolved "https://registry.yarnpkg.com/@budibase/bbui/-/bbui-1.52.4.tgz#ae3c17e1f49f14e65831703958bcddc6e64afd24" + integrity sha512-/wiv5dSyvXLgy2/zGEslnCsjwE8qqng1D8k5ScSOPEyMab8tzzd1XxfZAN9rp84zIMgAXeH6s5a4j4riR+jVkg== dependencies: markdown-it "^12.0.2" quill "^1.3.7" From 1ce7dfda794711b852dcbc4d87df6df45e214d1a Mon Sep 17 00:00:00 2001 From: kevmodrome Date: Wed, 16 Dec 2020 13:00:07 +0100 Subject: [PATCH 03/11] fixes CreateEditRow not display multiselect correctly when long-form component was used --- packages/builder/package.json | 2 +- .../backend/DataTable/modals/CreateEditRow.svelte | 6 ++++++ packages/builder/yarn.lock | 8 ++++---- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/packages/builder/package.json b/packages/builder/package.json index 542c35205e..7b28d03213 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -63,7 +63,7 @@ } }, "dependencies": { - "@budibase/bbui": "^1.52.2", + "@budibase/bbui": "^1.52.4", "@budibase/client": "^0.3.8", "@budibase/colorpicker": "^1.0.1", "@budibase/svelte-ag-grid": "^0.0.16", diff --git a/packages/builder/src/components/backend/DataTable/modals/CreateEditRow.svelte b/packages/builder/src/components/backend/DataTable/modals/CreateEditRow.svelte index 050c7ce200..1bff069b95 100644 --- a/packages/builder/src/components/backend/DataTable/modals/CreateEditRow.svelte +++ b/packages/builder/src/components/backend/DataTable/modals/CreateEditRow.svelte @@ -45,3 +45,9 @@ {/each} + + diff --git a/packages/builder/yarn.lock b/packages/builder/yarn.lock index 7f650a83bc..f2f7363669 100644 --- a/packages/builder/yarn.lock +++ b/packages/builder/yarn.lock @@ -842,10 +842,10 @@ lodash "^4.17.19" to-fast-properties "^2.0.0" -"@budibase/bbui@^1.52.2": - version "1.52.2" - resolved "https://registry.yarnpkg.com/@budibase/bbui/-/bbui-1.52.2.tgz#a0774880fb755eb81c762bc355550af7f4562b09" - integrity sha512-PxiN5xvr+Z/RpypMDYh3lNhCUnejH1moMoWW7PiuCiho5VXGauR+M8T49p5eTKoFSqRMC7BUdFJJ9ye/cnQxNA== +"@budibase/bbui@^1.52.4": + version "1.52.4" + resolved "https://registry.yarnpkg.com/@budibase/bbui/-/bbui-1.52.4.tgz#ae3c17e1f49f14e65831703958bcddc6e64afd24" + integrity sha512-/wiv5dSyvXLgy2/zGEslnCsjwE8qqng1D8k5ScSOPEyMab8tzzd1XxfZAN9rp84zIMgAXeH6s5a4j4riR+jVkg== dependencies: markdown-it "^12.0.2" quill "^1.3.7" From 17dd8abf58d44e397cf7900ef8114da4ab91f349 Mon Sep 17 00:00:00 2001 From: kevmodrome Date: Wed, 16 Dec 2020 15:22:31 +0100 Subject: [PATCH 04/11] lint fix --- packages/builder/src/analytics.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/builder/src/analytics.js b/packages/builder/src/analytics.js index 10d67addb3..f59d71ac30 100644 --- a/packages/builder/src/analytics.js +++ b/packages/builder/src/analytics.js @@ -45,17 +45,16 @@ async function identifyByApiKey(apiKey) { ) if (response.status === 200) { const id = await response.json() - + await api.put("/api/keys/userId", { value: id }) identify(id) return true } - + return false } catch (error) { console.log(error) } - } function captureException(err) { From b7d7968009017c533c98047a001937b52fc84138 Mon Sep 17 00:00:00 2001 From: kevmodrome Date: Wed, 16 Dec 2020 15:31:20 +0100 Subject: [PATCH 05/11] add back accidently removed line of code --- packages/builder/src/components/start/CreateAppModal.svelte | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/builder/src/components/start/CreateAppModal.svelte b/packages/builder/src/components/start/CreateAppModal.svelte index 184eaeb2d6..b88397b6c4 100644 --- a/packages/builder/src/components/start/CreateAppModal.svelte +++ b/packages/builder/src/components/start/CreateAppModal.svelte @@ -27,6 +27,7 @@ // make sure we only fetch once, unless API Key is changed if (isApiKeyValid === undefined || apiKey !== lastApiKey) { + lastApiKey = apiKey // svelte reactivity was causing a requst to get fired mutiple times // so, we make everything await the same promise, if one exists if (!fetchApiKeyPromise) { From b3497d3846bce5cd9045d67acd0a072758deae24 Mon Sep 17 00:00:00 2001 From: kevmodrome Date: Fri, 18 Dec 2020 11:10:36 +0100 Subject: [PATCH 06/11] fixes encoding issue of file to work with non-english chars --- .../components/backend/TableNavigator/TableDataImport.svelte | 4 +++- packages/server/src/utilities/tests/test.csv | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/builder/src/components/backend/TableNavigator/TableDataImport.svelte b/packages/builder/src/components/backend/TableNavigator/TableDataImport.svelte index d328df4b40..f7b612b296 100644 --- a/packages/builder/src/components/backend/TableNavigator/TableDataImport.svelte +++ b/packages/builder/src/components/backend/TableNavigator/TableDataImport.svelte @@ -18,6 +18,7 @@ let schema = {} let fields = [] + $: console.log(files[0]) $: valid = !schema || fields.every(column => schema[column].success) $: dataImport = { valid, @@ -43,6 +44,7 @@ } async function validateCSV() { + console.log(csvString) const response = await api.post("/api/tables/csv/validate", { csvString, schema: schema || {}, @@ -82,7 +84,7 @@ files = fileArray validateCSV() }) - reader.readAsBinaryString(fileArray[0]) + reader.readAsText(fileArray[0]) } async function omitColumn(columnName) { diff --git a/packages/server/src/utilities/tests/test.csv b/packages/server/src/utilities/tests/test.csv index 2266b348cd..2a193e4df2 100644 --- a/packages/server/src/utilities/tests/test.csv +++ b/packages/server/src/utilities/tests/test.csv @@ -1,4 +1,4 @@ "Name","Age","Address" -"Bert","4324","5 Sesame Street" +"Bertå","4324","5 Sesame Street" "Ernie","34","1 World Trade Center" "Big Bird","23423","44 Second Avenue" \ No newline at end of file From 55e364071f531e0c9faceec5de07cdbd1f554c9b Mon Sep 17 00:00:00 2001 From: kevmodrome Date: Fri, 18 Dec 2020 11:12:00 +0100 Subject: [PATCH 07/11] remove console logs --- .../components/backend/TableNavigator/TableDataImport.svelte | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/builder/src/components/backend/TableNavigator/TableDataImport.svelte b/packages/builder/src/components/backend/TableNavigator/TableDataImport.svelte index f7b612b296..810d7960f5 100644 --- a/packages/builder/src/components/backend/TableNavigator/TableDataImport.svelte +++ b/packages/builder/src/components/backend/TableNavigator/TableDataImport.svelte @@ -18,7 +18,6 @@ let schema = {} let fields = [] - $: console.log(files[0]) $: valid = !schema || fields.every(column => schema[column].success) $: dataImport = { valid, @@ -44,7 +43,6 @@ } async function validateCSV() { - console.log(csvString) const response = await api.post("/api/tables/csv/validate", { csvString, schema: schema || {}, From 67d98119b546e0d6847a741586d7ab6081b5ae12 Mon Sep 17 00:00:00 2001 From: kevmodrome Date: Fri, 18 Dec 2020 11:20:25 +0100 Subject: [PATCH 08/11] updates test --- packages/server/src/utilities/tests/csvParser.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/server/src/utilities/tests/csvParser.spec.js b/packages/server/src/utilities/tests/csvParser.spec.js index 5fc4a9ffe3..48e275fdd1 100644 --- a/packages/server/src/utilities/tests/csvParser.spec.js +++ b/packages/server/src/utilities/tests/csvParser.spec.js @@ -89,7 +89,7 @@ describe("CSV Parser", () => { }) ).toEqual([ { - Name: "Bert", + Name: "Bertå", }, { Name: "Ernie", From b6974cba0878f4e23180362872dbd68950a908e2 Mon Sep 17 00:00:00 2001 From: kevmodrome Date: Fri, 18 Dec 2020 11:29:26 +0100 Subject: [PATCH 09/11] update test snapshot --- .../src/utilities/tests/__snapshots__/csvParser.spec.js.snap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/server/src/utilities/tests/__snapshots__/csvParser.spec.js.snap b/packages/server/src/utilities/tests/__snapshots__/csvParser.spec.js.snap index 1966637f56..3c532413fa 100644 --- a/packages/server/src/utilities/tests/__snapshots__/csvParser.spec.js.snap +++ b/packages/server/src/utilities/tests/__snapshots__/csvParser.spec.js.snap @@ -5,7 +5,7 @@ Array [ Object { "Address": "5 Sesame Street", "Age": 4324, - "Name": "Bert", + "Name": "Bertå", }, Object { "Address": "1 World Trade Center", From 4a38b2be70e59741aae22ee3ca7de46ae79c1c4a Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Wed, 23 Dec 2020 22:33:10 +0000 Subject: [PATCH 10/11] add notarization step back in for OSX --- packages/server/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/server/package.json b/packages/server/package.json index d6ad591815..dc8e12639e 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -12,6 +12,7 @@ "icon": "./build/icons/512x512.png", "appId": "com.budibase.builder", "productName": "Budibase Builder", + "afterSign": "electron-builder-notarize", "mac": { "icon": "./assets/icons/icon.icns", "category": "public.app-category.developer-tools", From 736adca7a476415e52bb283730e8fee57c4067d7 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Wed, 23 Dec 2020 22:39:10 +0000 Subject: [PATCH 11/11] v0.4.3 --- lerna.json | 2 +- packages/builder/package.json | 4 ++-- packages/client/package.json | 4 ++-- packages/server/package.json | 4 ++-- packages/standard-components/package.json | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lerna.json b/lerna.json index 256258d6b1..1585b03a18 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "0.4.2", + "version": "0.4.3", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/builder/package.json b/packages/builder/package.json index 9754c9173b..df660229fa 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "0.4.2", + "version": "0.4.3", "license": "AGPL-3.0", "private": true, "scripts": { @@ -64,7 +64,7 @@ }, "dependencies": { "@budibase/bbui": "^1.52.4", - "@budibase/client": "^0.4.2", + "@budibase/client": "^0.4.3", "@budibase/colorpicker": "^1.0.1", "@budibase/svelte-ag-grid": "^0.0.16", "@fortawesome/fontawesome-free": "^5.14.0", diff --git a/packages/client/package.json b/packages/client/package.json index bf24a6e86c..55ad2531ff 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "0.4.2", + "version": "0.4.3", "license": "MPL-2.0", "main": "dist/budibase-client.js", "module": "dist/budibase-client.js", @@ -15,7 +15,7 @@ "svelte-spa-router": "^3.0.5" }, "devDependencies": { - "@budibase/standard-components": "^0.4.2", + "@budibase/standard-components": "^0.4.3", "@rollup/plugin-commonjs": "^16.0.0", "@rollup/plugin-node-resolve": "^10.0.0", "fs-extra": "^8.1.0", diff --git a/packages/server/package.json b/packages/server/package.json index dc8e12639e..39725c438c 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "0.4.2", + "version": "0.4.3", "description": "Budibase Web Server", "main": "src/electron.js", "repository": { @@ -49,7 +49,7 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/client": "^0.4.2", + "@budibase/client": "^0.4.3", "@koa/router": "^8.0.0", "@sendgrid/mail": "^7.1.1", "@sentry/node": "^5.19.2", diff --git a/packages/standard-components/package.json b/packages/standard-components/package.json index 6da7bc4733..006fe9da5c 100644 --- a/packages/standard-components/package.json +++ b/packages/standard-components/package.json @@ -29,7 +29,7 @@ "keywords": [ "svelte" ], - "version": "0.4.2", + "version": "0.4.3", "license": "MIT", "gitHead": "284cceb9b703c38566c6e6363c022f79a08d5691", "dependencies": {