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]) => (