Skip to content

[CSM Portal][FE] feat: implement engagements search and detail navigation - #955

Merged
cloby99 merged 2 commits into
wso2-open-operations:v2from
Rashmika998:feat/csm-engagements-ui
Jun 26, 2026
Merged

[CSM Portal][FE] feat: implement engagements search and detail navigation#955
cloby99 merged 2 commits into
wso2-open-operations:v2from
Rashmika998:feat/csm-engagements-ui

Conversation

@Rashmika998

@Rashmika998 Rashmika998 commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Replaces the coming-soon placeholder at /engagements with a fully working cross-customer engagements list
  • Adds BeEngagementType union type and engagementTypes filter to BeCaseSearchFilters (mirrors the entity-service and BFF OpenAPI spec)
  • Extends CasesFilters with engagementTypes; adds an Engagement type multi-select to CasesFilterBar behind a showEngagementTypeFilter prop (Migration, Consultancy, New feature / improvement, Follow-up, Onboarding)
  • Persists engagementTypes in the URL via casesFiltersUrl read/write/count helpers
  • Passes engagementTypes in useGetCsmCases query key and POST /cases/search payload
  • Adds detailBasePath prop to CsmIssuesView / CasesList so engagement rows link to /engagements/:id instead of /cases/:id
  • CsmCaseDetailPage derives back-button label and target from location.pathname: /engagements/…"Back to engagements" / /cases/…"Back to cases" (all three back-button instances updated)
  • New CsmEngagementsPage with locked type: engagement, engagement-type filter, and detailBasePath="/engagements"
  • Routes: /engagementsCsmEngagementsPage; /engagements/:caseIdCsmCaseDetailPage

Test plan

  • Navigate to /engagements — list loads with all engagement-type cases
  • Search by subject/ID filters results correctly
  • Filter by Engagement type (e.g. Migration) — list narrows
  • Filter by State — list narrows
  • Click a row — URL changes to /engagements/:caseId, not /cases/:caseId
  • Back button on engagement detail shows "Back to engagements" and returns to /engagements
  • Navigate to /cases — back button still shows "Back to cases"
  • Engagement type filter does not appear on the all-cases page

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added a dedicated Engagements page with its own list and detail navigation.
    • Introduced an Engagement type filter to help narrow engagement-related cases.
    • Engagement case pages now support returning to the engagements list.
  • Bug Fixes

    • Case list filters now refresh correctly when engagement type selections change.
    • Engagement filter selections are preserved in the URL and reflected in active filter counts.

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

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@Rashmika998, we couldn't start this review because you've reached your PR review rate limit.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: d99c78e6-8a77-4475-a3b3-8dfc806b1dd7

📥 Commits

Reviewing files that changed from the base of the PR and between 7650f75 and d0f0e00.

📒 Files selected for processing (1)
  • apps/csm-portal/webapp/src/features/csm-cases/pages/CsmCaseDetailPage.tsx
📝 Walkthrough

Walkthrough

Adds engagement-type filtering to the cases search flow, introduces an /engagements page and route, and makes case-detail navigation and back links route-aware for both /cases and /engagements.

Changes

Engagement cases flow

Layer / File(s) Summary
Engagement filter contract
apps/csm-portal/webapp/src/api/backend/types.ts, apps/csm-portal/webapp/src/features/csm-cases/utils/casesFiltersUrl.ts
Adds BeEngagementType, extends the shared cases filter shape, default filters, and engagement-type allowlist.
Filter URL and query sync
apps/csm-portal/webapp/src/features/csm-cases/utils/casesFiltersUrl.ts, apps/csm-portal/webapp/src/features/csm-cases/api/useGetCsmCases.ts
Parses, writes, and counts engagementTypes in the filter URL and includes it in the cases query key and search payload.
Filter bar and shared view wiring
apps/csm-portal/webapp/src/features/csm-cases/components/CasesFilterBar.tsx, apps/csm-portal/webapp/src/features/csm-cases/components/CsmIssuesView.tsx, apps/csm-portal/webapp/src/features/csm-cases/components/CasesList.tsx
Adds the engagement-type multi-select, threads the new filter through the shared cases view, and makes row links use a configurable detail base path.
Engagements page route
apps/csm-portal/webapp/src/features/csm-engagements/pages/CsmEngagementsPage.tsx, apps/csm-portal/webapp/src/App.tsx
Introduces CsmEngagementsPage, lazy-loads it, and routes /engagements and /engagements/:caseId.
Route-aware case detail back links
apps/csm-portal/webapp/src/features/csm-cases/pages/CsmCaseDetailPage.tsx
Computes back navigation from the current route and updates the error, not-found, and header back buttons accordingly.

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
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested labels

Type/New Feature, Area/Frontend, App/CSM Portal

Suggested reviewers

  • cloby99
  • dilshanfardil

Poem

A bunny hopped through /engagements so bright,
with filters and routes all snug and right.
Back buttons twitched, “Hop here!” they said,
from case detail paths to clover-fed bread.
Thump-thump! 🐇

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description only includes Summary and Test plan; it misses most required template sections like Purpose, Goals, Approach, Release note, and Security checks. Add the missing sections: Purpose, Goals, Approach, User stories, Release note, Documentation, Training, Certification, Marketing, Automation tests, Security checks, Samples, Related PRs, Migrations, Test environment, and Learning.
Docstring Coverage ⚠️ Warning Docstring coverage is 45.45% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: adding engagements search and detail navigation in the CSM Portal.
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.
✨ 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.

@Rashmika998 Rashmika998 self-assigned this Jun 26, 2026
@Rashmika998 Rashmika998 added Type/Improvement Marks enhancements or improvements to existing features Area/Frontend App/CSM Portal labels Jun 26, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 value

Optional: engagement-type allowlist is duplicated across files.

VALID_ENGAGEMENT_TYPES here and ALL_ENGAGEMENT_TYPES in CasesFilterBar.tsx are identical literal arrays that must stay in sync (a future enum value would need editing in both). This mirrors the existing VALID_SEVERITIES/ALL_SEVERITIES pattern, 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

📥 Commits

Reviewing files that changed from the base of the PR and between 99f1352 and 7650f75.

📒 Files selected for processing (9)
  • apps/csm-portal/webapp/src/App.tsx
  • apps/csm-portal/webapp/src/api/backend/types.ts
  • apps/csm-portal/webapp/src/features/csm-cases/api/useGetCsmCases.ts
  • apps/csm-portal/webapp/src/features/csm-cases/components/CasesFilterBar.tsx
  • apps/csm-portal/webapp/src/features/csm-cases/components/CasesList.tsx
  • apps/csm-portal/webapp/src/features/csm-cases/components/CsmIssuesView.tsx
  • apps/csm-portal/webapp/src/features/csm-cases/pages/CsmCaseDetailPage.tsx
  • apps/csm-portal/webapp/src/features/csm-cases/utils/casesFiltersUrl.ts
  • apps/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>
@cloby99
cloby99 merged commit ac93cfb into wso2-open-operations:v2 Jun 26, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

App/CSM Portal Area/Frontend Type/Improvement Marks enhancements or improvements to existing features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants