[CSM][Web] Add back navigation from dashboard number/pie/bar widgets - #1384
Conversation
Clicking a dashboard's count/pie/bar widget tile lands on that resource's own list page (e.g. Cases) with no way back to the dashboard, unlike the dashboard's list-shape widget (whose embedded list already sets a `from` location.state pointing at the dashboard, since it renders directly on that page). DashboardWidgetTile now forwards the same `from` state on every count/pie/bar click-through, and CsmIssuesView (the shared list view backing Cases, Security Center, Operations, Engagements, and the project-issues tab) renders a Back button to it when present.
|
Important Review skippedNo new commits to review since the last review. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughDashboard widgets now preserve their dashboard route in navigation state. ChangesDashboard and case navigation
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant DashboardWidgetTile
participant ReactRouter
participant CsmIssuesView
DashboardWidgetTile->>ReactRouter: Navigate with dashboardReturnState
ReactRouter->>CsmIssuesView: Provide location.state.from
CsmIssuesView->>ReactRouter: Navigate to originating dashboard
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai review |
|
|
@coderabbitai resume |
✅ Action performedReviews resumed. |
Purpose
Clicking a dashboard's count/pie/bar widget tile navigates to that resource's own list page (e.g. Cases) with no way back to the dashboard — inconsistent with the dashboard's list-shape widget, which already returns to the dashboard directly from a case.
Goals
Approach
DashboardWidgetTilenow forwards afromlocation.state (the current dashboard URL) on every count/pie/bar navigation — the same state shape the list-shape widget's embeddedCasesListalready sets, since it renders directly on the dashboard page.CsmIssuesView(the shared list view backing Cases, Security Center, Operations, Engagements, and the project-issues tab) reads that state and renders a Back button when present.User stories
As a CSM portal user, when I click a number/pie/bar widget on my dashboard, I can use a Back button on the resulting list page to return directly to the dashboard.
Release note
Fix: dashboard number/pie/bar widgets now provide a way back to the dashboard from the list page they open.
Documentation
N/A — internal CSM portal UI, no external doc surface affected.
Automation tests
DashboardWidgetTile.test.tsx(state forwarding on count/slice/tile clicks) and a newCsmIssuesView.test.tsx(Back button presence/absence + navigation) — all passing.tsc -b,eslint, andvitest; haven't run this against a live/staging environment in a browser.Security checks
Test environment
apps/csm-portal/webapp:tsc -b,eslint, andvitest runall passing locally.Summary by CodeRabbit
New Features
Tests