연결 설명 필드 추가 및 외부 호출 설정 개선

This commit is contained in:
hyeonsu 2025-09-16 18:15:54 +09:00
parent 77edd1f986
commit e572374116
7 changed files with 75 additions and 5 deletions

View File

@ -186,7 +186,7 @@ export const ConnectionSetupModal: React.FC<ConnectionSetupModalProps> = ({
} else {
// 기본값 설정
setSimpleKeySettings({
notes: `${fromDisplayName}${toDisplayName} 간의 키값 연결`,
notes: existingRel?.note || `${fromDisplayName}${toDisplayName} 간의 키값 연결`,
});
setDataSaveSettings({ actions: [] });
}

View File

@ -114,6 +114,7 @@ export const DataFlowDesigner: React.FC<DataFlowDesignerProps> = ({
toColumns: Array.isArray(rel.toColumns) ? rel.toColumns : [],
connectionType: rel.connectionType || "simple-key",
relationshipName: rel.relationshipName || "",
note: rel.note || "", // 🔥 연결 설명 로드
}));
setTempRelationships(loadedRelationships);
@ -493,6 +494,7 @@ export const DataFlowDesigner: React.FC<DataFlowDesignerProps> = ({
toColumns: relationshipData.to_column_name ? relationshipData.to_column_name.split(",") : [],
connectionType: relationshipData.connection_type as "simple-key" | "data-save" | "external-call",
relationshipName: relationshipData.relationship_name,
note: (relationshipData.settings as any)?.notes || "", // 🔥 notes를 note로 변환
settings: relationshipData.settings || {},
};
@ -532,6 +534,7 @@ export const DataFlowDesigner: React.FC<DataFlowDesignerProps> = ({
toColumns: relationshipData.to_column_name ? relationshipData.to_column_name.split(",") : [],
connectionType: relationshipData.connection_type as "simple-key" | "data-save" | "external-call",
relationshipName: relationshipData.relationship_name,
note: (relationshipData.settings as any)?.notes || "", // 🔥 notes를 note로 변환
settings: relationshipData.settings || {},
};
@ -613,7 +616,7 @@ export const DataFlowDesigner: React.FC<DataFlowDesignerProps> = ({
// 연결된 테이블 목록 추출
const tableNames = extractTableNames(nodes);
// 관계 데이터를 JsonRelationship 형태로 변환 (settings 제거 - relationships는 순수 연결 정보만)
// 관계 데이터를 JsonRelationship 형태로 변환 (note 필드 포함)
const jsonRelationships: JsonRelationship[] = tempRelationships.map((rel) => ({
id: rel.id,
relationshipName: rel.relationshipName, // 🔥 핵심: 관계 이름 포함
@ -622,6 +625,7 @@ export const DataFlowDesigner: React.FC<DataFlowDesignerProps> = ({
fromColumns: rel.fromColumns,
toColumns: rel.toColumns,
connectionType: rel.connectionType,
note: rel.note, // 🔥 연결 설명 포함
}));
// 저장 요청 데이터 구성

View File

@ -102,6 +102,7 @@ export const RelationshipListModal: React.FC<RelationshipListModalProps> = ({
existingRelationship: {
relationshipName: relationship.relationshipName,
connectionType: relationship.connectionType,
note: relationship.note, // 🔥 연결 설명 포함
settings: relationshipSettings,
},
});

View File

@ -27,7 +27,7 @@ export const ExternalCallSettings: React.FC<ExternalCallSettingsProps> = ({ sett
</Label>
<Select
value={settings.callType}
onValueChange={(value: "rest-api" | "email" | "webhook" | "ftp" | "queue") =>
onValueChange={(value: "rest-api" | "email" | "webhook" | "kakao-talk" | "ftp" | "queue") =>
onSettingsChange({ ...settings, callType: value })
}
>
@ -36,6 +36,7 @@ export const ExternalCallSettings: React.FC<ExternalCallSettingsProps> = ({ sett
</SelectTrigger>
<SelectContent>
<SelectItem value="rest-api">REST API </SelectItem>
<SelectItem value="kakao-talk"> </SelectItem>
<SelectItem value="email"> </SelectItem>
<SelectItem value="webhook"></SelectItem>
<SelectItem value="ftp">FTP </SelectItem>
@ -109,6 +110,64 @@ export const ExternalCallSettings: React.FC<ExternalCallSettingsProps> = ({ sett
</div>
</>
)}
{settings.callType === "kakao-talk" && (
<>
<div>
<Label htmlFor="kakaoAccessToken" className="text-sm">
<span className="text-red-500">*</span>
</Label>
<Input
id="kakaoAccessToken"
type="password"
value={settings.kakaoAccessToken || ""}
onChange={(e) =>
onSettingsChange({
...settings,
kakaoAccessToken: e.target.value,
})
}
placeholder="카카오 개발자 센터에서 발급받은 토큰"
className="text-sm"
/>
<p className="mt-1 text-xs text-gray-600">
💡{" "}
<a
href="https://developers.kakao.com"
target="_blank"
rel="noopener noreferrer"
className="text-blue-500 hover:underline"
>
</a>
</p>
</div>
<div>
<Label htmlFor="kakaoMessage" className="text-sm">
릿 <span className="text-red-500">*</span>
</Label>
<Textarea
id="kakaoMessage"
value={settings.bodyTemplate || ""}
onChange={(e) =>
onSettingsChange({
...settings,
bodyTemplate: e.target.value,
})
}
placeholder="안녕하세요! {{customer_name}}님의 주문({{order_id}})이 처리되었습니다."
rows={3}
className="text-sm"
/>
<p className="mt-1 text-xs text-gray-600">
💡 {"{{"} {"}"} (: {"{{"} user_name {"}"}, {"{{"} amount{" "}
{"}"})
</p>
</div>
</>
)}
</div>
</div>
);

View File

@ -260,7 +260,7 @@ export interface JsonRelationship {
fromColumns: string[];
toColumns: string[];
connectionType: "simple-key" | "data-save" | "external-call";
// settings 제거 - relationships는 순수 연결 정보만 저장
note?: string; // 데이터 연결에 대한 설명
}
export interface CreateDiagramRequest {

View File

@ -23,6 +23,7 @@ export interface ConnectionInfo {
existingRelationship?: {
relationshipName: string;
connectionType: string;
note?: string; // 연결 설명
settings?: Record<string, unknown>;
};
}
@ -66,11 +67,15 @@ export interface DataSaveSettings {
// 외부 호출 설정
export interface ExternalCallSettings {
callType: "rest-api" | "email" | "webhook" | "ftp" | "queue";
callType: "rest-api" | "email" | "webhook" | "kakao-talk" | "ftp" | "queue";
apiUrl?: string;
httpMethod?: "GET" | "POST" | "PUT" | "DELETE";
headers?: string;
bodyTemplate?: string;
// 카카오톡 전용 설정
kakaoAccessToken?: string;
kakaoRecipient?: string;
}
// ConnectionSetupModal Props 타입

View File

@ -22,6 +22,7 @@ export interface TableNodeData extends Record<string, unknown> {
// 내부에서 사용할 확장된 JsonRelationship 타입 (connectionType 포함)
export interface ExtendedJsonRelationship extends JsonRelationship {
connectionType: "simple-key" | "data-save" | "external-call";
note?: string; // 데이터 연결에 대한 설명
settings?: {
control?: {
triggerType?: "insert" | "update" | "delete";