From 559c3fc98f7ac55e9bb3df8ceb02af2b40b4bc72 Mon Sep 17 00:00:00 2001 From: dohyeons Date: Wed, 8 Oct 2025 10:42:23 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20DataConnectionDesigner=20=EC=86=90?= =?UTF-8?q?=EC=83=81=EB=90=9C=20=ED=8C=8C=EC=9D=BC=EB=A1=9C=20=EC=9B=90?= =?UTF-8?q?=EC=83=81=EB=B3=B5=EA=B5=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../redesigned/DataConnectionDesigner.tsx | 116 +++++------------- 1 file changed, 33 insertions(+), 83 deletions(-) diff --git a/frontend/components/dataflow/connection/redesigned/DataConnectionDesigner.tsx b/frontend/components/dataflow/connection/redesigned/DataConnectionDesigner.tsx index 8c5514c3..604b29f1 100644 --- a/frontend/components/dataflow/connection/redesigned/DataConnectionDesigner.tsx +++ b/frontend/components/dataflow/connection/redesigned/DataConnectionDesigner.tsx @@ -1,46 +1,17 @@ "use client"; -import React, { useState, useCallback, useEffect } from "react"; -import { Card } from "@/components/ui/card"; -import { Button } from "@/components/ui/button"; -import { toast } from "sonner"; -import { X, ArrowLeft } from "lucide-react"; +import React, { useState } from "react"; +import { ConnectionTypeSelector } from "./LeftPanel/ConnectionTypeSelector"; +import { MappingInfoPanel } from "./LeftPanel/MappingInfoPanel"; +import { StepProgress } from "./RightPanel/StepProgress"; +import { ConnectionStep } from "./RightPanel/ConnectionStep"; +import { TableStep } from "./RightPanel/TableStep"; +import { FieldMappingStep } from "./RightPanel/FieldMappingStep"; +import { DataConnectionState } from "./types/redesigned"; +import { ResponsiveContainer, ResponsiveGrid } from "@/components/layout/ResponsiveContainer"; +import { useResponsive } from "@/lib/hooks/useResponsive"; -// API import -import { saveDataflowRelationship, checkRelationshipNameDuplicate } from "@/lib/api/dataflowSave"; -import { getColumnsFromConnection } from "@/lib/api/multiConnection"; - -// 타입 import -import { - DataConnectionState, - DataConnectionActions, - DataConnectionDesignerProps, - FieldMapping, - ValidationResult, - TestResult, - MappingStats, - ActionGroup, - SingleAction, -} from "./types/redesigned"; -import { ColumnInfo, Connection, TableInfo } from "@/lib/types/multiConnection"; - -// 컴포넌트 import -import LeftPanel from "./LeftPanel/LeftPanel"; -import RightPanel from "./RightPanel/RightPanel"; - -/** - * 🎨 데이터 연결 설정 메인 디자이너 - * - 좌우 분할 레이아웃 (30% + 70%) - * - 상태 관리 및 액션 처리 - * - 기존 모달 기능을 메인 화면으로 통합 - */ -const DataConnectionDesigner: React.FC = ({ - onClose, - initialData, - showBackButton = false, -}) => { - // 🔄 상태 관리 - const [state, setState] = useState(() => ({ +const initialState: DataConnectionState = { connectionType: "data_save", currentStep: 1, fieldMappings: [], @@ -52,34 +23,6 @@ const DataConnectionDesigner: React.FC = ({ estimatedRows: 0, actionType: "INSERT", }, - // 제어 실행 조건 초기값 - controlConditions: [], - - // 액션 그룹 초기값 (멀티 액션) - actionGroups: [ - { - id: "group_1", - name: "기본 액션 그룹", - logicalOperator: "AND" as const, - actions: [ - { - id: "action_1", - name: "액션 1", - actionType: "insert" as const, - conditions: [], - fieldMappings: [], - isEnabled: true, - }, - ], - isEnabled: true, - }, - ], - groupsLogicalOperator: "AND" as "AND" | "OR", - - // 기존 호환성 필드들 (deprecated) - actionType: "insert", - actionConditions: [], - actionFieldMappings: [], isLoading: false, validationErrors: [], @@ -777,23 +720,30 @@ const DataConnectionDesigner: React.FC = ({ }; return ( -
- {/* 상단 네비게이션 */} - {showBackButton && ( -
-
-
- -
-

🔗 데이터 연결 설정

-

- {state.connectionType === "data_save" ? "데이터 저장" : "외부 호출"} 연결 설정 +

+
+

+ 🎨 제어관리 - 데이터 연결 설정 +

+

+ 시각적 필드 매핑으로 데이터 연결을 쉽게 설정하세요

-
+ +
+
+ setState(prev => ({ ...prev, connectionType: type }))} + /> + +
+ setState(prev => ({ ...prev, selectedMapping: mappingId }))} + />
)}