로그 제거
This commit is contained in:
@@ -130,56 +130,27 @@ export function TableSearchWidget({ component, screenId, onHeightChange }: Table
|
||||
return;
|
||||
}
|
||||
|
||||
console.log("🔄 [TableSearchWidget] select 옵션 초기 로드:", {
|
||||
activeFiltersCount: activeFilters.length,
|
||||
selectFiltersCount: selectFilters.length,
|
||||
dataCount: currentTable.dataCount,
|
||||
});
|
||||
|
||||
const newOptions: Record<string, Array<{ label: string; value: string }>> = { ...selectOptions };
|
||||
|
||||
for (const filter of selectFilters) {
|
||||
// 이미 로드된 옵션이 있으면 스킵 (초기값 유지)
|
||||
if (newOptions[filter.columnName] && newOptions[filter.columnName].length > 0) {
|
||||
console.log("⏭️ [TableSearchWidget] 이미 로드된 옵션 스킵:", filter.columnName);
|
||||
continue;
|
||||
}
|
||||
|
||||
try {
|
||||
const options = await currentTable.getColumnUniqueValues(filter.columnName);
|
||||
newOptions[filter.columnName] = options;
|
||||
console.log("✅ [TableSearchWidget] select 옵션 로드:", {
|
||||
columnName: filter.columnName,
|
||||
optionCount: options.length,
|
||||
options: options.slice(0, 5),
|
||||
});
|
||||
} catch (error) {
|
||||
console.error("❌ [TableSearchWidget] select 옵션 로드 실패:", filter.columnName, error);
|
||||
}
|
||||
}
|
||||
|
||||
console.log("✅ [TableSearchWidget] 최종 selectOptions:", newOptions);
|
||||
setSelectOptions(newOptions);
|
||||
};
|
||||
|
||||
loadSelectOptions();
|
||||
}, [activeFilters, currentTable?.tableName, currentTable?.getColumnUniqueValues]); // dataCount 제거, tableName으로 변경
|
||||
|
||||
// 디버깅: 현재 테이블 정보 로깅
|
||||
useEffect(() => {
|
||||
if (currentTable) {
|
||||
console.log("🔍 [TableSearchWidget] 현재 테이블 정보:", {
|
||||
selectedTableId,
|
||||
tableId: currentTable.tableId,
|
||||
tableName: currentTable.tableName,
|
||||
label: currentTable.label,
|
||||
dataCount: currentTable.dataCount,
|
||||
hasDataCount: currentTable.dataCount !== undefined,
|
||||
});
|
||||
} else {
|
||||
console.log("🔍 [TableSearchWidget] 테이블 없음:", { selectedTableId });
|
||||
}
|
||||
}, [selectedTableId, currentTable?.dataCount]);
|
||||
|
||||
// 높이 변화 감지 및 알림 (실제 화면에서만)
|
||||
useEffect(() => {
|
||||
@@ -192,14 +163,6 @@ export function TableSearchWidget({ component, screenId, onHeightChange }: Table
|
||||
for (const entry of entries) {
|
||||
const newHeight = entry.contentRect.height;
|
||||
|
||||
console.log("📏 [TableSearchWidget] 높이 변화 감지:", {
|
||||
screenId,
|
||||
componentId: component.id,
|
||||
originalHeight,
|
||||
newHeight,
|
||||
heightDiff: newHeight - originalHeight,
|
||||
});
|
||||
|
||||
// Context에 높이 저장 (다른 컴포넌트 위치 조정에 사용)
|
||||
setWidgetHeight(screenId, component.id, newHeight, originalHeight);
|
||||
|
||||
@@ -234,14 +197,6 @@ export function TableSearchWidget({ component, screenId, onHeightChange }: Table
|
||||
try {
|
||||
const { height, originalHeight } = JSON.parse(savedData);
|
||||
setWidgetHeight(screenId, component.id, height, originalHeight);
|
||||
|
||||
console.log("📥 [TableSearchWidget] 저장된 높이 복원:", {
|
||||
screenId,
|
||||
componentId: component.id,
|
||||
height,
|
||||
originalHeight,
|
||||
heightDiff: height - originalHeight,
|
||||
});
|
||||
} catch (error) {
|
||||
console.error("저장된 높이 복원 실패:", error);
|
||||
}
|
||||
@@ -252,12 +207,6 @@ export function TableSearchWidget({ component, screenId, onHeightChange }: Table
|
||||
|
||||
// 필터 값 변경 핸들러
|
||||
const handleFilterChange = (columnName: string, value: string) => {
|
||||
console.log("🔍 [TableSearchWidget] 필터 값 변경:", {
|
||||
columnName,
|
||||
value,
|
||||
currentTable: currentTable?.tableId,
|
||||
});
|
||||
|
||||
const newValues = {
|
||||
...filterValues,
|
||||
[columnName]: value,
|
||||
@@ -277,13 +226,6 @@ export function TableSearchWidget({ component, screenId, onHeightChange }: Table
|
||||
value: values[filter.columnName] || "",
|
||||
})).filter((f) => f.value !== "");
|
||||
|
||||
console.log("🔍 [TableSearchWidget] 필터 적용:", {
|
||||
activeFilters: activeFilters.length,
|
||||
filtersWithValues: filtersWithValues.length,
|
||||
filters: filtersWithValues,
|
||||
hasOnFilterChange: !!currentTable?.onFilterChange,
|
||||
});
|
||||
|
||||
currentTable?.onFilterChange(filtersWithValues);
|
||||
};
|
||||
|
||||
@@ -328,12 +270,6 @@ export function TableSearchWidget({ component, screenId, onHeightChange }: Table
|
||||
case "select": {
|
||||
let options = selectOptions[filter.columnName] || [];
|
||||
|
||||
console.log("🔍 [renderFilterInput] select 렌더링:", {
|
||||
columnName: filter.columnName,
|
||||
selectOptions: selectOptions[filter.columnName],
|
||||
optionsLength: options.length,
|
||||
});
|
||||
|
||||
// 현재 선택된 값이 옵션 목록에 없으면 추가 (데이터 없을 때도 선택값 유지)
|
||||
if (value && !options.find(opt => opt.value === value)) {
|
||||
const savedLabel = selectedLabels[filter.columnName] || value;
|
||||
@@ -348,14 +284,6 @@ export function TableSearchWidget({ component, screenId, onHeightChange }: Table
|
||||
return acc;
|
||||
}, [] as Array<{ value: string; label: string }>);
|
||||
|
||||
console.log("✅ [renderFilterInput] uniqueOptions:", {
|
||||
columnName: filter.columnName,
|
||||
originalOptionsLength: options.length,
|
||||
uniqueOptionsLength: uniqueOptions.length,
|
||||
originalOptions: options,
|
||||
uniqueOptions: uniqueOptions,
|
||||
});
|
||||
|
||||
return (
|
||||
<Select
|
||||
value={value}
|
||||
@@ -455,10 +383,7 @@ export function TableSearchWidget({ component, screenId, onHeightChange }: Table
|
||||
<Button
|
||||
variant="outline"
|
||||
size="sm"
|
||||
onClick={() => {
|
||||
console.log("🔘 [TableSearchWidget] 테이블 옵션 버튼 클릭");
|
||||
setColumnVisibilityOpen(true);
|
||||
}}
|
||||
onClick={() => setColumnVisibilityOpen(true)}
|
||||
disabled={!selectedTableId}
|
||||
className="h-8 text-xs sm:h-9 sm:text-sm"
|
||||
>
|
||||
@@ -469,10 +394,7 @@ export function TableSearchWidget({ component, screenId, onHeightChange }: Table
|
||||
<Button
|
||||
variant="outline"
|
||||
size="sm"
|
||||
onClick={() => {
|
||||
console.log("🔘 [TableSearchWidget] 필터 설정 버튼 클릭");
|
||||
setFilterOpen(true);
|
||||
}}
|
||||
onClick={() => setFilterOpen(true)}
|
||||
disabled={!selectedTableId}
|
||||
className="h-8 text-xs sm:h-9 sm:text-sm"
|
||||
>
|
||||
@@ -483,10 +405,7 @@ export function TableSearchWidget({ component, screenId, onHeightChange }: Table
|
||||
<Button
|
||||
variant="outline"
|
||||
size="sm"
|
||||
onClick={() => {
|
||||
console.log("🔘 [TableSearchWidget] 그룹 설정 버튼 클릭");
|
||||
setGroupingOpen(true);
|
||||
}}
|
||||
onClick={() => setGroupingOpen(true)}
|
||||
disabled={!selectedTableId}
|
||||
className="h-8 text-xs sm:h-9 sm:text-sm"
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user