fix: add missing column patterns to types

This commit is contained in:
Christian Vidal Wolf
2026-04-28 09:22:03 +02:00
parent 69f9773410
commit 3d89b2538a
2 changed files with 14 additions and 5 deletions
+7 -5
View File
@@ -195,12 +195,12 @@ export function PricingView({ data, headers, onSaveRow, onCaptureState, onEdit,
}).slice(0, 50); }).slice(0, 50);
}, [data, search, selectedSearchItems, COLUMNS]); }, [data, search, selectedSearchItems, COLUMNS]);
const handleSearchItemClick = (index: number) => { const handleSearchItemClick = (sku: string) => {
const newSelected = new Set(selectedSearchItems); const newSelected = new Set(selectedSearchItems);
if (newSelected.has(index)) { if (newSelected.has(sku)) {
newSelected.delete(index); newSelected.delete(sku);
} else { } else {
newSelected.add(index); newSelected.add(sku);
} }
setSelectedSearchItems(newSelected); setSelectedSearchItems(newSelected);
}; };
@@ -1041,6 +1041,7 @@ export function PricingView({ data, headers, onSaveRow, onCaptureState, onEdit,
{openFilter === 'global' && ( {openFilter === 'global' && (
<div className="absolute top-full left-0 z-[10000]"> <div className="absolute top-full left-0 z-[10000]">
<TextFilterPopover <TextFilterPopover
triggerId="global-filter-trigger"
value={globalAdvancedFilter} value={globalAdvancedFilter}
onChange={setGlobalAdvancedFilter} onChange={setGlobalAdvancedFilter}
onClose={() => setOpenFilter(null)} onClose={() => setOpenFilter(null)}
@@ -2286,11 +2287,12 @@ export function PricingView({ data, headers, onSaveRow, onCaptureState, onEdit,
} }
// ── Text filter popover ─────────────────────────────────────────────────────── // ── Text filter popover ───────────────────────────────────────────────────────
function TextFilterPopover({ value, onChange, onClose, triggerId }: { function TextFilterPopover({ value, onChange, onClose, triggerId, zIndex = 9999 }: {
value: { terms: string[]; op: 'and' | 'or' }; value: { terms: string[]; op: 'and' | 'or' };
onChange: (v: { terms: string[]; op: 'and' | 'or' }) => void; onChange: (v: { terms: string[]; op: 'and' | 'or' }) => void;
onClose: () => void; onClose: () => void;
triggerId: string; triggerId: string;
zIndex?: number;
}) { }) {
const [position, setPosition] = useState({ top: 0, left: 0 }); const [position, setPosition] = useState({ top: 0, left: 0 });
+7
View File
@@ -74,6 +74,13 @@ export const COLUMN_PATTERNS: Record<keyof typeof COLUMNS, string[]> = {
OUTER_W: ['outer', 'w'], OUTER_W: ['outer', 'w'],
OUTER_L: ['outer', 'l'], OUTER_L: ['outer', 'l'],
OUTER_H: ['outer', 'h'], OUTER_H: ['outer', 'h'],
VERIFIED_DIMS: ['verified', 'dims'],
VALIDATED_CHECK: ['validated', 'check'],
VALIDATED_NOTE: ['validated', 'note'],
PRODUCT_TYPE: ['product', 'type'],
ITEM_TO_LOGISTIC: ['item', 'logistic'],
ANNA_CHECK: ['anna', 'check'],
ANNA_NOTE: ['anna', 'note'],
// Virtual/Extra columns stay hardcoded and are NOT auto-detected from headers // Virtual/Extra columns stay hardcoded and are NOT auto-detected from headers
// to prevent internal data from being shifted or overwritten by Excel column shifts. // to prevent internal data from being shifted or overwritten by Excel column shifts.
}; };