feat: include empty classification in missing data view and improve pricing view column detection

This commit is contained in:
Christian Vidal Wolf
2026-04-22 14:29:38 +02:00
parent 9d169a0bdd
commit a1b046feb1
2 changed files with 10 additions and 5 deletions
+4 -3
View File
@@ -132,8 +132,9 @@ export function MissingDataView({ data, headers, onSaveRow, onCaptureState }: Mi
if (activeTab === 'missingLaunch') { if (activeTab === 'missingLaunch') {
result = result.filter(r => { result = result.filter(r => {
const val = launchDateCol >= 0 ? r.row[launchDateCol] : undefined; const launchVal = launchDateCol >= 0 ? r.row[launchDateCol] : undefined;
return isEmptyOrEpoch(val); const classVal = r.row[COLUMNS.CLASSIFICATION];
return isEmptyOrEpoch(launchVal) || isEmptyOrEpoch(classVal);
}); });
} }
@@ -293,7 +294,7 @@ export function MissingDataView({ data, headers, onSaveRow, onCaptureState }: Mi
}; };
const tabs: { id: TabType; label: string }[] = [ const tabs: { id: TabType; label: string }[] = [
{ id: 'missingLaunch', label: 'Missing Launch Date' }, { id: 'missingLaunch', label: 'Missing Data' },
{ id: 'launchInconsistent', label: 'Launch Date Inconsistencies' }, { id: 'launchInconsistent', label: 'Launch Date Inconsistencies' },
{ id: 'upcomingLaunch', label: 'Upcoming Launch Date' }, { id: 'upcomingLaunch', label: 'Upcoming Launch Date' },
]; ];
+6 -2
View File
@@ -167,7 +167,7 @@ export function PricingView({ data, headers, onSaveRow, onCaptureState, onEdit,
}, [resizingColumn, resizeStartX, resizeStartWidth]); }, [resizingColumn, resizeStartX, resizeStartWidth]);
// ── Dynamic column detection ────────────────────────────────────────────── // ── Dynamic column detection ──────────────────────────────────────────────
const { uvpIdx, srpCols, containerCols } = useMemo(() => { const { uvpIdx, srpCols, containerCols, nwIdx, gwIdx } = useMemo(() => {
const uvpIdx = findCol(headers, 'uvp'); const uvpIdx = findCol(headers, 'uvp');
// All SRP columns, sorted: INT first, UK second, then alphabetically // All SRP columns, sorted: INT first, UK second, then alphabetically
@@ -188,7 +188,11 @@ export function PricingView({ data, headers, onSaveRow, onCaptureState, onEdit,
.map((h, i) => ({ index: i, name: h || '' })) .map((h, i) => ({ index: i, name: h || '' }))
.filter(({ name }) => /40/i.test(name) && /h[cq]/i.test(name)); .filter(({ name }) => /40/i.test(name) && /h[cq]/i.test(name));
return { uvpIdx, srpCols: srp, containerCols: container }; // Net weight / Gross weight columns
const nwIdx = findCol(headers, 'nw');
const gwIdx = findCol(headers, 'gw');
return { uvpIdx, srpCols: srp, containerCols: container, nwIdx, gwIdx };
}, [headers]); }, [headers]);
// ── Error analysis per row ──────────────────────────────────────────────── // ── Error analysis per row ────────────────────────────────────────────────