위젯 커스텀 제목 및 헤더 표시/숨김 기능 추가

- 위젯 설정에서 제목 변경 가능
- 위젯 헤더 표시/숨김 토글 추가
- DB 마이그레이션 자동 실행 (custom_title, show_header 컬럼)
- 편집 모드/보기 모드 모두 지원
- DashboardTopMenu 레이아웃 유지
This commit is contained in:
leeheejin
2025-10-16 14:59:07 +09:00
parent 26d27ac881
commit 6d51aced2c
9 changed files with 105 additions and 26 deletions

View File

@@ -60,9 +60,9 @@ export class DashboardService {
INSERT INTO dashboard_elements (
id, dashboard_id, element_type, element_subtype,
position_x, position_y, width, height,
title, content, data_source_config, chart_config,
title, custom_title, show_header, content, data_source_config, chart_config,
display_order, created_at, updated_at
) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15)
) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17)
`,
[
elementId,
@@ -74,6 +74,8 @@ export class DashboardService {
element.size.width,
element.size.height,
element.title,
element.customTitle || null,
element.showHeader !== false, // 기본값 true
element.content || null,
JSON.stringify(element.dataSource || {}),
JSON.stringify(element.chartConfig || {}),
@@ -335,6 +337,8 @@ export class DashboardService {
height: row.height,
},
title: row.title,
customTitle: row.custom_title || undefined,
showHeader: row.show_header !== false, // 기본값 true
content: row.content,
dataSource: JSON.parse(row.data_source_config || "{}"),
chartConfig: JSON.parse(row.chart_config || "{}"),
@@ -460,9 +464,9 @@ export class DashboardService {
INSERT INTO dashboard_elements (
id, dashboard_id, element_type, element_subtype,
position_x, position_y, width, height,
title, content, data_source_config, chart_config,
title, custom_title, show_header, content, data_source_config, chart_config,
display_order, created_at, updated_at
) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15)
) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17)
`,
[
elementId,
@@ -474,6 +478,8 @@ export class DashboardService {
element.size.width,
element.size.height,
element.title,
element.customTitle || null,
element.showHeader !== false, // 기본값 true
element.content || null,
JSON.stringify(element.dataSource || {}),
JSON.stringify(element.chartConfig || {}),