From 3d48a8f7f3d463ae735bc177af700c879e34e554 Mon Sep 17 00:00:00 2001 From: melohagan <101575380+melohagan@users.noreply.github.com> Date: Tue, 27 Feb 2024 11:26:45 +0000 Subject: [PATCH 1/3] Don't encode twice (#13138) --- packages/builder/src/helpers/data/utils.js | 6 +++++- packages/builder/src/helpers/tests/dataUtils.test.js | 7 +++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/packages/builder/src/helpers/data/utils.js b/packages/builder/src/helpers/data/utils.js index a29ce8db6d..a592b57a26 100644 --- a/packages/builder/src/helpers/data/utils.js +++ b/packages/builder/src/helpers/data/utils.js @@ -17,6 +17,10 @@ export function breakQueryString(qs) { return paramObj } +function isEncoded(str) { + return typeof str == "string" && decodeURIComponent(str) !== str +} + export function buildQueryString(obj) { let str = "" if (obj) { @@ -35,7 +39,7 @@ export function buildQueryString(obj) { value = value.replace(binding, marker) bindingMarkers[marker] = binding }) - let encoded = encodeURIComponent(value || "") + let encoded = isEncoded(value) ? value : encodeURIComponent(value || "") Object.entries(bindingMarkers).forEach(([marker, binding]) => { encoded = encoded.replace(marker, binding) }) diff --git a/packages/builder/src/helpers/tests/dataUtils.test.js b/packages/builder/src/helpers/tests/dataUtils.test.js index 8fc2d706d7..bd207ea339 100644 --- a/packages/builder/src/helpers/tests/dataUtils.test.js +++ b/packages/builder/src/helpers/tests/dataUtils.test.js @@ -39,4 +39,11 @@ describe("check query string utils", () => { expect(broken.key1).toBe(obj2.key1) expect(broken.key2).toBe(obj2.key2) }) + + it("should not encode a URL more than once when building the query string", () => { + const queryString = buildQueryString({ + values: "a%2Cb%2Cc", + }) + expect(queryString).toBe("values=a%2Cb%2Cc") + }) }) From 4c203ea35d57ce9248ae31786a58356e3d2719b4 Mon Sep 17 00:00:00 2001 From: melohagan <101575380+melohagan@users.noreply.github.com> Date: Tue, 27 Feb 2024 12:49:11 +0000 Subject: [PATCH 2/3] Budi 6149 export data make csv delimiter configurable (#13140) * Add delimiter option * Add custom delimiter * external export delimiter * Custom headers for row export * External export rows custom headers * Support custom JSON export labels * Handle export table source switch * update account portal * Add space as delimiter * Refactor * update account portal * Update columns from ColumnEditor * Revert "Update columns from ColumnEditor" This reverts commit d23293cd8b5d007b13a8825bc80e161d60f691c0. * Revert "Revert "Update columns from ColumnEditor"" This reverts commit 0f16bddff7a745f7593e331ceedcec5511bbe4ba. --- .../controls/ButtonActionEditor/actions/ExportData.svelte | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/builder/src/components/design/settings/controls/ButtonActionEditor/actions/ExportData.svelte b/packages/builder/src/components/design/settings/controls/ButtonActionEditor/actions/ExportData.svelte index 5955cc762d..096341783d 100644 --- a/packages/builder/src/components/design/settings/controls/ButtonActionEditor/actions/ExportData.svelte +++ b/packages/builder/src/components/design/settings/controls/ButtonActionEditor/actions/ExportData.svelte @@ -106,11 +106,12 @@ /> { const columns = e.detail + parameters.columns = columns parameters.customHeaders = columns.reduce((headerMap, column) => { return { [column.name]: column.displayName, From 2a8bb872adc87d01827eabe6de0535859c5fe6da Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Tue, 27 Feb 2024 12:49:37 +0000 Subject: [PATCH 3/3] Bump version to 2.20.12 --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index 623fbf6d43..e1a469adf1 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.20.11", + "version": "2.20.12", "npmClient": "yarn", "packages": [ "packages/*",