fix: 테이블 검색 필터 위젯 - 테이블 등록 및 선택 기능 수정
- TableListComponent: tableConfig.columns 기반 테이블 등록 - TableSearchWidget: 불필요한 로그 제거 - TableOptionsContext: 등록/해제 로그 제거 - TableListComponent 일부 카테고리 로그 제거 (진행중)
This commit is contained in:
parent
c6941bc41f
commit
73049c4162
|
|
@ -37,10 +37,6 @@ export const TableOptionsProvider: React.FC<{ children: ReactNode }> = ({
|
|||
|
||||
return newMap;
|
||||
});
|
||||
|
||||
console.log(
|
||||
`[TableOptions] 테이블 등록: ${registration.label} (${registration.tableId})`
|
||||
);
|
||||
}, []);
|
||||
|
||||
/**
|
||||
|
|
@ -53,8 +49,6 @@ export const TableOptionsProvider: React.FC<{ children: ReactNode }> = ({
|
|||
const removed = newMap.delete(tableId);
|
||||
|
||||
if (removed) {
|
||||
console.log(`[TableOptions] 테이블 해제: ${tableId}`);
|
||||
|
||||
// 선택된 테이블이 제거되면 첫 번째 테이블 선택
|
||||
if (selectedTableId === tableId) {
|
||||
const firstTableId = newMap.keys().next().value;
|
||||
|
|
|
|||
|
|
@ -526,42 +526,20 @@ export const TableListComponent: React.FC<TableListComponentProps> = ({
|
|||
.filter(([_, meta]) => meta.inputType === "category")
|
||||
.map(([columnName, _]) => columnName);
|
||||
|
||||
console.log("🔍 [TableList] 카테고리 컬럼 추출:", {
|
||||
columnMeta,
|
||||
categoryColumns: cols,
|
||||
columnMetaKeys: Object.keys(columnMeta),
|
||||
});
|
||||
|
||||
return cols;
|
||||
}, [columnMeta]);
|
||||
|
||||
// 카테고리 매핑 로드 (columnMeta 변경 시 즉시 실행)
|
||||
useEffect(() => {
|
||||
const loadCategoryMappings = async () => {
|
||||
console.log("🔄 [TableList] loadCategoryMappings 트리거:", {
|
||||
hasTable: !!tableConfig.selectedTable,
|
||||
table: tableConfig.selectedTable,
|
||||
categoryColumnsLength: categoryColumns.length,
|
||||
categoryColumns,
|
||||
columnMetaKeys: Object.keys(columnMeta),
|
||||
});
|
||||
|
||||
if (!tableConfig.selectedTable) {
|
||||
console.log("⏭️ [TableList] 테이블 선택 안됨, 카테고리 매핑 로드 스킵");
|
||||
return;
|
||||
}
|
||||
|
||||
if (categoryColumns.length === 0) {
|
||||
console.log("⏭️ [TableList] 카테고리 컬럼 없음, 카테고리 매핑 로드 스킵");
|
||||
setCategoryMappings({});
|
||||
return;
|
||||
}
|
||||
|
||||
console.log("🚀 [TableList] 카테고리 매핑 로드 시작:", {
|
||||
table: tableConfig.selectedTable,
|
||||
categoryColumns,
|
||||
columnMetaKeys: Object.keys(columnMeta),
|
||||
});
|
||||
|
||||
try {
|
||||
const mappings: Record<string, Record<string, { label: string; color?: string }>> = {};
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@ export function TableSearchWidget({ component }: TableSearchWidgetProps) {
|
|||
// 첫 번째 테이블 자동 선택
|
||||
useEffect(() => {
|
||||
const tables = Array.from(registeredTables.values());
|
||||
|
||||
if (autoSelectFirstTable && tables.length > 0 && !selectedTableId) {
|
||||
setSelectedTableId(tables[0].tableId);
|
||||
}
|
||||
|
|
@ -107,7 +108,10 @@ export function TableSearchWidget({ component }: TableSearchWidgetProps) {
|
|||
<Button
|
||||
variant="outline"
|
||||
size="sm"
|
||||
onClick={() => setColumnVisibilityOpen(true)}
|
||||
onClick={() => {
|
||||
console.log("🔘 [TableSearchWidget] 테이블 옵션 버튼 클릭");
|
||||
setColumnVisibilityOpen(true);
|
||||
}}
|
||||
disabled={!selectedTableId}
|
||||
className="h-8 text-xs sm:h-9 sm:text-sm"
|
||||
>
|
||||
|
|
@ -118,7 +122,10 @@ export function TableSearchWidget({ component }: TableSearchWidgetProps) {
|
|||
<Button
|
||||
variant="outline"
|
||||
size="sm"
|
||||
onClick={() => setFilterOpen(true)}
|
||||
onClick={() => {
|
||||
console.log("🔘 [TableSearchWidget] 필터 설정 버튼 클릭");
|
||||
setFilterOpen(true);
|
||||
}}
|
||||
disabled={!selectedTableId}
|
||||
className="h-8 text-xs sm:h-9 sm:text-sm"
|
||||
>
|
||||
|
|
@ -129,7 +136,10 @@ export function TableSearchWidget({ component }: TableSearchWidgetProps) {
|
|||
<Button
|
||||
variant="outline"
|
||||
size="sm"
|
||||
onClick={() => setGroupingOpen(true)}
|
||||
onClick={() => {
|
||||
console.log("🔘 [TableSearchWidget] 그룹 설정 버튼 클릭");
|
||||
setGroupingOpen(true);
|
||||
}}
|
||||
disabled={!selectedTableId}
|
||||
className="h-8 text-xs sm:h-9 sm:text-sm"
|
||||
>
|
||||
|
|
|
|||
Loading…
Reference in New Issue