리스트 위젯 컨텐츠가 렌더링이 안되는 문제 해결
This commit is contained in:
@@ -270,14 +270,28 @@ export function WidgetConfigSidebar({ element, isOpen, onClose, onApply }: Widge
|
||||
const handleApply = useCallback(() => {
|
||||
if (!element) return;
|
||||
|
||||
// 다중 데이터 소스를 사용하는 위젯 체크
|
||||
const isMultiDataSourceWidget =
|
||||
element.subtype === "map-summary-v2" ||
|
||||
element.subtype === "chart" ||
|
||||
element.subtype === "list-v2" ||
|
||||
element.subtype === "custom-metric-v2" ||
|
||||
element.subtype === "risk-alert-v2";
|
||||
|
||||
const updatedElement: DashboardElement = {
|
||||
...element,
|
||||
customTitle: customTitle.trim() || undefined,
|
||||
showHeader,
|
||||
// 데이터 소스가 필요한 위젯만 dataSource 포함
|
||||
// 데이터 소스 처리
|
||||
...(needsDataSource(element.subtype)
|
||||
? {
|
||||
dataSource,
|
||||
// 다중 데이터 소스 위젯은 dataSources도 포함
|
||||
...(isMultiDataSourceWidget
|
||||
? {
|
||||
dataSources: element.dataSources || [],
|
||||
}
|
||||
: {}),
|
||||
}
|
||||
: {}),
|
||||
// 리스트 위젯 설정
|
||||
@@ -291,7 +305,16 @@ export function WidgetConfigSidebar({ element, isOpen, onClose, onApply }: Widge
|
||||
element.subtype === "chart" ||
|
||||
["bar", "horizontal-bar", "pie", "line", "area", "stacked-bar", "donut", "combo"].includes(element.subtype)
|
||||
? {
|
||||
chartConfig,
|
||||
// 다중 데이터 소스 위젯은 chartConfig에 dataSources 포함
|
||||
chartConfig: isMultiDataSourceWidget
|
||||
? { ...chartConfig, dataSources: element.dataSources || [] }
|
||||
: chartConfig,
|
||||
// 프론트엔드 호환성을 위해 dataSources도 element에 직접 포함
|
||||
...(isMultiDataSourceWidget
|
||||
? {
|
||||
dataSources: element.dataSources || [],
|
||||
}
|
||||
: {}),
|
||||
}
|
||||
: {}),
|
||||
// 커스텀 메트릭 설정
|
||||
|
||||
Reference in New Issue
Block a user