From f97e414df9062e35345543a2e34d768d4345145b Mon Sep 17 00:00:00 2001 From: hyeonsu Date: Wed, 10 Sep 2025 18:30:22 +0900 Subject: [PATCH] =?UTF-8?q?=EC=97=A3=EC=A7=80=20=EC=A0=95=EB=B3=B4=20?= =?UTF-8?q?=EC=A1=B0=ED=9A=8C=20=ED=8C=9D=EC=97=85=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/dataflow/DataFlowDesigner.tsx | 162 ++++++++++++------ frontend/lib/api/dataflow.ts | 3 +- 2 files changed, 110 insertions(+), 55 deletions(-) diff --git a/frontend/components/dataflow/DataFlowDesigner.tsx b/frontend/components/dataflow/DataFlowDesigner.tsx index 9c4f614e..efdc00b8 100644 --- a/frontend/components/dataflow/DataFlowDesigner.tsx +++ b/frontend/components/dataflow/DataFlowDesigner.tsx @@ -250,8 +250,14 @@ export const DataFlowDesigner: React.FC = ({ console.log("๐Ÿ“‹ ๊ด€๊ณ„ ๋ชฉ๋ก:", relationships); console.log("๐Ÿ“Š ํ…Œ์ด๋ธ” ๋ชฉ๋ก:", tableNames); + // ๊ธฐ์กด ๋ฐ์ดํ„ฐ์—์„œ relationshipName์ด ์—†๋Š” ๊ฒฝ์šฐ ๊ธฐ๋ณธ๊ฐ’ ์„ค์ • + const normalizedRelationships = relationships.map((rel: JsonRelationship) => ({ + ...rel, + relationshipName: rel.relationshipName || `${rel.fromTable} โ†’ ${rel.toTable}`, // ๊ธฐ๋ณธ๊ฐ’ ์„ค์ • + })); + // ๋ฉ”๋ชจ๋ฆฌ์— ๊ด€๊ณ„ ์ €์žฅ (๊ธฐ์กด ๊ด€๊ณ„๋„ ํŽธ์ง‘ ์‹œ) - setTempRelationships(relationships); + setTempRelationships(normalizedRelationships); setCurrentDiagramId(currentDiagramId); // ํ…Œ์ด๋ธ” ๋…ธ๋“œ ์ƒ์„ฑ์„ ์œ„ํ•œ ํ…Œ์ด๋ธ” ์ •๋ณด ๋กœ๋“œ @@ -381,7 +387,7 @@ export const DataFlowDesigner: React.FC = ({ }, data: { relationshipId: rel.id, - relationshipName: "๊ธฐ์กด ๊ด€๊ณ„", + relationshipName: rel.relationshipName, relationshipType: rel.relationshipType, connectionType: rel.connectionType, fromTable: fromTable, @@ -703,6 +709,7 @@ export const DataFlowDesigner: React.FC = ({ // JSON ํ˜•ํƒœ์˜ ๊ด€๊ณ„ ๊ฐ์ฒด ์ƒ์„ฑ const newRelationship: JsonRelationship = { id: editingRelationshipId || generateUniqueId("rel", Date.now()), // ์ˆ˜์ • ๋ชจ๋“œ๋ฉด ๊ธฐ์กด ID ์‚ฌ์šฉ + relationshipName: relationship.relationship_name, // ์—ฐ๊ฒฐ ์ด๋ฆ„ ์ถ”๊ฐ€ fromTable, toTable, fromColumns, @@ -737,7 +744,7 @@ export const DataFlowDesigner: React.FC = ({ }, data: { relationshipId: newRelationship.id, - relationshipName: "์ž„์‹œ ๊ด€๊ณ„", + relationshipName: newRelationship.relationshipName, relationshipType: relationship.relationship_type, connectionType: relationship.connection_type, fromTable, @@ -1149,39 +1156,6 @@ export const DataFlowDesigner: React.FC = ({ )} - - {/* ์„ ํƒ๋œ ์—ฃ์ง€ ์ •๋ณด */} - {selectedEdgeInfo && ( -
-
-
-
๐Ÿ”— ์—ฐ๊ฒฐ ์ •๋ณด
- -
-
-
-
์—ฐ๊ฒฐ
-
- {selectedEdgeInfo.fromTable}({selectedEdgeInfo.fromColumns.join(", ")}) โ†’{" "} - {selectedEdgeInfo.toTable}({selectedEdgeInfo.toColumns.join(", ")}) -
-
-
-
-
๊ด€๊ณ„ ์œ ํ˜•
-
{selectedEdgeInfo.relationshipType}
-
-
-
์—ฐ๊ฒฐ ์œ ํ˜•
-
{selectedEdgeInfo.connectionType}
-
-
-
-
-
- )} @@ -1213,7 +1187,6 @@ export const DataFlowDesigner: React.FC = ({ selectionMode={SelectionMode.Partial} > - @@ -1243,27 +1216,108 @@ export const DataFlowDesigner: React.FC = ({ onCancel={handleCancelConnection} /> - {/* ์—ฃ์ง€ ์•ก์…˜ ๋ฒ„ํŠผ */} - {showEdgeActions && selectedEdgeForEdit && ( + {/* ์—ฃ์ง€ ์ •๋ณด ๋ฐ ์•ก์…˜ ๋ฒ„ํŠผ */} + {showEdgeActions && selectedEdgeForEdit && selectedEdgeInfo && (
- - + {/* ํ—ค๋” */} +
+
+
+ ๐Ÿ”— +
+
+
{selectedEdgeInfo.relationshipName}
+
๋ฐ์ดํ„ฐ ๊ด€๊ณ„
+
+
+ +
+ + {/* ์—ฐ๊ฒฐ ์ •๋ณด */} +
+ {/* From ํ…Œ์ด๋ธ” */} +
+
From ํ…Œ์ด๋ธ”
+
{selectedEdgeInfo.fromTable}
+
+ {selectedEdgeInfo.fromColumns.map((column, index) => ( + + {column} + + ))} +
+
+ + {/* ํ™”์‚ดํ‘œ */} +
+
+
+ โ†’ +
+
+
+ + {/* To ํ…Œ์ด๋ธ” */} +
+
To ํ…Œ์ด๋ธ”
+
{selectedEdgeInfo.toTable}
+
+ {selectedEdgeInfo.toColumns.map((column, index) => ( + + {column} + + ))} +
+
+ + {/* ๊ด€๊ณ„ ์ •๋ณด */} +
+
+
๊ด€๊ณ„ ์œ ํ˜•
+
{selectedEdgeInfo.relationshipType}
+
+
+
์—ฐ๊ฒฐ ์œ ํ˜•
+
{selectedEdgeInfo.connectionType}
+
+
+
+ + {/* ์•ก์…˜ ๋ฒ„ํŠผ */} +
+ + +
)} diff --git a/frontend/lib/api/dataflow.ts b/frontend/lib/api/dataflow.ts index ad099ccc..da3cb7f6 100644 --- a/frontend/lib/api/dataflow.ts +++ b/frontend/lib/api/dataflow.ts @@ -143,6 +143,7 @@ export interface JsonDataFlowDiagram { export interface JsonRelationship { id: string; + relationshipName: string; // ์—ฐ๊ฒฐ ์ด๋ฆ„ ์ถ”๊ฐ€ fromTable: string; toTable: string; fromColumns: string[]; @@ -520,7 +521,7 @@ export class DataFlowAPI { const relationshipsData = jsonDiagram.relationships as { relationships: JsonRelationship[]; tables: string[] }; const relationships: TableRelationship[] = relationshipsData.relationships.map((rel: JsonRelationship) => ({ relationship_id: 0, // JSON ๊ธฐ๋ฐ˜์—์„œ๋Š” ๊ฐœ๋ณ„ relationship_id๊ฐ€ ์—†์Œ - relationship_name: rel.id || "๊ด€๊ณ„", + relationship_name: rel.relationshipName || rel.id || "๊ด€๊ณ„", // relationshipName ์šฐ์„  ์‚ฌ์šฉ from_table_name: rel.fromTable, to_table_name: rel.toTable, from_column_name: rel.fromColumns.join(","),