[PR #153] refactor: remove redundant ModuleType from Widget and simplify GetModuleWidget #287

Closed
opened 2026-03-07 19:57:12 +03:00 by kerem · 0 comments
Owner

Original Pull Request: https://github.com/Corsinvest/cv4pve-admin/pull/153

State: closed
Merged: Yes


Summary

  • Removed redundant ModuleType property from Widget model — ModuleWidgetType (C# FullName) already uniquely identifies a widget globally
  • Simplified GetModuleWidget to search across all modules using SelectMany instead of first resolving the module by type
  • Removed ModuleType assignment in Dashboard.razor.cs when creating new widgets
  • Added EF Core migration RemoveWidgetModuleType to drop the ModuleType column from dashboard.Widgets table
  • Updated dashboards.json default template accordingly

Test plan

  • Start application and verify existing dashboards load correctly
  • Add a new widget to a dashboard and verify it saves/loads correctly
  • Run database migration and verify ModuleType column is dropped
**Original Pull Request:** https://github.com/Corsinvest/cv4pve-admin/pull/153 **State:** closed **Merged:** Yes --- ## Summary - Removed redundant `ModuleType` property from `Widget` model — `ModuleWidgetType` (C# FullName) already uniquely identifies a widget globally - Simplified `GetModuleWidget` to search across all modules using `SelectMany` instead of first resolving the module by type - Removed `ModuleType` assignment in `Dashboard.razor.cs` when creating new widgets - Added EF Core migration `RemoveWidgetModuleType` to drop the `ModuleType` column from `dashboard.Widgets` table - Updated `dashboards.json` default template accordingly ## Test plan - [ ] Start application and verify existing dashboards load correctly - [ ] Add a new widget to a dashboard and verify it saves/loads correctly - [ ] Run database migration and verify `ModuleType` column is dropped
kerem 2026-03-07 19:57:12 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/cv4pve-admin#287
No description provided.