From a1b046feb1228cbde585a4536870e0a9851846eb Mon Sep 17 00:00:00 2001 From: Christian Vidal Wolf Date: Wed, 22 Apr 2026 14:29:38 +0200 Subject: [PATCH] feat: include empty classification in missing data view and improve pricing view column detection --- src/components/MissingDataView.tsx | 7 ++++--- src/components/PricingView.tsx | 8 ++++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/components/MissingDataView.tsx b/src/components/MissingDataView.tsx index 391cf04..8ba2a0d 100644 --- a/src/components/MissingDataView.tsx +++ b/src/components/MissingDataView.tsx @@ -132,8 +132,9 @@ export function MissingDataView({ data, headers, onSaveRow, onCaptureState }: Mi if (activeTab === 'missingLaunch') { result = result.filter(r => { - const val = launchDateCol >= 0 ? r.row[launchDateCol] : undefined; - return isEmptyOrEpoch(val); + const launchVal = launchDateCol >= 0 ? r.row[launchDateCol] : undefined; + 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 }[] = [ - { id: 'missingLaunch', label: 'Missing Launch Date' }, + { id: 'missingLaunch', label: 'Missing Data' }, { id: 'launchInconsistent', label: 'Launch Date Inconsistencies' }, { id: 'upcomingLaunch', label: 'Upcoming Launch Date' }, ]; diff --git a/src/components/PricingView.tsx b/src/components/PricingView.tsx index 1f2896a..c941636 100644 --- a/src/components/PricingView.tsx +++ b/src/components/PricingView.tsx @@ -167,7 +167,7 @@ export function PricingView({ data, headers, onSaveRow, onCaptureState, onEdit, }, [resizingColumn, resizeStartX, resizeStartWidth]); // ── Dynamic column detection ────────────────────────────────────────────── - const { uvpIdx, srpCols, containerCols } = useMemo(() => { + const { uvpIdx, srpCols, containerCols, nwIdx, gwIdx } = useMemo(() => { const uvpIdx = findCol(headers, 'uvp'); // 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 || '' })) .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]); // ── Error analysis per row ────────────────────────────────────────────────