Skip to content

Conversation

@Artuomka
Copy link
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings January 22, 2026 13:14
@Artuomka Artuomka enabled auto-merge January 22, 2026 13:16
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds a new chart_type field to the DashboardWidgetEntity and propagates it through the entire data flow pipeline to support enhanced configuration for chart widgets.

Changes:

  • Added database migration to create a nullable chart_type varchar column in the dashboard_widget table
  • Updated entity, DTOs, data structures, use cases, controller, and utility functions to handle the new field
  • Made the field optional/nullable across all layers to maintain backward compatibility

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
backend/src/migrations/1769087579873-AddChartTypeFieldIntoDashboardWidgetEntity.ts Database migration to add chart_type column
backend/src/entities/visualizations/dashboard-widget/dashboard-widget.entity.ts Added nullable chart_type column to entity
backend/src/entities/visualizations/dashboard-widget/dto/create-dashboard-widget.dto.ts Added optional chart_type to creation DTO
backend/src/entities/visualizations/dashboard-widget/dto/update-dashboard-widget.dto.ts Added optional chart_type to update DTO
backend/src/entities/visualizations/dashboard-widget/dto/found-dashboard-widget.dto.ts Added nullable chart_type to response DTO
backend/src/entities/visualizations/dashboard-widget/data-structures/create-dashboard-widget.ds.ts Added optional chart_type to creation data structure
backend/src/entities/visualizations/dashboard-widget/data-structures/update-dashboard-widget.ds.ts Added optional chart_type to update data structure
backend/src/entities/visualizations/dashboard-widget/use-cases/create-dashboard-widget.use.case.ts Handles chart_type during widget creation with null coalescing
backend/src/entities/visualizations/dashboard-widget/use-cases/update-dashboard-widget.use.case.ts Handles chart_type during widget updates
backend/src/entities/visualizations/dashboard-widget/utils/build-found-dashboard-widget-dto.util.ts Includes chart_type in DTO builder
backend/src/entities/visualizations/dashboard-widget/dashboard-widgets.controller.ts Maps chart_type from DTOs to data structures

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

foundWidget.widget_type = widget_type;
}
if (chart_type !== undefined) {
foundWidget.chart_type = chart_type;
Copy link

Copilot AI Jan 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The chart_type field handling in the update use case is inconsistent with how the entity expects nullable values. When chart_type is provided as an optional string in the DTO, it should be converted to null when empty or undefined (similar to how it's handled in the create use case with chart_type || null). Currently, if an empty string is passed, it will be stored as an empty string instead of null, which is inconsistent with the entity's nullable design and the create operation.

Suggested change
foundWidget.chart_type = chart_type;
foundWidget.chart_type = chart_type || null;

Copilot uses AI. Check for mistakes.

const newWidget = new DashboardWidgetEntity();
newWidget.widget_type = widget_type;
newWidget.chart_type = chart_type || null;
Copy link

Copilot AI Jan 22, 2026

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'.

Copilot uses AI. Check for mistakes.
@Artuomka Artuomka merged commit 4f72f2c into main Jan 22, 2026
25 checks passed
@Artuomka Artuomka deleted the backend_charts branch January 22, 2026 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants