Skip to content

[CSM Portal] case detail: SLA tab - #1052

Merged
rksk merged 9 commits into
wso2-open-operations:dev-app-csm-portalfrom
rksk:csm-sla-fe
Jul 6, 2026
Merged

[CSM Portal] case detail: SLA tab#1052
rksk merged 9 commits into
wso2-open-operations:dev-app-csm-portalfrom
rksk:csm-sla-fe

Conversation

@rksk

@rksk rksk commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Purpose

Internal CS engineers viewing a case have no way to see the case's SLAs (the response/resolution/workaround clocks). This adds a case-detail SLA tab that lists them. Tracked on the internal delivery board (no public issue).

Goals

Show each SLA record for a case — definition, target, stage, business time left, business elapsed time, elapsed %, and start/stop times — so a CS engineer can gauge SLA status at a glance.

Approach

Webapp-only. The SLA tab renders a CaseSlaTable fed by a lazy query:

  • useGetCsmCaseSlas(caseId, {enabled})POST /slas/search with { filters: { taskIds: [caseId] }, pagination: { limit: 100, offset: 0 } }, loaded only when the SLA tab is open, with refresh.
  • caseSlaMapping.ts (pure, unit-tested) maps each TaskSlaView → the table's row model: definition ← slaDefinition.name, target ← slaDefinition.target, normalized stage (+ a humanized stageLabel, since the endpoint sends no label), businessTimeLeftLabel/businessElapsedLabel, numeric businessElapsedPercent, startTime, stopTime ← endTime. hasBreached is derived as businessElapsedPercent >= 100 — a UI proxy, since the authoritative breach flag isn't exposed upstream yet (documented inline).
  • CaseSlaTable — MUI table: definition, target, colored stage chip (hasBreached forces error), business time left/elapsed, elapsed %, start/stop times in the viewer's timezone; loading/empty/error states + refresh.
  • The SLA tab is enabled, and the dead, never-populated 3-clock SLA scaffolding this replaces was removed (list/dashboard SLA fields untouched).

UI screenshot omitted deliberately to avoid embedding real customer/user data.

User stories

As a CS engineer, I want to see a case's SLA status on the case page so I can gauge response/resolution progress at a glance.

Release note

Case detail now has an SLA tab listing the case's SLA records (definition, target, stage, business time left/elapsed, elapsed %, start/stop times).

Documentation

N/A — internal CS-engineer portal; no external product documentation impact.

Training

N/A. ## Certification
N/A. ## Marketing
N/A.

Automation tests

  • Unit tests

    caseSlaMapping.test.ts (stage normalization incl. achievedcompleted and unknown-stage fallback; hasBreached derivation; null-safety) and CaseSlaTable.test.tsx (loading/empty/populated/error+retry/inactive). pnpm build/lint/test at the repo baseline; all 12 new tests pass.

  • Integration tests

    End-to-end deferred until the BFF passthrough ([CSM Portal] BFF: /slas passthrough endpoints #1051), the entity-service task-SLA endpoints ([Customer Entity] Add task SLA endpoints  #1048), and their upstream resources are available.

Security checks

Samples

N/A

Related PRs

Migrations (if applicable)

N/A — no schema or data migration.

Test environment

macOS; Node + pnpm; Chrome.

Learning

Reused the case-detail feature's existing query/table conventions; kept the SLA table UI unchanged and isolated the wire-format mapping in a pure, testable module.

Summary by CodeRabbit

  • New Features

    • Added a new SLA table on case detail pages with loading, empty-state, error, retry, and refresh support.
    • SLA data now shows clearer status labels, timing details, progress, and last refreshed time.
    • The SLA tab is now available in case details.
  • Bug Fixes

    • Removed outdated SLA countdown and banner displays from the case header for a cleaner, more consistent view.

Add a case-detail SLA tab that lists the case's SLA records, consuming the
task-SLA search endpoint (POST /task-slas/search filtered by the case id).
A CaseSlaTable (definition, target, colored stage chip, business time
left/elapsed, elapsed %, start/stop times in the viewer's timezone;
loading/empty/error + refresh) renders the mapped rows. Stage label is
derived from the stage value and hasBreached from the elapsed percentage
(the authoritative flag isn't exposed upstream yet). Removes the dead,
never-populated 3-clock SLA scaffolding this replaces (list/dashboard SLA
fields untouched).
@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

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

Next review available in: 50 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: cc87c847-c313-450e-ab3c-2873e139238d

📥 Commits

Reviewing files that changed from the base of the PR and between 90a0201 and 110edae.

📒 Files selected for processing (3)
  • apps/csm-portal/webapp/src/features/csm-cases/api/useGetCsmCaseSlas.ts
  • apps/csm-portal/webapp/src/features/csm-cases/components/CaseSlaTable.test.tsx
  • apps/csm-portal/webapp/src/features/csm-cases/components/CaseSlaTable.tsx
📝 Walkthrough

Walkthrough

This PR replaces the CSM case SLA clock flow with task-SLA types, mapping, fetching, and table rendering. It also enables the SLA tab and removes the old SLA clock chip, banner, and timeline widgets.

Changes

SLA Model and UI Replacement

Layer / File(s) Summary
New SLA types and query key
apps/csm-portal/webapp/src/constants/apiConstants.ts, apps/csm-portal/webapp/src/features/csm-cases/types/csmCases.ts
Adds CSM_CASE_SLAS; replaces SLA clock types with task-SLA and case-SLA models; removes slaClocks from CsmCaseDetail.
Task-SLA mapping utility
apps/csm-portal/webapp/src/features/csm-cases/utils/caseSlaMapping.ts, apps/csm-portal/webapp/src/features/csm-cases/utils/caseSlaMapping.test.ts
Adds normalizeStage() and toCaseSla() with tests for stage normalization and row mapping.
useGetCsmCaseSlas fetch hook
apps/csm-portal/webapp/src/features/csm-cases/api/useGetCsmCaseSlas.ts
Adds the case SLA React Query hook that POSTs /slas/search, maps results, and returns { caseId, count, slas }.
CaseSlaTable component
apps/csm-portal/webapp/src/features/csm-cases/components/CaseSlaTable.tsx, apps/csm-portal/webapp/src/features/csm-cases/components/CaseSlaTable.test.tsx
Adds the SLA table UI with loading, error, empty, and populated states, plus refresh handling and tests.
Remove SLA clock widgets and wire up new table
apps/csm-portal/webapp/src/features/csm-cases/pages/CsmCaseDetailPage.tsx, apps/csm-portal/webapp/src/features/csm-cases/components/CaseDetailWidgets.tsx, apps/csm-portal/webapp/src/features/csm-cases/api/useGetCsmCaseDetail.ts, apps/csm-portal/webapp/src/features/csm-cases/components/CaseActionBar.test.tsx, apps/csm-portal/webapp/src/features/csm-dashboard/utils/abtDashboard.ts
Removes SLA clock references, breach helpers, timeline widgets, chip/banner logic, and slaClocks placeholders; enables the SLA tab and renders CaseSlaTable.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant CaseSlaTable
  participant useGetCsmCaseSlas
  participant API

  CaseSlaTable->>useGetCsmCaseSlas: call with caseId
  useGetCsmCaseSlas->>API: POST /slas/search with taskIds and pagination
  API-->>useGetCsmCaseSlas: res.slas
  useGetCsmCaseSlas-->>CaseSlaTable: { caseId, count, slas }
  CaseSlaTable->>CaseSlaTable: render rows and status
Loading

Suggested labels: Type/New Feature

Suggested reviewers: cloby99

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately reflects the main change: adding an SLA tab to case detail.
Description check ✅ Passed The description covers the required sections and is mostly complete, with only minor formatting gaps.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

@rksk
rksk changed the base branch from v2 to dev-app-csm-portal July 6, 2026 06:15
@rksk

rksk commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai resume

@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Reviews resumed.

rksk added 2 commits July 6, 2026 13:29
The task-SLA search response now returns businessElapsedPercentage as a number
(was a string). Type it as number|null, use it directly in the mapping, and
derive hasBreached from the numeric value (no more parse). Fixtures updated.
Match the renamed entity/BFF route (was /task-slas/search).

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

🧹 Nitpick comments (4)
apps/csm-portal/webapp/src/features/csm-cases/utils/caseSlaMapping.ts (1)

46-63: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Widen SlaStage to admit unknown backend values. normalizeStage() can still return an unmapped string, so CaseSla.stage should reflect that instead of relying on an unsafe cast. CaseSlaTable.tsx already falls back to the raw label and a default chip color, but widening the type keeps future exhaustive logic honest.

🤖 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/webapp/src/features/csm-cases/utils/caseSlaMapping.ts` around
lines 46 - 63, `normalizeStage()` can return backend values that are not part of
the current `SlaStage` union, so `CaseSla.stage` is typed too narrowly and
depends on an unsafe cast. Widen `SlaStage` in the `caseSlaMapping` types to
allow unknown string values while preserving the existing known-stage mapping
logic in `normalizeStage()`. Update any related `CaseSla` typing and keep
`CaseSlaTable.tsx` using its raw-label/default-chip fallback so future
exhaustive handling stays type-safe.
apps/csm-portal/webapp/src/features/csm-cases/components/CaseSlaTable.tsx (2)

88-89: 🎯 Functional Correctness | 🔵 Trivial

Total count vs. rendered rows can diverge.

useGetCsmCaseSlas fetches a single page (TASK_SLA_PAGE_LIMIT, offset 0) but returns the server's full total as count. If a case has more SLA records than the page limit, the "{count} total" chip would overstate what's actually rendered, with no pagination affordance to see the rest. Likely a rare edge case given typical SLA record counts, but worth a quick sanity check on TASK_SLA_PAGE_LIMIT sizing.

Also applies to: 199-199

🤖 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/webapp/src/features/csm-cases/components/CaseSlaTable.tsx`
around lines 88 - 89, The `count` derived in `useGetCsmCaseSlas` can overstate
the number of rendered rows because the query only fetches one page
(`TASK_SLA_PAGE_LIMIT` with offset 0) while using the server’s total. Update
`CaseSlaTable` so the displayed total matches the actual loaded `slas` length
unless full pagination is added, and apply the same fix wherever the count is
shown in the related SLA summary/chip rendering.

34-35: 📐 Maintainability & Code Quality | 🔵 Trivial

Cross-feature import for formatRelativeTime.

Importing a formatting helper from @features/csm-dashboard/utils/abtDashboard into the csm-cases feature couples the two feature modules. Consider moving formatRelativeTime to a shared @utils location alongside formatAbsoluteForUser.

🤖 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/webapp/src/features/csm-cases/components/CaseSlaTable.tsx`
around lines 34 - 35, The `CaseSlaTable` import of `formatRelativeTime` is
coupling `csm-cases` to `csm-dashboard`. Move `formatRelativeTime` out of
`@features/csm-dashboard/utils/abtDashboard` into a shared `@utils` module,
ideally alongside `formatAbsoluteForUser`, then update `CaseSlaTable` to import
both helpers from the shared location. Keep the feature module free of
cross-feature utility dependencies.
apps/csm-portal/webapp/src/features/csm-cases/pages/CsmCaseDetailPage.tsx (1)

1210-1211: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

active prop is always true here — the lazy-gate does nothing.

CaseSlaTable only ever mounts when activeTab === "sla", so active={activeTab === "sla"} always evaluates to true at this call site. The laziness is already achieved by the conditional mount; the enabled/active plumbing in CaseSlaTable/useGetCsmCaseSlas (designed to keep the component mounted and toggle fetching) is dead weight here, and it makes the active={false} scenario tested in CaseSlaTable.test.tsx unreachable in production.

Either drop the active prop and call useGetCsmCaseSlas(caseId) unconditionally inside CaseSlaTable (since mount-gating already provides the laziness), or keep the table permanently mounted (hidden via sx={{ display: activeTab === "sla" ? "block" : "none" }}) so the active toggle is meaningful.

♻️ Simplify by relying on mount-based laziness
-      {activeTab === "sla" &&
-        caseId && <CaseSlaTable caseId={caseId} active={activeTab === "sla"} />}
+      {activeTab === "sla" && caseId && <CaseSlaTable caseId={caseId} />}
🤖 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/webapp/src/features/csm-cases/pages/CsmCaseDetailPage.tsx`
around lines 1210 - 1211, The `CaseSlaTable` call site in `CsmCaseDetailPage`
makes the `active` prop redundant because the component only mounts when
`activeTab === "sla"`, so the lazy-gate never changes behavior. Simplify by
either removing the `active` prop and letting `CaseSlaTable`/`useGetCsmCaseSlas`
fetch on mount, or by keeping `CaseSlaTable` mounted across tabs and hiding it
with styling so `active` can actually toggle. Update the related `CaseSlaTable`
and `useGetCsmCaseSlas` plumbing consistently with the chosen approach.
🤖 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.

Nitpick comments:
In `@apps/csm-portal/webapp/src/features/csm-cases/components/CaseSlaTable.tsx`:
- Around line 88-89: The `count` derived in `useGetCsmCaseSlas` can overstate
the number of rendered rows because the query only fetches one page
(`TASK_SLA_PAGE_LIMIT` with offset 0) while using the server’s total. Update
`CaseSlaTable` so the displayed total matches the actual loaded `slas` length
unless full pagination is added, and apply the same fix wherever the count is
shown in the related SLA summary/chip rendering.
- Around line 34-35: The `CaseSlaTable` import of `formatRelativeTime` is
coupling `csm-cases` to `csm-dashboard`. Move `formatRelativeTime` out of
`@features/csm-dashboard/utils/abtDashboard` into a shared `@utils` module,
ideally alongside `formatAbsoluteForUser`, then update `CaseSlaTable` to import
both helpers from the shared location. Keep the feature module free of
cross-feature utility dependencies.

In `@apps/csm-portal/webapp/src/features/csm-cases/pages/CsmCaseDetailPage.tsx`:
- Around line 1210-1211: The `CaseSlaTable` call site in `CsmCaseDetailPage`
makes the `active` prop redundant because the component only mounts when
`activeTab === "sla"`, so the lazy-gate never changes behavior. Simplify by
either removing the `active` prop and letting `CaseSlaTable`/`useGetCsmCaseSlas`
fetch on mount, or by keeping `CaseSlaTable` mounted across tabs and hiding it
with styling so `active` can actually toggle. Update the related `CaseSlaTable`
and `useGetCsmCaseSlas` plumbing consistently with the chosen approach.

In `@apps/csm-portal/webapp/src/features/csm-cases/utils/caseSlaMapping.ts`:
- Around line 46-63: `normalizeStage()` can return backend values that are not
part of the current `SlaStage` union, so `CaseSla.stage` is typed too narrowly
and depends on an unsafe cast. Widen `SlaStage` in the `caseSlaMapping` types to
allow unknown string values while preserving the existing known-stage mapping
logic in `normalizeStage()`. Update any related `CaseSla` typing and keep
`CaseSlaTable.tsx` using its raw-label/default-chip fallback so future
exhaustive handling stays type-safe.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 7725660f-9718-44b5-82a4-fd6bb630c019

📥 Commits

Reviewing files that changed from the base of the PR and between f1aa164 and b4261ed.

📒 Files selected for processing (12)
  • apps/csm-portal/webapp/src/constants/apiConstants.ts
  • apps/csm-portal/webapp/src/features/csm-cases/api/useGetCsmCaseDetail.ts
  • apps/csm-portal/webapp/src/features/csm-cases/api/useGetCsmCaseSlas.ts
  • apps/csm-portal/webapp/src/features/csm-cases/components/CaseActionBar.test.tsx
  • apps/csm-portal/webapp/src/features/csm-cases/components/CaseDetailWidgets.tsx
  • apps/csm-portal/webapp/src/features/csm-cases/components/CaseSlaTable.test.tsx
  • apps/csm-portal/webapp/src/features/csm-cases/components/CaseSlaTable.tsx
  • apps/csm-portal/webapp/src/features/csm-cases/pages/CsmCaseDetailPage.tsx
  • apps/csm-portal/webapp/src/features/csm-cases/types/csmCases.ts
  • apps/csm-portal/webapp/src/features/csm-cases/utils/caseSlaMapping.test.ts
  • apps/csm-portal/webapp/src/features/csm-cases/utils/caseSlaMapping.ts
  • apps/csm-portal/webapp/src/features/csm-dashboard/utils/abtDashboard.ts
💤 Files with no reviewable changes (3)
  • apps/csm-portal/webapp/src/features/csm-cases/components/CaseActionBar.test.tsx
  • apps/csm-portal/webapp/src/features/csm-cases/components/CaseDetailWidgets.tsx
  • apps/csm-portal/webapp/src/features/csm-dashboard/utils/abtDashboard.ts

- Widen SlaStage to an open enum (known literals + string) and key the
  label/color maps off a KnownSlaStage subset, removing the unsafe cast for
  unmapped backend stages.
- Use the rendered row count for the header (was the response total, which
  could diverge from the shown page).
- Drop the always-true 'active' prop on CaseSlaTable; the conditional mount
  already gates the lazy fetch. Removed the now-unreachable inactive test.
@rksk

rksk commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

Addressed 3 of the 4 nitpicks in f721cf6:

  • Widen SlaStage to an open enum (known literals + string); label/color maps now key off a KnownSlaStage subset, so an unmapped backend stage no longer needs an unsafe cast.
  • Count from rendered rows — the header count now uses the returned rows instead of the response total (they could diverge).
  • Dropped the always-true active prop on CaseSlaTable; the conditional mount already gates the lazy fetch, and removed the now-unreachable inactive test.

Skipping the 4th (cross-feature formatRelativeTime import): it is a pre-existing shared time helper already imported cross-feature elsewhere (RelativeTime.tsx); relocating it to a shared util is a repo-wide cleanup better done separately.

rksk added 4 commits July 6, 2026 14:15
The task-SLA search response wraps results under "slas" (not "taskSlas").
Match the BE/entity contract (cs-tools wso2-open-operations#1054): TaskSlaSearchResponse.slas and
read res.slas in the hook.
The task-SLA search endpoint rejects a page size over 50 ("Limit cannot
exceed 50"). Request limit 50 (was 100), which covers a case's SLA count.
Add a determinate LinearProgress in the Business time left column, filled by
the elapsed % (clamped 0-100) and colored by breach/threshold (error when
breached or >=100%, warning >=75%, else success), with the time-left label
beneath it.

@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

🧹 Nitpick comments (1)
apps/csm-portal/webapp/src/features/csm-cases/components/CaseSlaTable.test.tsx (1)

56-94: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Consider adding a test for the header refresh button.

Coverage exercises loading, empty, populated, and error/retry states, but there's no assertion that clicking the header IconButton (aria-label "Refresh SLAs") calls refetch, only the error-state retry button is covered.

✅ Suggested additional test
+  it("refresh button triggers refetch", () => {
+    const refetch = vi.fn();
+    const list: CaseSlaList = { caseId: "case-1", count: 1, slas: [SLA_ROW] };
+    mockResult({ data: list, refetch });
+    render(<CaseSlaTable caseId="case-1" />);
+    fireEvent.click(screen.getByRole("button", { name: /refresh slas/i }));
+    expect(refetch).toHaveBeenCalled();
+  });
🤖 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/webapp/src/features/csm-cases/components/CaseSlaTable.test.tsx`
around lines 56 - 94, Add a test in CaseSlaTable.test.tsx to cover the header
IconButton with aria-label "Refresh SLAs" and verify it calls the query refetch
function. Reuse the existing mockResult setup and the CaseSlaTable render path,
but assert the refresh button behavior independently from the error-state retry
button so the component’s header action is covered.
🤖 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/api/useGetCsmCaseSlas.ts`:
- Line 27: The SLA search hook is hiding backend results by always capping
`/slas/search` at 50 and returning `count: slas.length`, which can underreport
totals in the SLA chip and silently drop rows. Update `useGetCsmCaseSlas` to use
the backend `TaskSlaSearchResponse.total` as the source of truth, and expose a
separate rendered/loaded count from the fetched page size. If more than 50 SLAs
can exist, add pagination or a load-more flow so `count`, `total`, and the table
contents stay consistent.

---

Nitpick comments:
In
`@apps/csm-portal/webapp/src/features/csm-cases/components/CaseSlaTable.test.tsx`:
- Around line 56-94: Add a test in CaseSlaTable.test.tsx to cover the header
IconButton with aria-label "Refresh SLAs" and verify it calls the query refetch
function. Reuse the existing mockResult setup and the CaseSlaTable render path,
but assert the refresh button behavior independently from the error-state retry
button so the component’s header action is covered.
🪄 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: 179fe13f-380f-4ded-8c9f-c61572a0740a

📥 Commits

Reviewing files that changed from the base of the PR and between b4261ed and 90a0201.

📒 Files selected for processing (7)
  • apps/csm-portal/webapp/src/constants/apiConstants.ts
  • apps/csm-portal/webapp/src/features/csm-cases/api/useGetCsmCaseSlas.ts
  • apps/csm-portal/webapp/src/features/csm-cases/components/CaseSlaTable.test.tsx
  • apps/csm-portal/webapp/src/features/csm-cases/components/CaseSlaTable.tsx
  • apps/csm-portal/webapp/src/features/csm-cases/pages/CsmCaseDetailPage.tsx
  • apps/csm-portal/webapp/src/features/csm-cases/types/csmCases.ts
  • apps/csm-portal/webapp/src/features/csm-cases/utils/caseSlaMapping.ts
🚧 Files skipped from review as they are similar to previous changes (4)
  • apps/csm-portal/webapp/src/constants/apiConstants.ts
  • apps/csm-portal/webapp/src/features/csm-cases/utils/caseSlaMapping.ts
  • apps/csm-portal/webapp/src/features/csm-cases/types/csmCases.ts
  • apps/csm-portal/webapp/src/features/csm-cases/pages/CsmCaseDetailPage.tsx

The header count now uses the search response 'total' (not the fetched page
size), so it doesn't underreport when a case has more than the 50-row page.
When fewer rows are shown than the total, a 'Showing first N of M' caption
makes the truncation explicit. Adds a header-refresh-button test.
@rksk
rksk merged commit c479cd2 into wso2-open-operations:dev-app-csm-portal Jul 6, 2026
1 check passed
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.

2 participants