데이터 흐름 설정 개선: INSERT 액션에 대한 필드 매핑 검증 로직 추가 및 새로운 InsertFieldMappingPanel 컴포넌트 구현.

This commit is contained in:
hyeonsu
2025-09-18 17:17:06 +09:00
parent 85e48353f5
commit e6cd8806e3
7 changed files with 783 additions and 4 deletions

View File

@@ -553,6 +553,28 @@ export const ConnectionSetupModal: React.FC<ConnectionSetupModalProps> = ({
return true; // DELETE는 필드 매핑 검증 생략
}
// INSERT 액션의 경우 모든 TO 테이블 컬럼이 매핑되거나 기본값이 있어야 함
if (action.actionType === "insert") {
// TO 테이블의 모든 컬럼을 찾기
const toTableName = action.fieldMappings[0]?.targetTable;
if (!toTableName) return false;
const toTableColumns = tableColumnsCache[toTableName] || [];
if (toTableColumns.length === 0) return false;
// 모든 TO 컬럼이 매핑되거나 기본값이 있는지 확인
return toTableColumns.every((column) => {
const mapping = action.fieldMappings.find((m) => m.targetField === column.columnName);
if (!mapping) return false;
// 소스 매핑 또는 기본값 중 하나는 있어야 함
const hasSource = mapping.sourceTable && mapping.sourceField;
const hasDefault = mapping.defaultValue && mapping.defaultValue.trim();
return hasSource || hasDefault;
});
}
return action.fieldMappings.every((mapping) => {
// 타겟은 항상 필요
if (!mapping.targetTable || !mapping.targetField) return false;