지도 위젯 헤더 및 새로고침 버튼 삭제

This commit is contained in:
dohyeons 2025-11-12 18:22:02 +09:00
parent c5d8569522
commit 5e8e714e8a
3 changed files with 15 additions and 44 deletions

View File

@ -853,7 +853,9 @@ export function CanvasElement({
)} )}
{/* 제목 */} {/* 제목 */}
{!element.type || element.type !== "chart" ? ( {!element.type || element.type !== "chart" ? (
<span className="text-foreground text-xs font-bold">{element.customTitle || element.title}</span> element.subtype === "map-summary-v2" && !element.customTitle ? null : (
<span className="text-foreground text-xs font-bold">{element.customTitle || element.title}</span>
)
) : null} ) : null}
</div> </div>
<div className="flex gap-1"> <div className="flex gap-1">

View File

@ -152,7 +152,8 @@ export function WidgetConfigSidebar({ element, isOpen, onClose, onApply }: Widge
setCustomTitle(element.customTitle || ""); setCustomTitle(element.customTitle || "");
setShowHeader(element.showHeader !== false); setShowHeader(element.showHeader !== false);
setDataSource(element.dataSource || { type: "database", connectionType: "current", refreshInterval: 0 }); setDataSource(element.dataSource || { type: "database", connectionType: "current", refreshInterval: 0 });
setDataSources(element.dataSources || []); // dataSources는 element.dataSources 또는 chartConfig.dataSources에서 가져옴
setDataSources(element.dataSources || element.chartConfig?.dataSources || []);
setQueryResult(null); setQueryResult(null);
// 리스트 위젯 설정 초기화 // 리스트 위젯 설정 초기화
@ -301,6 +302,8 @@ export function WidgetConfigSidebar({ element, isOpen, onClose, onApply }: Widge
...(isMultiDataSourceWidget ...(isMultiDataSourceWidget
? { ? {
dataSources: dataSources, dataSources: dataSources,
// chartConfig에도 dataSources 포함 (일부 위젯은 chartConfig에서 읽음)
chartConfig: { ...chartConfig, dataSources: dataSources },
} }
: {}), : {}),
} }

View File

@ -653,27 +653,10 @@ function ViewerElement({ element, data, isLoading, onRefresh, isMobile, canvasWi
> >
{element.showHeader !== false && ( {element.showHeader !== false && (
<div className="flex items-center justify-between px-2 py-1"> <div className="flex items-center justify-between px-2 py-1">
<h3 className="text-foreground text-xs font-semibold">{element.customTitle || element.title}</h3> {/* map-summary-v2는 customTitle이 없으면 제목 숨김 */}
<button {element.subtype === "map-summary-v2" && !element.customTitle ? null : (
onClick={onRefresh} <h3 className="text-foreground text-xs font-semibold">{element.customTitle || element.title}</h3>
disabled={isLoading} )}
className="text-muted-foreground hover:text-foreground transition-colors disabled:opacity-50"
title="새로고침"
>
<svg
className={`h-3 w-3 ${isLoading ? "animate-spin" : ""}`}
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={2}
d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"
/>
</svg>
</button>
</div> </div>
)} )}
<div className={element.showHeader !== false ? "p-2" : "p-2"} style={{ minHeight: "250px" }}> <div className={element.showHeader !== false ? "p-2" : "p-2"} style={{ minHeight: "250px" }}>
@ -716,27 +699,10 @@ function ViewerElement({ element, data, isLoading, onRefresh, isMobile, canvasWi
> >
{element.showHeader !== false && ( {element.showHeader !== false && (
<div className="flex items-center justify-between px-2 py-1"> <div className="flex items-center justify-between px-2 py-1">
<h3 className="text-foreground text-xs font-semibold">{element.customTitle || element.title}</h3> {/* map-summary-v2는 customTitle이 없으면 제목 숨김 */}
<button {element.subtype === "map-summary-v2" && !element.customTitle ? null : (
onClick={onRefresh} <h3 className="text-foreground text-xs font-semibold">{element.customTitle || element.title}</h3>
disabled={isLoading} )}
className="text-muted-foreground hover:text-foreground transition-colors disabled:opacity-50"
title="새로고침"
>
<svg
className={`h-3 w-3 ${isLoading ? "animate-spin" : ""}`}
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={2}
d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"
/>
</svg>
</button>
</div> </div>
)} )}
<div className={element.showHeader !== false ? "h-[calc(100%-32px)] w-full" : "h-full w-full"}> <div className={element.showHeader !== false ? "h-[calc(100%-32px)] w-full" : "h-full w-full"}>