Merge DashboardView and GridStackView into a single dashboard #19
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The project currently ships two dashboards that render the same three charts from the same hardcoded data:
views/DashboardView.java(@Route("")) — a staticVerticalLayoutof threeCards with fixed400pxheights.views/GridStackView.java(@Route("gridstack")) — the same three charts inside aGridStackLayout, draggable/resizable, layout persisted tolocalStorage, plus an add/reset toolbar.DashboardViewis effectively a degenerateGridStackViewwithstaticGrid = true. Every chart-building method (lineChart(),barChart(),pieChart(),months()) exists twice with slightly different sizing, and any new widget has to be written twice.Proposal
Collapse both into one dashboard view backed by
GridStackLayout:@Route("").GridStackView(or keep@Route("gridstack")as an alias /staticGridvariant if the demo value is worth keeping).MainLayout'sSideNavso there is one dashboard entry, not two.sizeFull(...)(charts filling the grid item, height100%) becomes the single sizing strategy — the fixed400pxfromDashboardViewgoes away.Why first
This is the prerequisite for essentially every other dashboard improvement. Implementing anything on top of the current structure means implementing it twice.
Acceptance criteria
localStorage.MainLayoutnavigation reflects the merge.views/DashboardViewTestasserts the merged view builds and contains the expected widgets (there is currently noDashboardViewTestat all — onlyGridStackViewTest)../mvnw testgreen.Scope
Medium — mostly deletion and moving, but it touches routes and navigation, so the existing
GridStackViewTestneeds to move with it.PR: #31
GridStackViewis gone; the grid dashboard now lives at@Route("")inDashboardView, with one set of chart factories, the point-click notifications from the old dashboard, and oneSideNavItem.GridStackViewTestwas renamed toDashboardViewTestand gained a case asserting the three charts render.Two decisions worth a look at review:
localStoragekey changed fromgridstack-demotodashboard, so an existing saved layout is dropped once. Say the word if you'd rather keep the old key.@Route("gridstack")was not kept as an alias — the issue left that optional and the demo value is fully covered by the merged view../mvnw test→ 11 tests, 0 failures.