Skip to content

[CSM Portal Microapp] Add Operations page: Service Requests, Change Requests, Incidents - #1144

Merged
Rashmika998 merged 2 commits into
wso2-open-operations:dev-app-csm-portalfrom
2003dinijay:feature/microapp-navigation
Jul 14, 2026
Merged

Rashmika998 merged 2 commits into
wso2-open-operations:dev-app-csm-portalfrom
2003dinijay:feature/microapp-navigation

Conversation

@2003dinijay

@2003dinijay 2003dinijay commented Jul 14, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Adds the Operations page (previously a "Coming soon" placeholder) with three tabs, mirroring the webapp's own Operations feature:
    • Service Requests — reuses the Support page's own case-list/pagination/filter infrastructure, scoped to type: service_request. Severity is dropped (case-type-only, matches the webapp's CsmIssuesView behavior when locked to a non-case type); Work state is kept, disabled until "Work in progress" is selected (also matches the webapp).
    • Change Requests — new end-to-end feature: search/list with a filter sheet (state, impact, closed-date range) mirroring the Support page's own filter-sheet pattern, an infinite-scroll list, a detail page (Overview / Approval / Details & plans), and an edit dialog limited to exactly the 3 fields the backend allows (plannedStartOn, isCustomerApproved, isCustomerReviewed).
    • Incidents — stays a placeholder; confirmed no backend endpoint exists for it anywhere (this repo's openapi.yaml or the webapp's own IssuesListUnavailable).
  • Includes a getAllCases hasMore fallback fix (derives hasMore from offset/total when the search response omits it, mirroring the same fix already in adminUsers.ts's searchUsers) — needed for the Service Requests list to paginate past the first page.
  • "Create service request" and "Create change request" are deliberately out of scope for this PR — each is its own large form (cascading project/deployment/catalog selects with dynamic variables, or a 15+ field change-request form).

Test plan

  • tsc --noEmit clean
  • eslint clean
  • vite build clean
  • Verified the committed changes build standalone in isolation (staged-only snapshot, apart from unrelated in-progress work on the same branch)
  • Manual verification in the simulator: Service Requests list/filters, Change Requests list/filters/detail/edit

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added Operations tabs for Service Requests, Change Requests, and Incidents.
    • Added searchable, filterable service-request and change-request lists with infinite scrolling.
    • Added change-request detail pages with state, impact, planning information, and editable fields.
    • Added loading, empty, error, retry, and skeleton states for operations views.
  • Bug Fixes
    • Improved pagination handling when result counts omit continuation details.

Copilot AI review requested due to automatic review settings July 14, 2026 09:22

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Jul 14, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@2003dinijay, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 33 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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

How do review 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 refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 2d3b7c8f-bcc0-4c12-905b-ea60311fbc4a

📥 Commits

Reviewing files that changed from the base of the PR and between 48a4c4f and 26f3718.

📒 Files selected for processing (18)
  • apps/csm-portal/microapp/src/App.tsx
  • apps/csm-portal/microapp/src/components/case-detail/SectionCard.tsx
  • apps/csm-portal/microapp/src/components/operations/ChangeRequestCard.tsx
  • apps/csm-portal/microapp/src/components/operations/ChangeRequestsFiltersSheet.tsx
  • apps/csm-portal/microapp/src/components/operations/ChangeRequestsTab.tsx
  • apps/csm-portal/microapp/src/components/operations/EditChangeRequestDialog.tsx
  • apps/csm-portal/microapp/src/components/operations/ServiceRequestsFiltersSheet.tsx
  • apps/csm-portal/microapp/src/components/operations/ServiceRequestsTab.tsx
  • apps/csm-portal/microapp/src/components/operations/changeRequestFilters.ts
  • apps/csm-portal/microapp/src/components/operations/config.ts
  • apps/csm-portal/microapp/src/config/endpoints.ts
  • apps/csm-portal/microapp/src/pages/ChangeRequestDetailPage.tsx
  • apps/csm-portal/microapp/src/pages/OperationsPage.tsx
  • apps/csm-portal/microapp/src/services/cases.ts
  • apps/csm-portal/microapp/src/services/changeRequests.ts
  • apps/csm-portal/microapp/src/types/changeRequest.dto.ts
  • apps/csm-portal/microapp/src/types/changeRequest.model.ts
  • apps/csm-portal/microapp/src/types/index.ts
📝 Walkthrough

Walkthrough

The operations page now provides service-request and change-request tabs, with search, filtering, infinite loading, cards, detail routing, and error recovery. Change requests also have typed API models, detail rendering, and editing for planned start and customer approval/review fields.

Changes

Operations experience

Layer / File(s) Summary
Change-request contracts and API foundation
apps/csm-portal/microapp/src/types/changeRequest.*, apps/csm-portal/microapp/src/services/changeRequests.ts, apps/csm-portal/microapp/src/config/endpoints.ts, apps/csm-portal/microapp/src/components/operations/config.ts, apps/csm-portal/microapp/src/components/operations/changeRequestFilters.ts
Adds typed DTOs and view models, endpoint helpers, state/impact mappings, filter conversion, and React Query search, detail, and patch operations.
Service-request operations tab
apps/csm-portal/microapp/src/components/operations/ServiceRequests*.tsx, apps/csm-portal/microapp/src/services/cases.ts
Adds service-request tabs, filters, debounced search, active-filter chips, infinite scrolling, loading and retry states, plus pagination fallback handling.
Change-request list and filters
apps/csm-portal/microapp/src/components/operations/ChangeRequest*.tsx
Adds change-request cards, skeletons, search, state/impact/date filters, active-filter removal, infinite loading, empty states, and query error recovery.
Change-request detail and editing
apps/csm-portal/microapp/src/pages/ChangeRequestDetailPage.tsx, apps/csm-portal/microapp/src/components/operations/EditChangeRequestDialog.tsx, apps/csm-portal/microapp/src/components/case-detail/SectionCard.tsx
Adds detail loading and error states, overview and plan sections, and PATCH editing for planned start, customer approval, and customer review fields.
Operations tabs and detail routing
apps/csm-portal/microapp/src/pages/OperationsPage.tsx, apps/csm-portal/microapp/src/App.tsx
Replaces the operations placeholder with three tabs and registers the change-request detail route.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Operator
  participant OperationsPage
  participant ChangeRequestsTab
  participant changeRequests
  participant ChangeRequestDetailPage
  Operator->>OperationsPage: select Change Requests
  OperationsPage->>ChangeRequestsTab: render list
  ChangeRequestsTab->>changeRequests: search and load pages
  changeRequests-->>ChangeRequestsTab: return change-request summaries
  Operator->>ChangeRequestsTab: select a change request
  ChangeRequestsTab->>ChangeRequestDetailPage: navigate with id
  ChangeRequestDetailPage->>changeRequests: fetch detail
  changeRequests-->>ChangeRequestDetailPage: return change-request details
Loading

Possibly related PRs

Suggested labels: Type/New Feature, Platform/Web, Area/Frontend

Suggested reviewers: copilot, cloby99, rashmika998

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description only includes Summary and Test plan; most required template sections like Purpose, Goals, Approach, Release note, and Security checks are missing. Expand the PR description to fill the required template sections, especially Purpose, Goals, Approach, User stories, Release note, Documentation, tests, and security checks.
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the main change: adding the Operations page with Service Requests, Change Requests, and Incidents.
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.
✨ 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.

…equests, Incidents placeholder

Mirrors the webapp's Operations feature: Service Requests reuses the Support
page's own case-list/filter infra scoped to type=service_request (severity
dropped, work state kept — matches the webapp's CsmIssuesView behavior when
locked to a non-case type); Change Requests gets its own list/filters/detail/
edit end-to-end; Incidents stays a placeholder since no backend endpoint
exists for it anywhere. Also includes the getAllCases hasMore fallback fix
(mirrors the same fix already applied to adminUsers.ts's searchUsers), needed
for the Service Requests list to paginate past the first page.
@2003dinijay
2003dinijay force-pushed the feature/microapp-navigation branch from 48a4c4f to 66abd31 Compare July 14, 2026 09:24

@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: 2

🧹 Nitpick comments (2)
apps/csm-portal/microapp/src/components/operations/changeRequestFilters.ts (2)

35-42: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Count the closed date range as a single filter.

A date range (start and/or end dates) is typically perceived by users as one logical filter. You can consolidate the count to make the UI filter badge more intuitive.

💡 Proposed refactor
 export function countActiveCRFilters(filters: ChangeRequestFilters): number {
   return (
     (filters.states.length > 0 ? 1 : 0) +
     (filters.impacts.length > 0 ? 1 : 0) +
-    (filters.closedStartDate ? 1 : 0) +
-    (filters.closedEndDate ? 1 : 0)
+    (filters.closedStartDate || filters.closedEndDate ? 1 : 0)
   );
 }
🤖 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/microapp/src/components/operations/changeRequestFilters.ts`
around lines 35 - 42, Update countActiveCRFilters to count closedStartDate and
closedEndDate together as one logical closed-date filter: return 1 when either
date is set, rather than adding separate counts for each. Preserve the existing
state and impact filter counts.

44-51: 🎯 Functional Correctness | 🔵 Trivial | 💤 Low value

Trim the search query to prevent sending whitespace-only queries.

If the search string only contains whitespace, search.length > 0 evaluates to true, sending a useless query to the backend. Trimming the string ensures that only meaningful queries are included in the payload.

💡 Proposed refactor
 export function toChangeRequestSearchFilters(
   search: string,
   filters: ChangeRequestFilters,
 ): ChangeRequestSearchPayloadDto["filters"] {
+  const trimmedSearch = search.trim();
   return {
-    ...(search.length > 0 && { searchQuery: search }),
+    ...(trimmedSearch.length > 0 && { searchQuery: trimmedSearch }),
     ...(filters.states.length > 0 && { states: filters.states }),
     ...(filters.impacts.length > 0 && { impacts: filters.impacts }),
🤖 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/microapp/src/components/operations/changeRequestFilters.ts`
around lines 44 - 51, Update toChangeRequestSearchFilters to trim the search
value before checking whether it is non-empty and assigning searchQuery, so
whitespace-only input is omitted while meaningful queries are sent in trimmed
form.
🤖 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/microapp/src/components/operations/EditChangeRequestDialog.tsx`:
- Around line 46-58: The handleSave payload in EditChangeRequestDialog must
preserve a cleared planned start instead of dropping it. Update the
plannedStartOn condition to submit an explicit null when plannedStartChanged and
plannedStart is absent, while continuing to format and submit the selected date
when present.

In `@apps/csm-portal/microapp/src/services/changeRequests.ts`:
- Line 49: Update the hasMore calculation in the change-request pagination flow
to require items.length > 0 in addition to the existing total/offset comparison.
This must stop further fetching whenever the API returns an empty changeRequests
page, even if data.total is stale or exceeds data.offset.

---

Nitpick comments:
In `@apps/csm-portal/microapp/src/components/operations/changeRequestFilters.ts`:
- Around line 35-42: Update countActiveCRFilters to count closedStartDate and
closedEndDate together as one logical closed-date filter: return 1 when either
date is set, rather than adding separate counts for each. Preserve the existing
state and impact filter counts.
- Around line 44-51: Update toChangeRequestSearchFilters to trim the search
value before checking whether it is non-empty and assigning searchQuery, so
whitespace-only input is omitted while meaningful queries are sent in trimmed
form.
🪄 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: c3ad3d91-aa5a-4cf3-9184-8a2f3aa6a86a

📥 Commits

Reviewing files that changed from the base of the PR and between 02c5926 and 48a4c4f.

📒 Files selected for processing (18)
  • apps/csm-portal/microapp/src/App.tsx
  • apps/csm-portal/microapp/src/components/case-detail/SectionCard.tsx
  • apps/csm-portal/microapp/src/components/operations/ChangeRequestCard.tsx
  • apps/csm-portal/microapp/src/components/operations/ChangeRequestsFiltersSheet.tsx
  • apps/csm-portal/microapp/src/components/operations/ChangeRequestsTab.tsx
  • apps/csm-portal/microapp/src/components/operations/EditChangeRequestDialog.tsx
  • apps/csm-portal/microapp/src/components/operations/ServiceRequestsFiltersSheet.tsx
  • apps/csm-portal/microapp/src/components/operations/ServiceRequestsTab.tsx
  • apps/csm-portal/microapp/src/components/operations/changeRequestFilters.ts
  • apps/csm-portal/microapp/src/components/operations/config.ts
  • apps/csm-portal/microapp/src/config/endpoints.ts
  • apps/csm-portal/microapp/src/pages/ChangeRequestDetailPage.tsx
  • apps/csm-portal/microapp/src/pages/OperationsPage.tsx
  • apps/csm-portal/microapp/src/services/cases.ts
  • apps/csm-portal/microapp/src/services/changeRequests.ts
  • apps/csm-portal/microapp/src/types/changeRequest.dto.ts
  • apps/csm-portal/microapp/src/types/changeRequest.model.ts
  • apps/csm-portal/microapp/src/types/index.ts

Comment thread apps/csm-portal/microapp/src/services/changeRequests.ts Outdated
… pagination in Change Requests

Clearing Planned start in the edit dialog silently omitted plannedStartOn
from the PATCH payload instead of sending null, since the omission-guard
required plannedStart to be truthy. Also guard hasMore against an empty
page reporting more results are available when the backend's total is
stale/inconsistent.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants