Skip to content

Commit 88e3c9f

Browse files
committed
code review changes
1 parent 318eefa commit 88e3c9f

4 files changed

Lines changed: 31 additions & 2 deletions

File tree

packages/components/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/components/src/internal/actions.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ export function exportRows(type: EXPORT_TYPES, exportParams: Record<string, any>
267267
Object.keys(exportParams).forEach(key => {
268268
const value = exportParams[key];
269269

270+
// Issue 52925: App export to csv/tsv ignores filter with column containing double quote
270271
if (value instanceof Array) {
271272
value.forEach(arrayValue => form.append(encodeFormDataQuote(key), arrayValue));
272273
} else {
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { encodeFormDataQuote } from './utils';
2+
3+
describe('encodeFormDataQuote', () => {
4+
test('empty', () => {
5+
expect(encodeFormDataQuote(null)).toBeNull();
6+
expect(encodeFormDataQuote(undefined)).toBeUndefined();
7+
expect(encodeFormDataQuote('')).toBe('');
8+
});
9+
10+
test('no relevant special character', () => {
11+
expect(encodeFormDataQuote('a')).toBe('a')
12+
expect(encodeFormDataQuote('$')).toBe('$');
13+
expect(encodeFormDataQuote('%')).toBe('%');
14+
expect(encodeFormDataQuote('%2522')).toBe('%2522');
15+
});
16+
17+
test('encoded', () => {
18+
expect(encodeFormDataQuote('"')).toBe('%22')
19+
expect(encodeFormDataQuote('""')).toBe('%22%22');
20+
expect(encodeFormDataQuote('"22')).toBe('%2222');
21+
expect(encodeFormDataQuote('"a"')).toBe('%22a%22');
22+
expect(encodeFormDataQuote('a%22')).toBe('a%2522');
23+
expect(encodeFormDataQuote('"a%22')).toBe('%22a%2522');
24+
expect(encodeFormDataQuote('"a%222')).toBe('%22a%25222');
25+
});
26+
});

packages/components/src/internal/url/utils.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,7 @@ export function encodeListResolverPath(containerPath: string): string {
77
}
88

99
export function encodeFormDataQuote(key: string): string {
10+
if (!key)
11+
return key;
1012
return key?.replaceAll('%22', '%2522').replaceAll('"', '%22');
1113
}

0 commit comments

Comments
 (0)