[CSM Portal][FE] feat: implement engagements search and detail navigation - #955
Conversation
…tion Replace the coming-soon placeholder at /engagements with a fully working engagements list backed by POST /cases/search (type: engagement). - Add BeEngagementType union type and engagementTypes filter to BeCaseSearchFilters in api/backend/types.ts - Extend CasesFilters with engagementTypes; add engagement-type multi-select to CasesFilterBar behind showEngagementTypeFilter prop - Persist engagementTypes in URL via casesFiltersUrl read/write/count - Pass engagementTypes in useGetCsmCases query key and search payload - Add detailBasePath and showEngagementTypeFilter props to CsmIssuesView; thread detailBasePath down to CasesList row links - CsmCaseDetailPage: derive back label/path from location.pathname so /engagements/:id shows "Back to engagements" and /cases/:id is unchanged - New CsmEngagementsPage using CsmIssuesView with locked engagement type, engagement-type filter, and detailBasePath="/engagements" - Route /engagements → CsmEngagementsPage; /engagements/:caseId → CsmCaseDetailPage Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Warning Review limit reached
More reviews will be available in 46 minutes and 19 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds engagement-type filtering to the cases search flow, introduces an ChangesEngagement cases flow
Sequence Diagram(s)sequenceDiagram
participant App Router
participant CsmEngagementsPage
participant CsmIssuesView
participant CasesList
participant CsmCaseDetailPage
App Router->>CsmEngagementsPage: render /engagements
CsmEngagementsPage->>CsmIssuesView: pass caseTypes, showEngagementTypeFilter, detailBasePath="/engagements"
CsmIssuesView->>CasesList: pass detailBasePath="/engagements"
CasesList->>App Router: navigate to /engagements/:caseId
App Router->>CsmCaseDetailPage: render /engagements/:caseId
CsmCaseDetailPage->>App Router: derive backPath and backLabel from location.pathname
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
apps/csm-portal/webapp/src/features/csm-cases/utils/casesFiltersUrl.ts (1)
45-51: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueOptional: engagement-type allowlist is duplicated across files.
VALID_ENGAGEMENT_TYPEShere andALL_ENGAGEMENT_TYPESinCasesFilterBar.tsxare identical literal arrays that must stay in sync (a future enum value would need editing in both). This mirrors the existingVALID_SEVERITIES/ALL_SEVERITIESpattern, so it's consistent with the codebase—consider consolidating to a single shared constant when convenient.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/csm-portal/webapp/src/features/csm-cases/utils/casesFiltersUrl.ts` around lines 45 - 51, The engagement-type allowlist is duplicated between VALID_ENGAGEMENT_TYPES in casesFiltersUrl.ts and ALL_ENGAGEMENT_TYPES in CasesFilterBar.tsx, so keep them from drifting by consolidating to one shared source of truth. Update the cases filter utilities to reuse a common constant or exported list for BeEngagementType values, following the same pattern used for VALID_SEVERITIES and ALL_SEVERITIES, and then reference that shared symbol wherever the allowlist is needed.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@apps/csm-portal/webapp/src/features/csm-cases/pages/CsmCaseDetailPage.tsx`:
- Around line 244-246: The detail URL is still hard-coded to the cases route
even though CsmCaseDetailPage already detects whether the current route is an
engagement view. Derive a single detailPath from isEngagementRoute alongside
backPath/backLabel, and reuse that value in the recordView call and the
clipboard write so recent views and “copy link” stay on the current route
family.
---
Nitpick comments:
In `@apps/csm-portal/webapp/src/features/csm-cases/utils/casesFiltersUrl.ts`:
- Around line 45-51: The engagement-type allowlist is duplicated between
VALID_ENGAGEMENT_TYPES in casesFiltersUrl.ts and ALL_ENGAGEMENT_TYPES in
CasesFilterBar.tsx, so keep them from drifting by consolidating to one shared
source of truth. Update the cases filter utilities to reuse a common constant or
exported list for BeEngagementType values, following the same pattern used for
VALID_SEVERITIES and ALL_SEVERITIES, and then reference that shared symbol
wherever the allowlist is needed.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 16f530eb-7ae5-4ce9-a48c-c5a4e8a54f96
📒 Files selected for processing (9)
apps/csm-portal/webapp/src/App.tsxapps/csm-portal/webapp/src/api/backend/types.tsapps/csm-portal/webapp/src/features/csm-cases/api/useGetCsmCases.tsapps/csm-portal/webapp/src/features/csm-cases/components/CasesFilterBar.tsxapps/csm-portal/webapp/src/features/csm-cases/components/CasesList.tsxapps/csm-portal/webapp/src/features/csm-cases/components/CsmIssuesView.tsxapps/csm-portal/webapp/src/features/csm-cases/pages/CsmCaseDetailPage.tsxapps/csm-portal/webapp/src/features/csm-cases/utils/casesFiltersUrl.tsapps/csm-portal/webapp/src/features/csm-engagements/pages/CsmEngagementsPage.tsx
…link Use the same isEngagementRoute flag to build a detailPath that is either /engagements/:id or /cases/:id, then reuse it for the recent-view href and the clipboard writeText so both stay on the correct route family. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Summary
/engagementswith a fully working cross-customer engagements listBeEngagementTypeunion type andengagementTypesfilter toBeCaseSearchFilters(mirrors the entity-service and BFF OpenAPI spec)CasesFilterswithengagementTypes; adds an Engagement type multi-select toCasesFilterBarbehind ashowEngagementTypeFilterprop (Migration, Consultancy, New feature / improvement, Follow-up, Onboarding)engagementTypesin the URL viacasesFiltersUrlread/write/count helpersengagementTypesinuseGetCsmCasesquery key andPOST /cases/searchpayloaddetailBasePathprop toCsmIssuesView/CasesListso engagement rows link to/engagements/:idinstead of/cases/:idCsmCaseDetailPagederives back-button label and target fromlocation.pathname:/engagements/…→ "Back to engagements" //cases/…→ "Back to cases" (all three back-button instances updated)CsmEngagementsPagewith lockedtype: engagement, engagement-type filter, anddetailBasePath="/engagements"/engagements→CsmEngagementsPage;/engagements/:caseId→CsmCaseDetailPageTest plan
/engagements— list loads with all engagement-type cases/engagements/:caseId, not/cases/:caseId/engagements/cases— back button still shows "Back to cases"🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Bug Fixes