다국어 지원 및 테이블 설정 현황 문서를 업데이트하여 현재 사용 가능한 17개 컴포넌트의 기능 현황을 반영했습니다. 또한, 집계 위젯(aggregation-widget) 관련 기능을 추가하고, UI에서 다국어 지원을 위한 라벨 수집 및 매핑 로직을 개선하여 사용자 경험을 향상시켰습니다.

This commit is contained in:
kjs
2026-01-16 11:02:27 +09:00
parent f160ba2a1b
commit 6c920b21a4
10 changed files with 1049 additions and 16 deletions

View File

@@ -89,7 +89,7 @@ export function extractMultilangLabels(
const extractFromComponent = (comp: ComponentData, parentType?: string, parentLabel?: string) => {
const anyComp = comp as any;
const config = anyComp.componentConfig;
const config = anyComp.componentConfig || anyComp.config;
const compType = anyComp.componentType || anyComp.type;
const compLabel = anyComp.label || anyComp.title || compType;
@@ -326,6 +326,23 @@ export function extractMultilangLabels(
});
}
// 11. 집계 위젯 (aggregation-widget)
if (compType === "aggregation-widget" && config?.items && Array.isArray(config.items)) {
config.items.forEach((item: any, index: number) => {
if (item.columnLabel && typeof item.columnLabel === "string") {
addLabel(
`${comp.id}_agg_${item.id || index}`,
item.columnLabel,
"label",
compType,
compLabel,
item.labelLangKeyId,
item.labelLangKey
);
}
});
}
// 자식 컴포넌트 재귀 탐색
if (anyComp.children && Array.isArray(anyComp.children)) {
anyComp.children.forEach((child: ComponentData) => {
@@ -401,7 +418,7 @@ export function applyMultilangMappings(
const updateComponent = (comp: ComponentData): ComponentData => {
const anyComp = comp as any;
const config = anyComp.componentConfig;
const config = anyComp.componentConfig || anyComp.config;
let updated = { ...comp } as any;
// 기본 컴포넌트 라벨 매핑 확인
@@ -591,6 +608,25 @@ export function applyMultilangMappings(
};
}
// 집계 위젯 (aggregation-widget) 매핑
if (compType === "aggregation-widget" && config?.items && Array.isArray(config.items)) {
const updatedItems = config.items.map((item: any, index: number) => {
const itemMapping = mappingMap.get(`${comp.id}_agg_${item.id || index}`);
if (itemMapping) {
return {
...item,
labelLangKeyId: itemMapping.keyId,
labelLangKey: itemMapping.langKey,
};
}
return item;
});
updated.componentConfig = {
...updated.componentConfig,
items: updatedItems,
};
}
// 자식 컴포넌트 재귀 처리
if (anyComp.children && Array.isArray(anyComp.children)) {
updated.children = anyComp.children.map((child: ComponentData) => updateComponent(child));