From 7be502ac0c44cc3c5f1ac7097d3650ab5ac21eca Mon Sep 17 00:00:00 2001 From: hyeonsu Date: Thu, 18 Sep 2025 10:05:28 +0900 Subject: [PATCH] =?UTF-8?q?=EC=A1=B0=EA=B1=B4=20=EC=84=A4=EC=A0=95=20?= =?UTF-8?q?=EC=BB=B4=ED=8F=AC=EB=84=8C=ED=8A=B8=20=EA=B0=9C=EC=84=A0:=20?= =?UTF-8?q?=ED=85=8C=EC=9D=B4=EB=B8=94=20=EB=B0=8F=20=EC=BB=AC=EB=9F=BC=20?= =?UTF-8?q?=EC=84=A0=ED=83=9D=20=EA=B8=B0=EB=8A=A5=20=EC=B6=94=EA=B0=80,?= =?UTF-8?q?=20=EA=B8=B0=EC=A1=B4=20=ED=95=84=EB=93=9C=20=EC=84=A0=ED=83=9D?= =?UTF-8?q?=20=EB=B0=A9=EC=8B=9D=EA=B3=BC=EC=9D=98=20=ED=98=B8=ED=99=98?= =?UTF-8?q?=EC=84=B1=20=EC=9C=A0=EC=A7=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dataflow/ConnectionSetupModal.tsx | 2 + .../connection/ActionConditionRenderer.tsx | 66 ++++++++++++++++--- .../connection/ActionConditionsSection.tsx | 10 +++ .../dataflow/connection/DataSaveSettings.tsx | 7 ++ frontend/lib/api/dataflow.ts | 1 + 5 files changed, 76 insertions(+), 10 deletions(-) diff --git a/frontend/components/dataflow/ConnectionSetupModal.tsx b/frontend/components/dataflow/ConnectionSetupModal.tsx index 60fefa9d..7baac19c 100644 --- a/frontend/components/dataflow/ConnectionSetupModal.tsx +++ b/frontend/components/dataflow/ConnectionSetupModal.tsx @@ -476,6 +476,8 @@ export const ConnectionSetupModal: React.FC = ({ availableTables={availableTables} fromTableColumns={fromTableColumns} toTableColumns={toTableColumns} + fromTableName={selectedFromTable} + toTableName={selectedToTable} tableColumnsCache={tableColumnsCache} /> ); diff --git a/frontend/components/dataflow/connection/ActionConditionRenderer.tsx b/frontend/components/dataflow/connection/ActionConditionRenderer.tsx index eae8066a..fb542ebc 100644 --- a/frontend/components/dataflow/connection/ActionConditionRenderer.tsx +++ b/frontend/components/dataflow/connection/ActionConditionRenderer.tsx @@ -3,7 +3,15 @@ import React from "react"; import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; -import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select"; +import { + Select, + SelectContent, + SelectGroup, + SelectItem, + SelectLabel, + SelectTrigger, + SelectValue, +} from "@/components/ui/select"; import { Trash2 } from "lucide-react"; import { ConditionNode, ColumnInfo } from "@/lib/api/dataflow"; import { DataSaveSettings } from "@/types/connectionTypes"; @@ -16,6 +24,9 @@ interface ActionConditionRendererProps { settings: DataSaveSettings; onSettingsChange: (settings: DataSaveSettings) => void; fromTableColumns: ColumnInfo[]; + toTableColumns: ColumnInfo[]; + fromTableName?: string; + toTableName?: string; getActionCurrentGroupLevel: (conditions: ConditionNode[], conditionIndex: number) => number; } @@ -26,6 +37,9 @@ export const ActionConditionRenderer: React.FC = ( settings, onSettingsChange, fromTableColumns, + toTableColumns, + fromTableName, + toTableName, getActionCurrentGroupLevel, }) => { const removeConditionGroup = (groupId: string) => { @@ -53,7 +67,9 @@ export const ActionConditionRenderer: React.FC = ( }; const renderConditionValue = () => { - const selectedColumn = fromTableColumns.find((col) => col.columnName === condition.field); + // 선택된 테이블 타입에 따라 컬럼 찾기 + const targetColumns = condition.tableType === "from" ? fromTableColumns : toTableColumns; + const selectedColumn = targetColumns.find((col) => col.columnName === condition.field); const dataType = selectedColumn?.dataType?.toLowerCase() || "string"; const inputType = getInputTypeForDataType(dataType); @@ -167,16 +183,46 @@ export const ActionConditionRenderer: React.FC = ( marginLeft: `${getActionCurrentGroupLevel(settings.actions[actionIndex].conditions || [], condIndex) * 15}px`, }} > - { + updateCondition("tableType", value); + // 테이블이 변경되면 필드 초기화 + updateCondition("field", ""); + }} + > + + - {fromTableColumns.map((column) => ( - - {column.columnName} - - ))} + {fromTableColumns.length > 0 && {fromTableName || "From 테이블"}} + {toTableColumns.length > 0 && {toTableName || "To 테이블"}} + + + + {/* 2단계: 선택된 테이블의 컬럼 선택 */} +