Merge branch 'master' into feature/sql-query-aliasing
This commit is contained in:
commit
abf68fdd36
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"version": "2.20.11",
|
||||
"version": "2.20.12",
|
||||
"npmClient": "yarn",
|
||||
"packages": [
|
||||
"packages/*",
|
||||
|
|
|
@ -106,11 +106,12 @@
|
|||
/>
|
||||
<Label small>Export columns</Label>
|
||||
<ColumnEditor
|
||||
bind:value={parameters.columns}
|
||||
value={parameters.columns}
|
||||
allowCellEditing={false}
|
||||
componentInstance={selectedTable}
|
||||
on:change={e => {
|
||||
const columns = e.detail
|
||||
parameters.columns = columns
|
||||
parameters.customHeaders = columns.reduce((headerMap, column) => {
|
||||
return {
|
||||
[column.name]: column.displayName,
|
||||
|
|
|
@ -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)
|
||||
})
|
||||
|
|
|
@ -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")
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue