[CSM Portal] minor fixes: strip internal error tags, gate CR approval on assigned team, split watchers into own tab - #1264
Conversation
… no assigned team The client-side gate for the New -> Assess transition only checked the generic state-machine transition list, but the backing data source also requires an assigned team before that transition is accepted. Without this, clicking Request approval could still round-trip to the backend and fail there. The button now also disables (with an explanatory tooltip) when the transition is otherwise legal but no team is assigned.
Watchers is now split into its own tab, positioned between Related and SLAs, with a dedicated Eye icon and a live count of watchers in the tab label. The Related tab keeps only the child-cases list and drops to a single-column layout now that it's a single widget. The action bar's "Manage watchers" item jumps to the new tab. No changes to WatchersWidget or the inline add/remove behavior.
|
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 (4)
🚧 Files skipped from review as they are similar to previous changes (4)
📝 WalkthroughWalkthroughThis PR adds a dedicated Watchers tab to case details, restricts change request approval when no team is assigned, and strips internal tags from ServiceNow client-facing errors while sanitizing logs. ChangesCase watchers tab
Change request approval gating
ServiceNow error handling
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
actor User
participant CsmCaseDetailPage
participant WatchersWidget
User->>CsmCaseDetailPage: Select watchers tab
CsmCaseDetailPage->>WatchersWidget: Render watcher list
User->>CsmCaseDetailPage: Choose manage_watchers
CsmCaseDetailPage->>WatchersWidget: Navigate to watchers tab
Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 golangci-lint (2.12.2)level=error msg="[linters_context] typechecking error: pattern ./...: directory prefix . does not contain main module or its selected dependencies" 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. |
|
@coderabbitai resume |
✅ Action performedReviews resumed. |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 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-operations/pages/CsmChangeRequestDetailPage.tsx`:
- Around line 289-302: Update the Tooltip wrapper around the disabled “Request
approval” Button to be keyboard-focusable with tabIndex={0} and an aria-label
combining “Request approval” with requestApprovalBlockedReason; add a
focus-based test verifying keyboard users can access the tooltip reason.
In `@entity-service/internal/servicenow-integration-service/client.go`:
- Around line 341-345: Update the error-message handling around
stripInternalErrorTag so that when stripping a tagged payload yields an empty
clientMsg, the function returns defaultMsg instead. Preserve the existing
sanitized logging for non-empty tagged messages and the current behavior for
untagged payloads.
- Around line 341-345: Update the logging in the stripInternalErrorTag flow to
retain the sanitized tag but replace the downstream-controlled clientMsg with a
fixed, non-user-controlled error summary. Keep returning clientMsg unchanged,
and preserve the existing conditional logging behavior when tag is present.
🪄 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: 6939ba64-2814-411b-84db-cf0ab13fd238
📒 Files selected for processing (5)
apps/csm-portal/webapp/src/features/csm-cases/pages/CsmCaseDetailPage.tsxapps/csm-portal/webapp/src/features/csm-operations/pages/CsmChangeRequestDetailPage.test.tsxapps/csm-portal/webapp/src/features/csm-operations/pages/CsmChangeRequestDetailPage.tsxentity-service/internal/servicenow-integration-service/client.goentity-service/internal/servicenow-integration-service/client_test.go
…ck, log sanitization - CsmChangeRequestDetailPage.tsx: make the disabled "Request approval" tooltip reachable by keyboard (tabIndex, aria-label on the wrapper), with a focus-target test. - client.go: fall back to defaultMsg when stripping an internal error tag leaves an empty client-facing message (e.g. a downstream body whose message is nothing but the tag). - client.go: stop logging the raw downstream-controlled message text; log only the sanitized tag, per this repo's "log IDs and sanitized summaries only" guideline.
|
@coderabbitai resume |
✅ Action performedReviews resumed. |
Purpose
Consolidates three independent, unrelated-but-small fixes into one PR (each was originally opened separately as #1259/#1260/#1261; those are closed in favor of this one) to reduce review overhead. Each commit is self-contained and independently revertable, spanning entity-service (Go) and the CSM webapp (React).
Goals
[SOMETHING_ERROR]-style tags (e.g.[SERVICENOW_ERROR]) from the backing data source into user-facing error messages — confirmed live in production traffic on a change-request approval rejection.Approach
Three independent commits, each addressing one issue in its own files with its own tests — see individual commit messages for detail. No shared code between them; a review can evaluate each commit in isolation.
Release note
Documentation
N/A — internal bug fixes and a UX improvement, no contract/shape changes.
Security checks
go vet ./...andeslint/tsccleanRelated PRs
Supersedes #1259, #1260, #1261 (closed in favor of this consolidated PR).
Summary by CodeRabbit