From 6be07e5e88d652912808a5924ebd816b2e347301 Mon Sep 17 00:00:00 2001 From: DDD1542 Date: Wed, 11 Mar 2026 19:46:44 +0900 Subject: [PATCH] [agent-pipeline] pipe-20260311104251-xw7c round-1 --- .../v2/config-panels/V2SelectConfigPanel.tsx | 70 +++++++------------ 1 file changed, 26 insertions(+), 44 deletions(-) diff --git a/frontend/components/v2/config-panels/V2SelectConfigPanel.tsx b/frontend/components/v2/config-panels/V2SelectConfigPanel.tsx index 23752e7d..0abd4a27 100644 --- a/frontend/components/v2/config-panels/V2SelectConfigPanel.tsx +++ b/frontend/components/v2/config-panels/V2SelectConfigPanel.tsx @@ -12,7 +12,7 @@ import { Switch } from "@/components/ui/switch"; import { Button } from "@/components/ui/button"; import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "@/components/ui/collapsible"; import { Separator } from "@/components/ui/separator"; -import { List, Code, Database, FolderTree, Settings, ChevronDown, Plus, Trash2, Loader2, Filter } from "lucide-react"; +import { List, Database, FolderTree, Settings, ChevronDown, Plus, Trash2, Loader2, Filter } from "lucide-react"; import { cn } from "@/lib/utils"; import { apiClient } from "@/lib/api/client"; import type { V2SelectFilter } from "@/types/v2-components"; @@ -63,24 +63,18 @@ const SOURCE_CARDS = [ description: "옵션을 직접 추가해요", }, { - value: "code", - icon: Code, - title: "공통 코드", - description: "등록된 코드를 사용해요", + value: "category", + icon: FolderTree, + title: "카테고리", + description: "등록된 선택지를 사용해요", }, { value: "entity", icon: Database, - title: "테이블 데이터", + title: "테이블 참조", description: "다른 테이블에서 가져와요", entityOnly: true, }, - { - value: "category", - icon: FolderTree, - title: "카테고리", - description: "카테고리로 분류해요", - }, ] as const; /** @@ -389,7 +383,7 @@ export const V2SelectConfigPanel: React.FC = ({ }, []); useEffect(() => { - if (config.source === "category") { + if (config.source === "category" || config.source === "code") { const catTable = config.categoryTable || tableName; const catColumn = config.categoryColumn || columnName; if (catTable && catColumn) { @@ -453,9 +447,12 @@ export const V2SelectConfigPanel: React.FC = ({ updateConfig("options", newOptions); }; - const effectiveSource = isCategoryType ? "category" : config.source || "static"; + const effectiveSource = isCategoryType + ? "category" + : config.source === "code" + ? "category" + : config.source || "static"; - // 표시할 소스 카드 결정 const visibleCards = useMemo(() => { if (isCategoryType) { return SOURCE_CARDS.filter((c) => c.value === "category"); @@ -466,8 +463,7 @@ export const V2SelectConfigPanel: React.FC = ({ }); }, [isCategoryType, isEntityType]); - // 카드 그리드 열 수: 3개면 한 줄, 4개면 2x2 - const gridCols = visibleCards.length <= 3 ? "grid-cols-3" : "grid-cols-2"; + const gridCols = isEntityType ? "grid-cols-3" : "grid-cols-2"; return (
@@ -568,36 +564,12 @@ export const V2SelectConfigPanel: React.FC = ({
)} - {/* 공통 코드 (code) */} - {effectiveSource === "code" && ( -
-
- - 공통 코드 -
- {config.codeGroup ? ( -
-

코드 그룹

-

{config.codeGroup}

-

- 테이블 컬럼에 설정된 코드 그룹이 자동으로 적용돼요 -

-
- ) : ( -
-

코드 그룹이 설정되지 않았어요

-

테이블 타입 관리에서 컬럼의 코드 그룹을 설정해주세요

-
- )} -
- )} - - {/* 테이블 데이터 (entity) */} + {/* 테이블 참조 (entity) */} {effectiveSource === "entity" && (
- 테이블 데이터 + 테이블 참조
@@ -671,7 +643,7 @@ export const V2SelectConfigPanel: React.FC = ({
)} - {/* 카테고리 (category) */} + {/* 카테고리 (category) - source="code" 하위 호환 포함 */} {effectiveSource === "category" && (
@@ -679,6 +651,16 @@ export const V2SelectConfigPanel: React.FC = ({ 카테고리
+ {config.source === "code" && config.codeGroup && ( +
+

코드 그룹

+

{config.codeGroup}

+

+ 테이블 컬럼에 설정된 코드 그룹이 자동으로 적용돼요 +

+
+ )} +