[CSM Portal] fix cases list: state chips, alignment, pagination, severity mapping - #943
Conversation
…rity mapping
- SemanticChip: switch from manual bgcolor sx override to MUI color prop so
chips render correctly in CSS-variables themes (Oxygen UI); default role now
uses filled grey instead of outlined to avoid looking like a button
- CasesList: fix Subject overflow — remove justifyItems:start which was
letting the Subject Box take its intrinsic (unwrapped) width; wrap
SeverityChip/StateChip in Box sx={{ justifySelf:"start" }} so only chips
opt out of stretch; add explicit textAlign:left to header labels
- CsmCasesPage: fix Next button — add data !== undefined guard to the page
clamp so it doesn't reset page>0 back to 0 while the new page is loading;
derive paginationCount from hasMore so Next stays enabled when the backend
signals more pages
- mappers/types: widen severity field on BeCaseSearchView and BeCaseView to
string; update severityFromPriority to handle the backend display-string
format ("Critical (P1)", "Low (P4)") via P-notation substring match,
keeping English-name fallbacks; add tests for the new format
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Warning Review limit reached
More reviews will be available in 47 minutes and 1 second. 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)
📝 WalkthroughWalkthroughThe PR widens ChangesSeverity String Parsing, SemanticChip Simplification, and Pagination Fixes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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
🤖 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/CsmCasesPage.tsx`:
- Line 152: The pagination count in CsmCasesPage is falling back to total during
loading because data is undefined, which makes TablePagination receive an
out-of-range count on page transitions. Update the paginationCount logic so that
undefined data is treated the same as an unknown total (keep count at -1) until
real data arrives, using the existing data?.hasMore and total handling in
CsmCasesPage to avoid snapping/disabling Next mid-refetch.
🪄 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: d6b559ce-a06c-4096-9489-c3747efc6810
📒 Files selected for processing (6)
apps/csm-portal/webapp/src/api/backend/mappers.test.tsapps/csm-portal/webapp/src/api/backend/mappers.tsapps/csm-portal/webapp/src/api/backend/types.tsapps/csm-portal/webapp/src/components/SemanticChip.tsxapps/csm-portal/webapp/src/features/csm-cases/components/CasesList.tsxapps/csm-portal/webapp/src/features/csm-cases/pages/CsmCasesPage.tsx
During a page transition data is undefined, so data?.hasMore is falsy and paginationCount was falling to total (0), putting TablePagination in an out-of-range state that could disable/snap Next mid-refetch. Now treat undefined data the same as hasMore=true (count=-1) so Next stays enabled until real data arrives. Addresses CodeRabbit review comment on PR wso2-open-operations#943. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Summary
SemanticChipnow uses MUI'scolorprop instead of a manualbgcolorsx override; the override was silently broken in CSS-variables themes (Oxygen UI) wheretheme.palette.info.mainreturns a CSS variable reference, not a hex. Thedefaultrole switches fromvariant="outlined"(looked like a button) to filled grey.justifyItems: "start"from row subgrids — it was forcing the SubjectBoxto take its intrinsic (fully unwrapped) width, causing overflow into the Product column. Chips are individually wrapped inBox sx={{ justifySelf: "start" }}so only they opt out of stretch. Added explicittextAlign: "left"to header labels.data !== undefinedguard to the page-clamp logic. Without it, clicking Next setpage = 1, React Query started loading (data →undefined),totalfell to 0, andlastPageclamped the page straight back to 0 — the API call for page 1 never completed. Also derivespaginationCountfromhasMoreso Next stays enabled when the backend signals more results.severityFromPrioritynow acceptsstring | undefinedand matches the backend's display-string format ("Critical (P1)","Low (P4)") via case-insensitive P-notation substring, keeping legacy English-name fallbacks.BeCaseSearchView.severityandBeCaseView.severitywidened tostringto reflect the actual API contract.Test plan
…when longer than the column; no overflow into ProductPOST /cases/searchwith incremented offset)"Critical (P1)"→ S1 chip🤖 Generated with Claude Code
Summary by CodeRabbit