적용 버튼 비활성화 조건 추가
This commit is contained in:
parent
54b7cae218
commit
d3b7859668
|
|
@ -566,7 +566,21 @@ export function WidgetConfigSidebar({ element, isOpen, onClose, onApply }: Widge
|
|||
<Button variant="outline" onClick={onClose} className="h-9 flex-1 text-sm">
|
||||
취소
|
||||
</Button>
|
||||
<Button onClick={handleApply} className="h-9 flex-1 text-sm">
|
||||
<Button
|
||||
onClick={handleApply}
|
||||
className="h-9 flex-1 text-sm"
|
||||
disabled={
|
||||
// 다중 데이터 소스 위젯: dataSources가 비어있거나 endpoint가 없으면 비활성화
|
||||
(element?.subtype === "map-summary-v2" ||
|
||||
element?.subtype === "chart" ||
|
||||
element?.subtype === "list-v2" ||
|
||||
element?.subtype === "custom-metric-v2" ||
|
||||
element?.subtype === "risk-alert-v2") &&
|
||||
(!dataSources ||
|
||||
dataSources.length === 0 ||
|
||||
dataSources.some(ds => ds.type === "api" && !ds.endpoint))
|
||||
}
|
||||
>
|
||||
적용
|
||||
</Button>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in New Issue