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

Closed
opened 2026-02-26 17:37:30 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Corsinvest/cv4pve-admin/pull/153
Author: @franklupo
Created: 2/17/2026
Status: Merged
Merged: 2/17/2026
Merged by: @franklupo

Base: mainHead: refactor/dashboard-remove-module-type


📝 Commits (1)

  • eda3cb1 refactor: remove redundant ModuleType from Widget and simplify GetModuleWidget

📊 Changes

6 files changed (+165 additions, -45 deletions)

View changed files

📝 src/Corsinvest.ProxmoxVE.Admin.Module.Dashboard/Components/Dashboard.razor.cs (+0 -1)
src/Corsinvest.ProxmoxVE.Admin.Module.Dashboard/Migrations/20260217125654_RemoveWidgetModuleType.Designer.cs (+128 -0)
src/Corsinvest.ProxmoxVE.Admin.Module.Dashboard/Migrations/20260217125654_RemoveWidgetModuleType.cs (+32 -0)
📝 src/Corsinvest.ProxmoxVE.Admin.Module.Dashboard/Migrations/ModuleDbContextModelSnapshot.cs (+2 -12)
📝 src/Corsinvest.ProxmoxVE.Admin.Module.Dashboard/Models/Widget.cs (+3 -5)
📝 src/Corsinvest.ProxmoxVE.Admin.Module.Dashboard/dashboards.json (+0 -27)

📄 Description

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

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Corsinvest/cv4pve-admin/pull/153 **Author:** [@franklupo](https://github.com/franklupo) **Created:** 2/17/2026 **Status:** ✅ Merged **Merged:** 2/17/2026 **Merged by:** [@franklupo](https://github.com/franklupo) **Base:** `main` ← **Head:** `refactor/dashboard-remove-module-type` --- ### 📝 Commits (1) - [`eda3cb1`](https://github.com/Corsinvest/cv4pve-admin/commit/eda3cb1acd4270fb4579f907c1b7a5a90585be7d) refactor: remove redundant ModuleType from Widget and simplify GetModuleWidget ### 📊 Changes **6 files changed** (+165 additions, -45 deletions) <details> <summary>View changed files</summary> 📝 `src/Corsinvest.ProxmoxVE.Admin.Module.Dashboard/Components/Dashboard.razor.cs` (+0 -1) ➕ `src/Corsinvest.ProxmoxVE.Admin.Module.Dashboard/Migrations/20260217125654_RemoveWidgetModuleType.Designer.cs` (+128 -0) ➕ `src/Corsinvest.ProxmoxVE.Admin.Module.Dashboard/Migrations/20260217125654_RemoveWidgetModuleType.cs` (+32 -0) 📝 `src/Corsinvest.ProxmoxVE.Admin.Module.Dashboard/Migrations/ModuleDbContextModelSnapshot.cs` (+2 -12) 📝 `src/Corsinvest.ProxmoxVE.Admin.Module.Dashboard/Models/Widget.cs` (+3 -5) 📝 `src/Corsinvest.ProxmoxVE.Admin.Module.Dashboard/dashboards.json` (+0 -27) </details> ### 📄 Description ## 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 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-26 17:37:30 +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#147
No description provided.