[CSM Portal Microapp] Fix Service Requests/Security Reports not loading, align state/severity with webapp - #1104
Merged
cloby99 merged 1 commit intoJul 9, 2026
Conversation
…verity with webapp
Service Requests and Security Reports cards were stuck in an infinite
retry loop instead of loading: severity/issueType are only populated
for the "case" type (the backend's own create-payload docs say
"Required for case type"), so other types come back with severity
null. normalizeSeverity() called .toLowerCase() on that null
unconditionally and threw — a plain JS error, not an HTTP 4xx, so
React Query didn't treat it as non-retryable and burned several
seconds retrying before ever reaching the error state.
Also found while comparing against the real data: severity sometimes
arrives as a legacy ServiceNow priority code ("P2") rather than the
documented word ("high"), and state sometimes arrives as a labeled
string ("Work In Progress") rather than the snake_case enum. Both are
now normalized the same way apps/csm-portal/webapp's
api/backend/mappers.ts already does.
Severity is now nullable end-to-end (CaseSearchViewDto/CaseViewDto ->
CaseSummary/CaseDetail), and the severity chip is simply omitted on
cards/detail page for types that don't have one.
State/severity labels and colors in config.tsx now match the webapp's
STATE_LABEL/STATE_COLOR and SEVERITY_LABEL exactly (e.g. "S2 (High)"
code-first format, "Waiting on WSO2", etc.) instead of ad hoc wording.
Contributor
📝 WalkthroughWalkthroughThis PR relaxes strict enum typing for case severity/issueType/state in DTOs to permissive string/nullable types, introduces normalizeSeverity and normalizeState helpers in the case model to canonicalize backend values, updates chip label/color configs, and makes severity chip rendering conditional in CaseCard and CaseDetailPage. ChangesCase severity/state normalization and UI updates
Estimated code review effort: 2 (Simple) | ~15 minutes Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 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 |
2 tasks
cloby99
approved these changes
Jul 9, 2026
cloby99
merged commit Jul 9, 2026
5a2d53d
into
wso2-open-operations:dev-app-csm-portal
2 checks passed
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
casetype; the previous normalizer crashed onnull, and since that's a plain JS error rather than an HTTP 4xx, React Query burned several retries before ever showing the error state).P2) for severity, and labeled state strings (Work In Progress) instead of the snake_case enum — both handled the same wayapps/csm-portal/webapp'sapi/backend/mappers.tsalready does.config.tsxnow match the webapp'sSTATE_LABEL/STATE_COLOR/SEVERITY_LABELexactly.Test plan
npm run lint/tsc --noEmitclean (verified with this commit isolated from other in-progress work)Summary by CodeRabbit