UnifiedRepeaterConfigPanel: Update render mode handling to reset modal settings when switching from modal to inline mode
This commit is contained in:
parent
5c098a0395
commit
321c52a1f8
|
|
@ -477,7 +477,36 @@ export const UnifiedRepeaterConfigPanel: React.FC<UnifiedRepeaterConfigPanelProp
|
|||
{/* 렌더링 모드 */}
|
||||
<div className="space-y-2">
|
||||
<Label className="text-xs font-medium">렌더링 모드</Label>
|
||||
<Select value={config.renderMode} onValueChange={(value) => updateConfig({ renderMode: value as any })}>
|
||||
<Select
|
||||
value={config.renderMode}
|
||||
onValueChange={(value) => {
|
||||
const newMode = value as any;
|
||||
const currentMode = config.renderMode;
|
||||
|
||||
// 모달 → 인라인 모드로 변경 시: isSourceDisplay 컬럼 제거 및 모달 설정 초기화
|
||||
if (currentMode === "modal" && newMode === "inline") {
|
||||
const filteredColumns = config.columns.filter((col) => !col.isSourceDisplay);
|
||||
updateConfig({
|
||||
renderMode: newMode,
|
||||
columns: filteredColumns,
|
||||
dataSource: {
|
||||
...config.dataSource,
|
||||
sourceTable: undefined,
|
||||
foreignKey: undefined,
|
||||
referenceKey: undefined,
|
||||
displayColumn: undefined,
|
||||
},
|
||||
modal: {
|
||||
...config.modal,
|
||||
searchFields: [],
|
||||
sourceDisplayColumns: [],
|
||||
},
|
||||
});
|
||||
} else {
|
||||
updateConfig({ renderMode: newMode });
|
||||
}
|
||||
}}
|
||||
>
|
||||
<SelectTrigger className="h-8 text-xs">
|
||||
<SelectValue placeholder="모드 선택" />
|
||||
</SelectTrigger>
|
||||
|
|
|
|||
Loading…
Reference in New Issue