Skip to content

[CSM Portal] Operations tab + SR creation; align FE with BE #938; stop calling missing /csm/dashboard - #937

Merged
cloby99 merged 2 commits into
wso2-open-operations:v2from
rksk:csm-operations-sr
Jun 25, 2026
Merged

cloby99 merged 2 commits into
wso2-open-operations:v2from
rksk:csm-operations-sr

Conversation

@rksk

@rksk rksk commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

1. Operations tab + Service Request creation

  • Operations landing — SR / CR / Incident as tabs. The Service Requests tab has a Create service request entry point; CR/Incident are "coming soon".
  • Create-SR form (/operations/service-requests/new) — project, priority (S0–S4), subject, description. Submission gated off (SR_CREATE_ENABLED = false): no SR create endpoint yet (SR is only a case type; POST /cases takes case only). Validates and is ready to wire; no API call made.

2. Align FE with BE PR #938 (entity #934)

  • Case type value supportcase across BeCaseType, POST /cases, the case-type filter (label "Support" → "Case"), CsmCaseCreatePage. (v2's FE still sent support while the merged BFF expects case — this fixes that inconsistency.)
  • CaseView: nullable type/engagementType + catalog/catalogItem/assignedTeam/conversation refs; deployment/deployedProduct nullable.
  • CaseSearchView: add type (mapped onto the row); refs nullable.

3. Stop calling the missing /csm/dashboard endpoint (folds in #941)

  • The dashboard fired GET /csm/dashboard on every load — a guaranteed 404 (no such BFF endpoint). Query disabled (DASHBOARD_ENDPOINT_READY = false); one-line flip to re-enable. Header degrades to a neutral "Engineer overview" subtitle (no perpetual "Loading…"); unused isError prop dropped. The live /cases/search-backed widgets are unaffected.

Testing

pnpm lint, pnpm test, pnpm build, tsc -b all green.

@coderabbitai

coderabbitai Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review skipped

No new commits to review since the last review.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 9acb0a8c-9e4f-462d-921d-5a3de5f14a5a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The PR adds two new Operations feature pages (OperationsPage and CreateServiceRequestPage) to the CSM portal, wiring them into the authenticated route tree. Concurrently, it renames the case type literal from "support" to "case" across backend types, frontend utilities, the case create payload, the cases query mapping, and URL filter tests. BeCaseView also gains new nullable fields.

Changes

New Operations Feature Pages

Layer / File(s) Summary
OperationsPage tabbed landing
apps/csm-portal/webapp/src/features/csm-operations/pages/OperationsPage.tsx
Adds OperationsPage with three tabs (Service requests, Change requests, Incidents), a local TabPanel helper component with optional "Coming soon" chip, and navigation to the create service request route.
CreateServiceRequestPage gated form
apps/csm-portal/webapp/src/features/csm-operations/pages/CreateServiceRequestPage.tsx
Adds CreateServiceRequestPage with form state (projectId, priority, subject, description), useMemo-derived isValid, and a SR_CREATE_ENABLED = false flag that gates the submit handler and disables the submit button with a Tooltip.
Route wiring
apps/csm-portal/webapp/src/App.tsx
Lazy-loads OperationsPage and CreateServiceRequestPage, replaces the /operations placeholder route with <OperationsPage />, and adds the nested /operations/service-requests/new route.

Case Type Rename: support → case

Layer / File(s) Summary
Backend type contract updates
apps/csm-portal/webapp/src/api/backend/types.ts
BeCaseType replaces "support" with "case"; BeCaseView gains nullable type, new engagementType, catalog, catalogItem, assignedTeam, and conversation fields; BeCaseCreatePayload.type changes to "case"; BeCaseSearchView fields made nullable.
Frontend propagation
apps/csm-portal/webapp/src/features/csm-cases/utils/caseType.ts, ...pages/CsmCaseCreatePage.tsx, ...api/useGetCsmCases.ts, ...utils/casesFiltersUrl.test.ts
Updates ALL_CASE_TYPES and CASE_TYPE_LABEL to use "case", changes the create-case mutation payload type to "case", maps caseType from c.type in useGetCsmCases, and updates URL filter tests to assert "case" enum values.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • wso2-open-operations/cs-tools#893: Modifies the same BeCaseView/CsmCaseRow types and useGetCsmCases mapping to add workState and related case fields.
  • wso2-open-operations/cs-tools#930: Touches src/api/backend/types.ts and useGetCsmCases for case-type and search/mapping alignment, directly related to this PR's "support""case" rename.
  • wso2-open-operations/cs-tools#938: Backend/OpenAPI counterpart that renames the case type and updates response nullability, aligning with this PR's frontend changes.

Suggested reviewers

  • dilshanfardil
  • cloby99
  • shayanmalinda

Poem

🐰 Hoppin' through the ops with tabs so bright,
Three panels laid out, left and right.
"Support" is gone, now "case" is the key,
The form is ready — just not yet free!
SR_CREATE_ENABLED shall flip someday,
Until then, I nibble my carrots and wait. 🥕

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ⚠️ Warning The description covers the main change, but it misses most required template sections like Purpose, Goals, Approach, Release note, tests, security, and docs. Add the missing template sections and fill in required details for purpose, goals, approach, release note, documentation, tests, security checks, and related links.
✅ Passed checks (3 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title names the main Operations, case-type, and dashboard changes and is specific enough for history scanning.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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.

@rksk rksk added App/CSM Portal Area/Frontend Type/New Feature Represents a request or task for a new feature labels Jun 24, 2026
rksk added 2 commits June 24, 2026 10:39
…ated until BE)

Replace the Operations 'coming soon' placeholder with a real landing:
SR / CR / Incident as tabs. The Service Requests tab has a 'Create
service request' entry point; CR and Incident tabs are 'coming soon'
(no backend yet).

Add a minimal Create-SR form (project, priority [S0-S4], subject,
description). Submission is GATED OFF (SR_CREATE_ENABLED=false): SR has
no create endpoint yet — it's only a case type in the contract and
POST /cases accepts type:'support' only — so the form validates and is
ready to wire (flip the flag + add the mutation) once the BE adds the
SR endpoint and its catalog model. No API call is made meanwhile.
…support->case; nullable CaseView refs)

- Rename case type value 'support' -> 'case' across BeCaseType,
  BeCaseCreatePayload (POST /cases), the case-type filter (caseType.ts:
  label 'Support' -> 'Case'), and CsmCaseCreatePage. Matches the entity
  PR wso2-open-operations#934 rename.
- BeCaseView: add nullable type/engagementType and catalog/catalogItem/
  assignedTeam/conversation EntityRefs; mark deployment/deployedProduct
  nullable.
- BeCaseSearchView: add 'type'; mark deployment/deployedProduct nullable.
  Map it onto the row (caseType: c.type).

Pure contract alignment. NOTE: depends on BE PR wso2-open-operations#938 — merge this after
it, or the cases list/create will send the new 'case' value to a BE that
still expects 'support'.
@rksk rksk changed the title [CSM Portal] Operations tab + Service Request creation (gated until BE) [CSM Portal] Operations tab + SR creation; align FE with BE PR #938 Jun 24, 2026
@rksk
rksk force-pushed the csm-operations-sr branch from b588725 to d3227a6 Compare June 24, 2026 14:29

@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

🤖 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/CreateServiceRequestPage.tsx`:
- Around line 40-44: Update the stale backend contract note in
CreateServiceRequestPage so it matches the current case-type terminology: the
comment currently says POST /cases accepts type "support", but this PR now uses
"case". Edit the inline submission-disabled note near the
CreateServiceRequestPage component to remove the outdated "support" reference
and replace it with the correct "case" wording so future submit wiring follows
the updated contract.
🪄 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: a8e8c11c-07d0-42e1-bba0-b2e848f2ffde

📥 Commits

Reviewing files that changed from the base of the PR and between f115571 and d3227a6.

📒 Files selected for processing (8)
  • 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/pages/CsmCaseCreatePage.tsx
  • apps/csm-portal/webapp/src/features/csm-cases/utils/caseType.ts
  • apps/csm-portal/webapp/src/features/csm-cases/utils/casesFiltersUrl.test.ts
  • apps/csm-portal/webapp/src/features/csm-operations/pages/CreateServiceRequestPage.tsx
  • apps/csm-portal/webapp/src/features/csm-operations/pages/OperationsPage.tsx

@rksk rksk changed the title [CSM Portal] Operations tab + SR creation; align FE with BE PR #938 [CSM Portal] Operations tab + SR creation; align FE with BE #938; stop calling missing /csm/dashboard Jun 25, 2026
@rksk

rksk commented Jun 25, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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/New Feature Represents a request or task for a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants