mirror of
https://github.com/christianvidalwolf-prog/Craze-Data-check.git
synced 2026-08-03 14:55:24 +02:00
fix: prevent CPNP_NO from being overridden by dynamic column detection
CPNP_NO must stay hardcoded at index 107. Removed it from COLUMN_PATTERNS and added guard to skip empty patterns in resolveColumnIndices. Co-Authored-By: claude-flow <ruv@ruv.net>
This commit is contained in:
co-authored by
claude-flow
parent
889e98b0ca
commit
1b4918a385
@@ -45,7 +45,7 @@ export function CosmeticItemsView({ data, headers, onSaveRow, onCaptureState, ro
|
||||
if (!COSMETIC_LINES.some(l => lineVal === l)) return;
|
||||
|
||||
columns.forEach(({ col }) => {
|
||||
result[col].add(String(row[col] ?? '').trim());
|
||||
result[col].add(String(row[col] ?? '').replace(/\s+/g, ' ').trim());
|
||||
});
|
||||
});
|
||||
|
||||
@@ -82,11 +82,9 @@ export function CosmeticItemsView({ data, headers, onSaveRow, onCaptureState, ro
|
||||
(Object.entries(columnFilters) as [string, string[]][]).forEach(([colIdx, filterValues]) => {
|
||||
if (!filterValues || filterValues.length === 0) return;
|
||||
const colNum = parseInt(colIdx);
|
||||
const filterSet = new Set(filterValues.map(f => f.trim()));
|
||||
result = result.filter(({ row }) => {
|
||||
const val = String(row[colNum] ?? '').trim();
|
||||
return filterSet.has(val);
|
||||
});
|
||||
const normalize = (v: any) => String(v ?? '').replace(/\s+/g, ' ').trim();
|
||||
const filterSet = new Set(filterValues.map(normalize));
|
||||
result = result.filter(({ row }) => filterSet.has(normalize(row[colNum])));
|
||||
});
|
||||
|
||||
// Sort
|
||||
|
||||
Reference in New Issue
Block a user