Skip to content

Commit 506c5c9

Browse files
Copilothotlong
andcommitted
fix: address code review feedback - CSV escaping, date timezone, chart JSX restoration
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent 9bebb90 commit 506c5c9

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

packages/plugin-charts/src/AdvancedChartImpl.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,12 @@ export default function AdvancedChartImpl({
271271
}
272272

273273
return (
274+
<ChartContainer config={config} className={className}>
275+
<ChartComponent data={data}>
276+
<CartesianGrid vertical={false} />
277+
<XAxis
278+
dataKey={xAxisKey}
279+
tickLine={false}
274280
tickMargin={10}
275281
axisLine={false}
276282
interval={isMobile ? Math.ceil(data.length / 5) : 0}

packages/plugin-gantt/src/GanttView.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,8 +271,8 @@ export function GanttView({
271271
setEditingTask(task.id);
272272
setEditValues({
273273
title: task.title,
274-
start: task.start.toISOString().split('T')[0],
275-
end: task.end.toISOString().split('T')[0],
274+
start: task.start.toLocaleDateString('en-CA'),
275+
end: task.end.toLocaleDateString('en-CA'),
276276
progress: String(task.progress),
277277
});
278278
}

packages/plugin-list/src/ListView.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ export const ListView: React.FC<ListViewProps> = ({
488488
const exportData = maxRecords > 0 ? data.slice(0, maxRecords) : data;
489489

490490
if (format === 'csv') {
491-
const fields = effectiveFields.map((f: any) => typeof f === 'string' ? f : (f.name || f.field));
491+
const fields = effectiveFields.map((f: any) => typeof f === 'string' ? f : (f.name || f.fieldName || f.field));
492492
const rows: string[] = [];
493493
if (includeHeaders) {
494494
rows.push(fields.join(','));
@@ -497,7 +497,7 @@ export const ListView: React.FC<ListViewProps> = ({
497497
rows.push(fields.map((f: string) => {
498498
const val = record[f];
499499
const str = val == null ? '' : String(val);
500-
return str.includes(',') || str.includes('"') ? `"${str.replace(/"/g, '""')}"` : str;
500+
return str.includes(',') || str.includes('"') || str.includes('\n') || str.includes('\r') ? `"${str.replace(/"/g, '""')}"` : str;
501501
}).join(','));
502502
});
503503
const blob = new Blob([rows.join('\n')], { type: 'text/csv;charset=utf-8;' });

0 commit comments

Comments
 (0)