From f72649291c4a95ec30d21c9d3b2a4fda87f5d2cd Mon Sep 17 00:00:00 2001 From: DDD1542 Date: Wed, 11 Mar 2026 21:55:21 +0900 Subject: [PATCH] [agent-pipeline] pipe-20260311124806-lfrk round-2 --- .../v2/config-panels/V2BizConfigPanel.tsx | 440 +++++++++++------- 1 file changed, 262 insertions(+), 178 deletions(-) diff --git a/frontend/components/v2/config-panels/V2BizConfigPanel.tsx b/frontend/components/v2/config-panels/V2BizConfigPanel.tsx index c116c595..60ffeb46 100644 --- a/frontend/components/v2/config-panels/V2BizConfigPanel.tsx +++ b/frontend/components/v2/config-panels/V2BizConfigPanel.tsx @@ -2,14 +2,25 @@ /** * V2Biz 설정 패널 - * 통합 비즈니스 컴포넌트의 세부 설정을 관리합니다. + * 토스식 단계별 UX: 비즈니스 타입 카드 선택 -> 타입별 설정 -> 고급 설정(접힘) */ import React, { useState, useEffect } from "react"; import { Label } from "@/components/ui/label"; import { Input } from "@/components/ui/input"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select"; -import { Checkbox } from "@/components/ui/checkbox"; +import { Switch } from "@/components/ui/switch"; +import { + GitBranch, + LayoutGrid, + MapPin, + Hash, + FolderTree, + ArrowRightLeft, + Link2, + Loader2, +} from "lucide-react"; +import { cn } from "@/lib/utils"; import { tableTypeApi } from "@/lib/api/screen"; interface V2BizConfigPanelProps { @@ -27,6 +38,16 @@ interface ColumnOption { displayName: string; } +const BIZ_TYPE_CARDS = [ + { value: "flow", icon: GitBranch, title: "플로우", description: "워크플로우를 구성해요" }, + { value: "rack", icon: LayoutGrid, title: "랙 구조", description: "창고 렉 위치를 관리해요" }, + { value: "map", icon: MapPin, title: "지도", description: "위치 정보를 표시해요" }, + { value: "numbering", icon: Hash, title: "채번 규칙", description: "자동 번호를 생성해요" }, + { value: "category", icon: FolderTree, title: "카테고리", description: "분류 체계를 관리해요" }, + { value: "data-mapping", icon: ArrowRightLeft, title: "데이터 매핑", description: "테이블 간 매핑해요" }, + { value: "related-data", icon: Link2, title: "관련 데이터", description: "연결된 데이터를 조회해요" }, +] as const; + export const V2BizConfigPanel: React.FC = ({ config, onChange, @@ -128,61 +149,76 @@ export const V2BizConfigPanel: React.FC = ({ loadColumns(); }, [config.tableName]); + const bizType = config.bizType || config.type || "flow"; + return ( -
- {/* BUSINESS TYPE 섹션 */} -
-

BUSINESS TYPE

-
- 비즈니스 타입 -
- -
+
+ {/* ─── 1단계: 비즈니스 타입 선택 (카드) ─── */} +
+

어떤 비즈니스 기능을 사용하나요?

+
+ {BIZ_TYPE_CARDS.map((card) => { + const Icon = card.icon; + const isSelected = bizType === card.value; + return ( + + ); + })}
- {/* FLOW SETTINGS 섹션 */} - {config.bizType === "flow" && ( -
-

FLOW SETTINGS

-
- 플로우 ID -
- updateConfig("flowId", e.target.value ? Number(e.target.value) : undefined)} - placeholder="플로우 ID" - className="h-7 text-xs" - /> -
+ {/* ─── 2단계: 타입별 설정 ─── */} + + {/* 플로우 설정 */} + {bizType === "flow" && ( +
+
+ + 플로우 설정
-
- 편집 가능 - + 플로우 ID + updateConfig("flowId", e.target.value ? Number(e.target.value) : undefined)} + placeholder="플로우 ID" + className="h-7 w-[160px] text-xs" + /> +
+ +
+
+

편집 가능

+

플로우를 직접 수정할 수 있어요

+
+ updateConfig("editable", checked)} />
-
- 미니맵 표시 - +
+

미니맵 표시

+

전체 구조를 한눈에 볼 수 있어요

+
+ updateConfig("showMinimap", checked)} /> @@ -190,37 +226,48 @@ export const V2BizConfigPanel: React.FC = ({
)} - {/* RACK SETTINGS 섹션 */} - {config.bizType === "rack" && ( -
-

RACK SETTINGS

-
-
- - updateConfig("rows", e.target.value ? Number(e.target.value) : undefined)} - placeholder="5" - min="1" - className="h-7 text-xs" - /> -
-
- - updateConfig("columns", e.target.value ? Number(e.target.value) : undefined)} - placeholder="10" - min="1" - className="h-7 text-xs" - /> + {/* 랙 구조 설정 */} + {bizType === "rack" && ( +
+
+ + 랙 구조 설정 +
+ +
+

렉 크기

+
+
+ + updateConfig("rows", e.target.value ? Number(e.target.value) : undefined)} + placeholder="5" + min="1" + className="h-7 text-xs" + /> +
+
+ + updateConfig("columns", e.target.value ? Number(e.target.value) : undefined)} + placeholder="10" + min="1" + className="h-7 text-xs" + /> +
-
- 라벨 표시 - +
+

라벨 표시

+

각 셀에 위치 라벨이 표시돼요

+
+ updateConfig("showLabels", checked)} /> @@ -228,36 +275,41 @@ export const V2BizConfigPanel: React.FC = ({
)} - {/* NUMBERING SETTINGS 섹션 */} - {config.bizType === "numbering" && ( -
-

NUMBERING SETTINGS

-
+ {/* 채번 규칙 설정 */} + {bizType === "numbering" && ( +
+
+ + 채번 규칙 설정 +
+ +
채번 규칙 ID -
- updateConfig("ruleId", e.target.value ? Number(e.target.value) : undefined)} - placeholder="규칙 ID" - className="h-7 text-xs" - /> -
+ updateConfig("ruleId", e.target.value ? Number(e.target.value) : undefined)} + placeholder="규칙 ID" + className="h-7 w-[160px] text-xs" + />
-
+ +
접두사 -
- updateConfig("prefix", e.target.value)} - placeholder="예: INV-" - className="h-7 text-xs" - /> -
+ updateConfig("prefix", e.target.value)} + placeholder="예: INV-" + className="h-7 w-[160px] text-xs" + />
-
- 자동 생성 - +
+

자동 생성

+

저장할 때 번호가 자동으로 생성돼요

+
+ updateConfig("autoGenerate", checked)} /> @@ -265,23 +317,31 @@ export const V2BizConfigPanel: React.FC = ({
)} - {/* CATEGORY SETTINGS 섹션 */} - {config.bizType === "category" && ( -
-

CATEGORY SETTINGS

-
- 카테고리 테이블 -
+ {/* 카테고리 설정 */} + {bizType === "category" && ( +
+
+ + 카테고리 설정 +
+ +
+

카테고리 테이블

+ {loadingTables ? ( +
+ + 테이블 로딩 중... +
+ ) : ( -
+ )}
+ {config.tableName && ( -
- 컬럼 -
+
+

컬럼

+ {loadingColumns ? ( +
+ + 컬럼 로딩 중... +
+ ) : ( -
+ )}
)}
)} - {/* DATA MAPPING 섹션 */} - {config.bizType === "data-mapping" && ( -
-

DATA MAPPING

-
- 소스 테이블 -
+ {/* 데이터 매핑 설정 */} + {bizType === "data-mapping" && ( +
+
+ + 데이터 매핑 설정 +
+ +
+

소스 테이블

+ {loadingTables ? ( +
+ + 테이블 로딩 중... +
+ ) : ( -
+ )}
-
- 대상 테이블 -
+ +
+

대상 테이블

+ {loadingTables ? ( +
+ + 테이블 로딩 중... +
+ ) : ( -
+ )}
)} - {/* RELATED DATA 섹션 */} - {config.bizType === "related-data" && ( -
-

RELATED DATA

-
- 관련 테이블 -
+ {/* 관련 데이터 설정 */} + {bizType === "related-data" && ( +
+
+ + 관련 데이터 설정 +
+ +
+

관련 테이블

+ {loadingTables ? ( +
+ + 테이블 로딩 중... +
+ ) : ( -
+ )}
+ {config.relatedTable && ( -
- 연결 컬럼 -
- -
+
+

연결 컬럼

+
)} -
+ +
버튼 텍스트 -
- updateConfig("buttonText", e.target.value)} - placeholder="관련 데이터 보기" - className="h-7 text-xs" - /> -
+ updateConfig("buttonText", e.target.value)} + placeholder="관련 데이터 보기" + className="h-7 w-[160px] text-xs" + />
)}