From fb57bd4eafe55f7ae9b2bfe32a45008d8890c1f2 Mon Sep 17 00:00:00 2001 From: kjs Date: Wed, 18 Mar 2026 10:23:08 +0900 Subject: [PATCH] feat: enhance ButtonPrimaryComponent for source tracking - Updated ButtonPrimaryComponent to automatically inject source_table and source_id for better data tracking. - Implemented logic to conditionally include source tracking information based on the presence of sourceTableName and row.id. - This enhancement aims to improve data integrity and traceability during data mapping processes, facilitating better integration of source information in the application. --- .../v2-button-primary/ButtonPrimaryComponent.tsx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/frontend/lib/registry/components/v2-button-primary/ButtonPrimaryComponent.tsx b/frontend/lib/registry/components/v2-button-primary/ButtonPrimaryComponent.tsx index 42ca862f..8fe0d7dd 100644 --- a/frontend/lib/registry/components/v2-button-primary/ButtonPrimaryComponent.tsx +++ b/frontend/lib/registry/components/v2-button-primary/ButtonPrimaryComponent.tsx @@ -947,8 +947,19 @@ export const ButtonPrimaryComponent: React.FC = ({ const mappedData = sourceData.map((row) => { const mappedRow = applyMappingRules(row, effectiveMappingRules, entityJoinColumns); + // 소스 출처 추적: source_table과 source_id를 자동 주입 + // 타겟 테이블에 해당 컬럼이 있으면 저장되고, 없으면 자동 무시됨 + const sourceTracking: Record = {}; + if (sourceTableName) { + sourceTracking.source_table = sourceTableName; + } + if (row.id) { + sourceTracking.source_id = row.id; + } + return { ...mappedRow, + ...sourceTracking, ...additionalData, }; });