리포트 관리 중간 병합 #90

Merged
hyeonsu merged 53 commits from feature/report into main 2025-10-13 15:19:02 +09:00
1 changed files with 30 additions and 8 deletions
Showing only changes of commit 25cf0b77a1 - Show all commits

View File

@ -1426,14 +1426,36 @@ export function ReportDesignerProvider({ reportId, children }: { reportId: strin
window.history.replaceState({}, "", `/admin/report/designer/${actualReportId}`);
}
// 레이아웃 저장 (페이지 구조로)
await reportApi.saveLayout(actualReportId, {
layoutConfig, // 페이지 기반 구조
queries: queries.map((q) => ({
...q,
externalConnectionId: q.externalConnectionId || undefined,
})),
});
// 백엔드 호환성을 위해 첫 번째 페이지 정보를 레거시 필드로 변환
const firstPage = layoutConfig.pages[0];
const legacyFormat = firstPage
? {
canvasWidth: firstPage.width,
canvasHeight: firstPage.height,
pageOrientation: firstPage.orientation,
components: firstPage.components,
margins: firstPage.margins,
// 새로운 페이지 기반 구조도 함께 전송
layoutConfig,
queries: queries.map((q) => ({
...q,
externalConnectionId: q.externalConnectionId || undefined,
})),
}
: {
canvasWidth: 210,
canvasHeight: 297,
pageOrientation: "portrait" as const,
components: [],
layoutConfig,
queries: queries.map((q) => ({
...q,
externalConnectionId: q.externalConnectionId || undefined,
})),
};
// 레이아웃 저장
await reportApi.saveLayout(actualReportId, legacyFormat);
toast({
title: "성공",