Skip to content

feat: add findAllDashboardsWithWidgetsByConnectionId method to dashboard repository#1577

Merged
Artuomka merged 2 commits into
mainfrom
backend_widgets_count
Feb 6, 2026
Merged

feat: add findAllDashboardsWithWidgetsByConnectionId method to dashboard repository#1577
Artuomka merged 2 commits into
mainfrom
backend_widgets_count

Conversation

@Artuomka

@Artuomka Artuomka commented Feb 6, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings February 6, 2026 12:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a new repository method findAllDashboardsWithWidgetsByConnectionId to enable fetching all dashboards for a connection with their associated widgets eagerly loaded. This improves the API response for the GET /dashboards/:connectionId endpoint by including widget information without additional queries.

Changes:

  • Added new findAllDashboardsWithWidgetsByConnectionId method to dashboard repository interface and implementation
  • Updated FindAllDashboardsUseCase to use the new method instead of findAllDashboardsByConnectionId
  • Removed debug console.log statement from test file

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
backend/test/ava-tests/saas-tests/dashboard-e2e.test.ts Cleanup: removed debug console.log statement
backend/src/entities/visualizations/dashboard/use-cases/find-all-dashboards.use.case.ts Updated to call new repository method that includes widgets
backend/src/entities/visualizations/dashboard/repository/dashboard.repository.interface.ts Added new method signature to interface
backend/src/entities/visualizations/dashboard/repository/dashboard-custom-repository-extension.ts Implemented new method with TypeORM query builder to eager load widgets, added proper typing to repository extension

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

Comment on lines +35 to +36
const dashboards =
await this._dbContext.dashboardRepository.findAllDashboardsWithWidgetsByConnectionId(connectionId);

Copilot AI Feb 6, 2026

Copy link

Choose a reason for hiding this comment

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

The method call has changed from findAllDashboardsByConnectionId to findAllDashboardsWithWidgetsByConnectionId, which now includes widgets in the response. However, the existing test for the GET /dashboards/:connectionId endpoint (lines 63-87 in dashboard-e2e.test.ts) only verifies that an array is returned but doesn't verify the widgets field is present or correctly populated. Consider adding test coverage to verify that dashboards returned by this endpoint now include their associated widgets.

Copilot uses AI. Check for mistakes.
@Artuomka Artuomka merged commit 14d2da6 into main Feb 6, 2026
19 checks passed
@Artuomka Artuomka deleted the backend_widgets_count branch February 6, 2026 12:57
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