-
-
Notifications
You must be signed in to change notification settings - Fork 18
feat: add chart_type to DashboardWidgetEntity and related DTOs for enhanced widget configuration #1521
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add chart_type to DashboardWidgetEntity and related DTOs for enhanced widget configuration #1521
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -27,6 +27,7 @@ export class UpdateDashboardWidgetUseCase | |||||
| connectionId, | ||||||
| masterPassword, | ||||||
| widget_type, | ||||||
| chart_type, | ||||||
| name, | ||||||
| description, | ||||||
| position_x, | ||||||
|
|
@@ -78,6 +79,9 @@ export class UpdateDashboardWidgetUseCase | |||||
| if (widget_type !== undefined) { | ||||||
| foundWidget.widget_type = widget_type; | ||||||
| } | ||||||
| if (chart_type !== undefined) { | ||||||
| foundWidget.chart_type = chart_type; | ||||||
|
||||||
| foundWidget.chart_type = chart_type; | |
| foundWidget.chart_type = chart_type || null; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| import { MigrationInterface, QueryRunner } from 'typeorm'; | ||
|
|
||
| export class AddChartTypeFieldIntoDashboardWidgetEntity1769087579873 implements MigrationInterface { | ||
| name = 'AddChartTypeFieldIntoDashboardWidgetEntity1769087579873'; | ||
|
|
||
| public async up(queryRunner: QueryRunner): Promise<void> { | ||
| await queryRunner.query(`ALTER TABLE "dashboard_widget" ADD "chart_type" character varying`); | ||
| } | ||
|
|
||
| public async down(queryRunner: QueryRunner): Promise<void> { | ||
| await queryRunner.query(`ALTER TABLE "dashboard_widget" DROP COLUMN "chart_type"`); | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new chart_type field lacks test coverage. The existing dashboard widget e2e tests don't include verification of this field in widget creation, update, or retrieval operations. Consider adding test cases that verify chart_type is properly stored, retrieved, and updated, especially for widgets with widget_type 'chart'.