[CSM Portal] fix dashboard drill-down losing its team filter - #1379
Conversation
… its team filter List-shape dashboard widgets now show their total item count next to the title, matching the existing count-shape widget's number formatting. The "View more" drill-down page also stopped silently dropping the current team's filter: its link was built from a widget's raw, unresolved filters, so a team-scoped widget's placeholder never got resolved before navigating away, and the destination page (which has no team context of its own) fell back to its documented fail-open behavior and queried every team's data instead. The link now resolves the placeholder first, the same way the count-shape widget's own click-through already does, and the drill-down page shows the resolved filter criteria so what's being queried is visible rather than implicit.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthroughDashboard widgets now resolve current-team placeholders in preview URLs and display resolved active filters as accessible chips. The case detail page also shows the SLA tab. ChangesDashboard widget filter handling
Case detail SLA tab
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant DashboardWidgetTile
participant widgetPreviewUrl
participant DashboardWidgetPreviewPage
DashboardWidgetTile->>widgetPreviewUrl: Resolve current-team filter
DashboardWidgetTile->>DashboardWidgetPreviewPage: Open preview with resolved filters
DashboardWidgetPreviewPage->>widgetPreviewUrl: Describe query filters
widgetPreviewUrl-->>DashboardWidgetPreviewPage: Return filter summary entries
DashboardWidgetPreviewPage-->>DashboardWidgetPreviewPage: Render active-filter chips
Possibly related PRs
Suggested labels: 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 resume |
✅ Action performedReviews resumed. |
…a bare number A bare total on its own still made the viewer do arithmetic against the listLimit to know how much of it the tile is showing. Match the wording the drill-down page's own pagination already uses, in the same spot.
hidden: true was reintroduced in wso2-open-operations#1267 with no recorded rationale, three weeks after the tab shipped visible in wso2-open-operations#1049/wso2-open-operations#1079. The underlying data path (useGetCsmCaseSlas -> BFF/entity-service POST /slas/search) works and is already being fetched on page load; only the tab button was unreachable.
Dropping the total-count feature (and its later "1-N of total" reformat) from this branch; keeping the "View more" team-filter fix and the drill-down page's filter-criteria display, which don't depend on it.
Purpose
The CSM Portal dashboard's "View more" drill-down page (
shape: "list"widgets) silentlydropped the current team's filter, returning every team's data instead of the viewer's own.
Resolves one reported CSM Portal dashboard issue (tracked internally).
Goals
Approach
DashboardWidgetTile.tsx: the "View more" link now resolves the widget's team-placeholderfilter before building its URL (
resolveTeamPlaceholder(filters, selectedTeamGroupId)),mirroring the count-shape widget's own click-through link, which already did this correctly.
Previously the raw, unresolved filter reached the URL, and the destination page — which has
no team context of its own — fell back to its documented fail-open behavior and dropped the
filter entirely.
widgetPreviewUrl.ts: newdescribeWidgetFilters()helper flattens a widget's filters(both shapes this app uses) into a human-readable list, reusing the existing case-filter-DSL
handling rather than duplicating it.
DashboardWidgetPreviewPage.tsx: renders the above as a "Filtered by: ..." chip row abovethe results.
CsmCaseDetailPage.tsx: un-hides the case detail SLAs tab (hidden: truewas reintroducedwith no recorded rationale three weeks after the tab shipped visible; the underlying data
path already works and is fetched on page load — only the tab button was unreachable).
User stories
As a CS engineer, when I drill into a dashboard widget's "View more" I see the same
team-scoped data the tile showed me, plus a clear summary of what's being filtered. Separately,
I can reach the case detail SLAs tab again.
Release note
Dashboard "View more" pages now keep the current team's filter and show the active filter
criteria. The case detail SLAs tab is visible again.
Documentation
N/A — internal-tool UI behavior change, no external-facing docs to update.
Automation tests
the team-placeholder resolution on the "View more" href, 3 for the filter-criteria display,
5 for the new
describeWidgetFiltershelper).backend (local full-stack run), confirming the filter-criteria chips reflect real data
correctly.
Security checks
eslint/tsc -bran clean)Samples
N/A
Related PRs
None
Migrations (if applicable)
N/A — no schema/data change.
Test environment
Verified locally: Vitest (jsdom), Node/pnpm per repo's
package.json, Chrome (manualend-to-end check against a local full-stack run with real ServiceNow DEV data).
Learning
N/A
Summary by CodeRabbit
New Features
Bug Fixes