From 0810debd2ba08d1648a16079b880fb4dd0c5f07a Mon Sep 17 00:00:00 2001 From: SeongHyun Kim Date: Wed, 17 Dec 2025 15:00:45 +0900 Subject: [PATCH] =?UTF-8?q?fix(universal-form-modal):=20=EC=98=B5=EC=85=94?= =?UTF-8?q?=EB=84=90=20=ED=95=84=EB=93=9C=20=EA=B7=B8=EB=A3=B9=20=EC=97=B0?= =?UTF-8?q?=EB=8F=99=20=ED=95=84=EB=93=9C=20=EA=B8=B0=EB=B3=B8=EA=B0=92=20?= =?UTF-8?q?=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 모달 초기화 시 optionalFieldGroups의 triggerField에 기본값 설정 - triggerValueOnRemove 값을 기본값으로 사용 (비활성화 상태 기본값) - 수정 모드에서는 기존 데이터 값 유지 --- .../UniversalFormModalComponent.tsx | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/frontend/lib/registry/components/universal-form-modal/UniversalFormModalComponent.tsx b/frontend/lib/registry/components/universal-form-modal/UniversalFormModalComponent.tsx index 6f4ef0fc..3c47a1ba 100644 --- a/frontend/lib/registry/components/universal-form-modal/UniversalFormModalComponent.tsx +++ b/frontend/lib/registry/components/universal-form-modal/UniversalFormModalComponent.tsx @@ -390,6 +390,19 @@ export function UniversalFormModalComponent({ newFormData[field.columnName] = value; } + + // 옵셔널 필드 그룹의 연동 필드 기본값 설정 + // triggerValueOnRemove 값을 기본값으로 사용 (옵셔널 그룹이 비활성화 상태일 때의 기본값) + if (section.optionalFieldGroups) { + for (const group of section.optionalFieldGroups) { + if (group.triggerField && group.triggerValueOnRemove !== undefined) { + // effectiveInitialData에 해당 값이 없는 경우에만 기본값 설정 + if (!effectiveInitialData || effectiveInitialData[group.triggerField] === undefined) { + newFormData[group.triggerField] = group.triggerValueOnRemove; + } + } + } + } } }