Skip to content

[CSM][Web] Add back navigation from dashboard number/pie/bar widgets - #1384

Merged
Rashmika998 merged 1 commit into
wso2-open-operations:mainfrom
Hesara2003:fix/csm-portal-dashboard-widget-back-navigation
Aug 6, 2026
Merged

[CSM][Web] Add back navigation from dashboard number/pie/bar widgets#1384
Rashmika998 merged 1 commit into
wso2-open-operations:mainfrom
Hesara2003:fix/csm-portal-dashboard-widget-back-navigation

Conversation

@Hesara2003

@Hesara2003 Hesara2003 commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

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

  • Give every dashboard widget click-through a consistent way back to the dashboard.

Approach

  • DashboardWidgetTile now forwards a from location.state (the current dashboard URL) on every count/pie/bar navigation — the same state shape the list-shape widget's embedded CasesList already 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

  • Unit tests: added regression tests in DashboardWidgetTile.test.tsx (state forwarding on count/slice/tile clicks) and a new CsmIssuesView.test.tsx (Back button presence/absence + navigation) — all passing.
  • Verified against staging: not yet — only verified locally via tsc -b, eslint, and vitest; haven't run this against a live/staging environment in a browser.

Security checks

Test environment

  • apps/csm-portal/webapp: tsc -b, eslint, and vitest run all passing locally.

Summary by CodeRabbit

  • New Features

    • Added a Back button to issue views when opened from a dashboard.
    • Dashboard widgets now preserve the originating dashboard location when navigating to detail pages.
    • Returning from detail pages takes users back to the exact dashboard view, including query parameters.
  • Tests

    • Added coverage for dashboard-origin navigation and back-button behavior.

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.
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review skipped

No new commits to review since the last review.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 3c973465-fee4-4062-a823-164ebafd079e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • ✅ Review completed - (🔄 Check again to review again)
📝 Walkthrough

Walkthrough

Dashboard widgets now preserve their dashboard route in navigation state. CsmIssuesView reads that state and conditionally provides a Back button. Tests cover state propagation and back navigation.

Changes

Dashboard and case navigation

Layer / File(s) Summary
Propagate dashboard origin state
apps/csm-portal/webapp/src/features/csm-dashboard/components/DashboardWidgetTile.tsx, apps/csm-portal/webapp/src/features/csm-dashboard/components/DashboardWidgetTile.test.tsx
Widget click-throughs include the current dashboard pathname and query string in router state. Tests cover count-tile, pie-slice, and pie-tile navigation.
Render and execute case-view back navigation
apps/csm-portal/webapp/src/features/csm-cases/components/CsmIssuesView.tsx, apps/csm-portal/webapp/src/features/csm-cases/components/CsmIssuesView.test.tsx
CsmIssuesView reads the optional from route state and renders a Back button that navigates to the originating path. Tests cover routes with and without origin state.

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
Loading

Possibly related PRs

Suggested reviewers: rashmika998, cloby99

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly and concisely describes the added back navigation for dashboard number, pie, and bar widgets.
Description check ✅ Passed The description covers the purpose, goals, approach, user story, release note, documentation, tests, security checks, and local test environment.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@madubashinii

Copy link
Copy Markdown

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor
⚠️ Action not completed

Already reviewed.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@Hesara2003
Hesara2003 requested review from Rashmika998 and rksk August 6, 2026 09:29
@rksk

rksk commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

@coderabbitai resume

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Reviews resumed.

@Rashmika998
Rashmika998 merged commit bc7b1e2 into wso2-open-operations:main Aug 6, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants