Fix: Implement dynamic column detection to handle Excel structure changes (insertion of PM Classification). This fixes the Missing data error in Pricing Units and other views.

This commit is contained in:
Christian Vidal Wolf
2026-04-22 16:52:59 +02:00
parent 8471a69529
commit d43d9931c6
15 changed files with 176 additions and 55 deletions
+3 -1
View File
@@ -1,7 +1,8 @@
import React, { useState, useEffect } from 'react';
import { History, RotateCcw, ChevronDown, ChevronRight, User, Calendar, Tag, Search, X, Edit2 } from 'lucide-react';
import { getHistory, deleteHistoryEntry, HistoryEntry } from '../lib/supabase';
import { ExcelRow, COLUMNS } from '../types';
import { ExcelRow } from '../types';
import { useColumns } from '../contexts/ColumnsContext';
import { cn } from '../lib/utils';
interface HistoryViewProps {
@@ -13,6 +14,7 @@ interface HistoryViewProps {
}
export function HistoryView({ headers, data, onRevert, onEdit, sessionToken }: HistoryViewProps) {
const COLUMNS = useColumns();
const [history, setHistory] = useState<HistoryEntry[]>([]);
const [loading, setLoading] = useState(true);
const [expandedId, setExpandedId] = useState<string | null>(null);