[CSM Portal] case-detail review follow-ups: severity columns, tag filter, inline watchers, tasks tab - #1221
Conversation
… watchers, tasks tab - Hide the Severity column on the SRA (Security Center) and Engagements list views via a new CasesList `hideSeverityColumn` prop, threaded through CsmIssuesView; the main case list keeps it. - Stop wiring the case-list tag filter (TagsMultiSelect) into CasesFilterBar, the URL params, and the /cases/search payload for now — the component and its search infra stay in place for the case-detail "Add tag" picker and a possible future reinstatement. - Replace the watchers "Manage watchers" dialog (WatchersDialog, now removed) with inline add/remove directly in the case detail Related tab: chips get a delete affordance, and an "Add watcher" toggle reveals an inline search-and-pick panel. The action bar's "Manage watchers" item now jumps to the Related tab instead of opening a dialog. - Hide the case-detail "Tasks" tab from the visible tab bar for now (flagged via a `hidden` marker on its TAB_DEFS entry) without deleting the underlying tasks feature/data; the task-create flow no longer switches to the now-hidden tab.
Tags are a curated, pre-existing vocabulary, not free text -- remove the freeSolo/create-new-tag fallback from AddTagDialog. A tag can only be added by selecting a search result; typing alone (with no selection) no longer enables Add tag.
📝 WalkthroughWalkthroughThis PR replaces free-text case tag creation with curated selection, removes case-list tag filtering, moves watcher management into the Related tab with inline search and patching, hides the Tasks tab, and adds severity-column controls for engagements and security reports. ChangesTag selection and case filtering
Inline watcher management
Case detail and issue-list presentation
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant CsmCaseDetailPage
participant WatchersWidget
participant useSearchUsers
participant CasesAPI
User->>CsmCaseDetailPage: Choose Manage watchers
CsmCaseDetailPage->>WatchersWidget: Render Related tab watcher controls
User->>WatchersWidget: Search for a watcher
WatchersWidget->>useSearchUsers: Query debounced input
useSearchUsers-->>WatchersWidget: Return user candidates
User->>WatchersWidget: Select or remove watcher
WatchersWidget->>CsmCaseDetailPage: Emit watcher change
CsmCaseDetailPage->>CasesAPI: PATCH case watchList
CasesAPI-->>CsmCaseDetailPage: Return patch result
Possibly related PRs
Suggested labels: 🚥 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
apps/csm-portal/webapp/src/features/csm-cases/components/CaseDetailWidgets.tsx (1)
384-458: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick winGate the watcher picker query until a search term is entered.
searchstarts as"", so mounting the picker immediately issues the users search with onlyactive: trueand a broadlimit: 8. If active users are returned, the empty-state hint never appears. SinceuseSearchUsersdoes not expose anenabledoption, either add that support and passenabled: search.length > 0, or bypass the query/clearcandidateswhilesearchis empty.🤖 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/components/CaseDetailWidgets.tsx` around lines 384 - 458, Gate the watcher picker’s useSearchUsers request until search contains a non-empty term. Prefer adding and wiring an enabled option through useSearchUsers with enabled set from search.length > 0; otherwise bypass the query and ensure candidates is empty while search is blank, preserving the existing loading, error, and no-match states for active searches.
🤖 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 1068-1113: Update onAddWatcher and onRemoveWatcher so rebuilding
watchList preserves existing email-less watchers by retaining their stable id or
userName in the PATCH payload. Apply the same preservation logic to both
handlers, and when removing a watcher that cannot be represented safely in the
full-list update, surface the existing error path instead of silently dropping
it.
---
Nitpick comments:
In
`@apps/csm-portal/webapp/src/features/csm-cases/components/CaseDetailWidgets.tsx`:
- Around line 384-458: Gate the watcher picker’s useSearchUsers request until
search contains a non-empty term. Prefer adding and wiring an enabled option
through useSearchUsers with enabled set from search.length > 0; otherwise bypass
the query and ensure candidates is empty while search is blank, preserving the
existing loading, error, and no-match states for active searches.
🪄 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 Plus
Run ID: 5ffb8eff-67f4-4a43-a7e7-64cfaee77d2b
📒 Files selected for processing (16)
apps/csm-portal/webapp/src/features/csm-cases/api/useGetCsmCases.tsapps/csm-portal/webapp/src/features/csm-cases/components/AddTagDialog.test.tsxapps/csm-portal/webapp/src/features/csm-cases/components/AddTagDialog.tsxapps/csm-portal/webapp/src/features/csm-cases/components/CaseActionBar.tsxapps/csm-portal/webapp/src/features/csm-cases/components/CaseDetailWidgets.test.tsxapps/csm-portal/webapp/src/features/csm-cases/components/CaseDetailWidgets.tsxapps/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/components/WatchersDialog.test.tsxapps/csm-portal/webapp/src/features/csm-cases/components/WatchersDialog.tsxapps/csm-portal/webapp/src/features/csm-cases/pages/CsmCaseDetailPage.tsxapps/csm-portal/webapp/src/features/csm-cases/utils/casesFiltersUrl.test.tsapps/csm-portal/webapp/src/features/csm-cases/utils/casesFiltersUrl.tsapps/csm-portal/webapp/src/features/csm-engagements/pages/CsmEngagementsPage.tsxapps/csm-portal/webapp/src/features/csm-security-center/pages/CsmSecurityCenterPage.tsx
💤 Files with no reviewable changes (2)
- apps/csm-portal/webapp/src/features/csm-cases/components/WatchersDialog.test.tsx
- apps/csm-portal/webapp/src/features/csm-cases/components/WatchersDialog.tsx
The watcher PATCH resubmits the full watch list as an array of emails (ServiceNow's watch_list only round-trips as EmailString[]), so a watcher with no email on file has no representation in that list. Rebuilding the list from only-emailed watchers on every add/remove silently dropped those users from the case's watch list. Block the mutation and surface an error instead of silently losing watchers.
|
@coderabbitai resume |
✅ Action performedReviews resumed. |
22ad9ce
into
wso2-open-operations:dev-app-csm-portal
Purpose
Further review follow-ups on the recently-merged CSM portal case-feature work (#1216-#1219): several project-owner review comments on the shipped feature set.
Goals
Approach
Rebased directly onto the latest
main(after #1219 merged) and resolved a real merge conflict against a concurrently-merged colleague PR that independently added an equivalenthideSeverityColumnprop to the same shared list component for Service Requests — combined both conditions into one clean implementation rather than keeping a duplicate. Everything else follows this codebase's existing component/hook conventions.User stories
As a CS engineer, I want list views to only show columns relevant to that record type, a simpler inline way to manage watchers without a popup, and a tag picker that reflects the platform's actual curated tag vocabulary rather than implying free-form tagging.
Release note
Removes the Severity column from SRA/Engagements lists, removes the case-list tags filter (temporarily), makes watcher management fully inline on the case detail Related tab, hides the Tasks tab for now, and restricts tag entry to search-and-select.
Documentation
N/A — internal tool, no external product docs affected.
Automation tests
Security checks
pnpm lintrun clean)Samples
N/A
Related PRs
Follow-up to #1216, #1217, #1218, #1219 (all merged).
Migrations (if applicable)
N/A
Test environment
Node/pnpm (as pinned by this repo), macOS, verified via
npx tsc -b,pnpm build,npx vitest run,pnpm lint.Learning
N/A
Summary by CodeRabbit
New Features
Updated Experience
Bug Fixes