[agent-pipeline] pipe-20260317054958-cypk round-3

This commit is contained in:
DDD1542 2026-03-17 15:04:26 +09:00
parent 2b4500a999
commit 87a7431e53
1 changed files with 11 additions and 11 deletions

View File

@ -77,9 +77,17 @@ interface CategoryValueOption {
valueLabel: string;
}
// ─── 하위 호환: 기존 config에서 fieldType 추론 (우선순위: DB값 > 사용자 fieldType > 컴포넌트구조 > saved config > 기본값) ───
// ─── 하위 호환: 기존 config에서 fieldType 추론 (우선순위: 컴포넌트구조 > DB값 > 사용자 fieldType > saved config > 기본값) ───
function resolveFieldType(config: Record<string, any>, componentType?: string, metaInputType?: string): FieldType {
// (a) metaInputType: DB 전용 (undefined면 스킵, V2PropertiesPanel에서 dbInputType만 전달)
// (a) v2-select 계열: componentType 또는 config.source 우선 (metaInputType보다 먼저 체크)
if (componentType === "v2-select" || config.source) {
const source = config.source === "code" ? "category" : config.source;
if (source === "entity") return "entity";
if (source === "category") return "category";
return "select";
}
// (b) metaInputType: DB 전용 (undefined면 스킵, V2PropertiesPanel에서 dbInputType만 전달)
if (metaInputType && metaInputType !== "direct" && metaInputType !== "auto") {
const dbType = metaInputType as FieldType;
if (["text", "number", "textarea", "numbering", "select", "category", "entity"].includes(dbType)) {
@ -87,17 +95,9 @@ function resolveFieldType(config: Record<string, any>, componentType?: string, m
}
}
// (b) 사용자가 설정 패널에서 직접 선택한 fieldType
// (c) 사용자가 설정 패널에서 직접 선택한 fieldType
if (config.fieldType) return config.fieldType as FieldType;
// (c) v2-select 계열: componentType 또는 config.source 기반
if (componentType === "v2-select" || config.source) {
const source = config.source === "code" ? "category" : config.source;
if (source === "entity") return "entity";
if (source === "category") return "category";
return "select";
}
// (d) saved config fallback (config.inputType / config.type)
const it = config.inputType || config.type;
if (it === "number") return "number";