mirror of
https://github.com/christianvidalwolf-prog/Craze-Data-check.git
synced 2026-08-03 13:45:24 +02:00
feat: include empty classification in missing data view and improve pricing view column detection
This commit is contained in:
@@ -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' },
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -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 ────────────────────────────────────────────────
|
||||||
|
|||||||
Reference in New Issue
Block a user