test(export): stale-group + same-date ordinal coverage; comment/guard polish
This commit is contained in:
@@ -44,7 +44,7 @@ export default function ExportDataModal({
|
||||
return () => { alive = false; };
|
||||
}, [experimentId]);
|
||||
|
||||
const params = useMemo(() => listExportableParams(dailyTemplate, statuses), [dailyTemplate, statuses]);
|
||||
const params = useMemo(() => listExportableParams(dailyTemplate ?? [], statuses), [dailyTemplate, statuses]);
|
||||
const effDataId = dataId ?? params[0]?.id ?? null;
|
||||
const dataParam = params.find((p) => p.id === effDataId) ?? params[0] ?? null;
|
||||
|
||||
|
||||
@@ -207,7 +207,7 @@ function escapeCsvCell(value) {
|
||||
}
|
||||
|
||||
// Serialize a matrix to an RFC-4180-ish CSV string (LF line endings):
|
||||
// <pinned label>,<pinned value>
|
||||
// Data,<metric>
|
||||
// (blank line)
|
||||
// [Group,<group per subject column>] -- only when groupAxis === 'col'
|
||||
// <corner>[,Group?],<column headers...>
|
||||
@@ -222,6 +222,8 @@ export function toCSV(matrix) {
|
||||
lines.push(groupRow.map(escapeCsvCell).join(','));
|
||||
}
|
||||
|
||||
// toCSV is a general serializer; the subject-series builder never emits groupAxis
|
||||
// === 'row' (only 'col' or null), but the branch is retained for that generality.
|
||||
const header = matrix.groupAxis === 'row'
|
||||
? ['Group', matrix.corner, ...matrix.columns.map((c) => c.label)]
|
||||
: [matrix.corner, ...matrix.columns.map((c) => c.label)];
|
||||
|
||||
Reference in New Issue
Block a user