From 348c040e200b5bfc05032e0498bcaf24511770b1 Mon Sep 17 00:00:00 2001 From: kjs Date: Thu, 20 Nov 2025 12:19:27 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20SplitPanelLayout=20=ED=95=98?= =?UTF-8?q?=EB=93=9C=EC=BD=94=EB=94=A9=20=EC=A0=9C=EA=B1=B0=20=EB=B0=8F=20?= =?UTF-8?q?=EA=B7=B8=EB=A3=B9=20=EC=82=AD=EC=A0=9C=20=EA=B8=B0=EB=8A=A5=20?= =?UTF-8?q?=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 하드코딩 제거: 필드명 패턴을 동적으로 처리 - 민감한 필드(id, password, token, company_code)만 제외하고 모두 표시 - 그룹 삭제 기능: 중복 제거 활성화 시 관련된 모든 레코드 삭제 - URL 파라미터 초기화: 모달 닫을 때 자동으로 초기화 - 백엔드: deleteGroupRecords API 추가 - 프론트엔드: dataApi.deleteGroupRecords 클라이언트 추가 --- .../SplitPanelLayoutComponent.tsx | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/frontend/lib/registry/components/split-panel-layout/SplitPanelLayoutComponent.tsx b/frontend/lib/registry/components/split-panel-layout/SplitPanelLayoutComponent.tsx index 532ed3a5..21a5bb0f 100644 --- a/frontend/lib/registry/components/split-panel-layout/SplitPanelLayoutComponent.tsx +++ b/frontend/lib/registry/components/split-panel-layout/SplitPanelLayoutComponent.tsx @@ -60,6 +60,18 @@ export const SplitPanelLayoutComponent: React.FC const resizable = componentConfig.resizable ?? true; const minLeftWidth = componentConfig.minLeftWidth || 200; const minRightWidth = componentConfig.minRightWidth || 300; + + // 필드 표시 유틸리티 (하드코딩 제거, 동적으로 작동) + const shouldShowField = (fieldName: string): boolean => { + const lower = fieldName.toLowerCase(); + + // 기본 제외: id, 비밀번호, 토큰, 회사코드 + if (lower === "id" || lower === "company_code" || lower === "company_name") return false; + if (lower.includes("password") || lower.includes("token")) return false; + + // 나머지는 모두 표시! + return true; + }; // TableOptions Context const { registerTable, unregisterTable } = useTableOptions(); @@ -1690,13 +1702,13 @@ export const SplitPanelLayoutComponent: React.FC value: item[leftColumn], }); - // 추가로 다른 의미있는 필드 1-2개 표시 (name, title 등) + // 추가로 다른 의미있는 필드 1-2개 표시 (동적) const additionalKeys = Object.keys(item).filter( (k) => k !== "id" && k !== "ID" && k !== leftColumn && - (k.includes("name") || k.includes("title") || k.includes("desc")), + shouldShowField(k), ); if (additionalKeys.length > 0) { @@ -1925,7 +1937,7 @@ export const SplitPanelLayoutComponent: React.FC label: rightColumnLabels[col.name] || col.label || col.name, })) : Object.keys(filteredData[0] || {}) - .filter((key) => !key.toLowerCase().includes("password")) + .filter((key) => shouldShowField(key)) .slice(0, 5) .map((key) => ({ name: key, @@ -2537,9 +2549,9 @@ export const SplitPanelLayoutComponent: React.FC )); } else { - // 설정이 없으면 모든 컬럼 표시 (company_code, company_name 제외) + // 설정이 없으면 모든 컬럼 표시 (민감한 필드 제외) return Object.entries(editModalFormData) - .filter(([key]) => key !== "company_code" && key !== "company_name") + .filter(([key]) => shouldShowField(key)) .map(([key, value]) => (