From 8ce3aab2a7c383a0765948552d49a0dc92e65994 Mon Sep 17 00:00:00 2001 From: kevmodrome Date: Wed, 16 Dec 2020 11:35:12 +0100 Subject: [PATCH 1/5] 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 2/5] 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 3/5] 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 4/5] 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 5/5] 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) {