Skip to content

[CSM Portal] stabilize e2e cases-list suite; combine Set Fix ETA dialog; validate call-request case state - #1286

Merged
Rashmika998 merged 5 commits into
wso2-open-operations:mainfrom
rksk:csm-e2e-more-specs
Jul 29, 2026
Merged

Rashmika998 merged 5 commits into
wso2-open-operations:mainfrom
rksk:csm-e2e-more-specs

Conversation

@rksk

@rksk rksk commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Purpose

Describe the problems, issues, or needs driving this feature/fix and include links to related issues in the following format: Resolves issue1, issue2, etc.

Three independent CSM portal fixes/improvements bundled on this branch:

  1. The e2e cases-list spec suite was flaky: a still-loading list was sometimes read as "0 cases" before the first row settled, causing spurious failures on search/filter/sort/pagination assertions; a few other specs (recent-nav, watchers) had similar non-deterministic dependencies.
  2. The "Set Fix ETA" dialog required three separate Save actions (one per date field) with no way to share the ETA with the customer — SN's real "Set Fix ETA" workflow supports posting a customer-visible comment alongside the estimate, which the CSM portal didn't expose at all.
  3. Creating a call request on a case always failed with an unhelpful generic error when the case wasn't in an eligible state (SN only allows scheduling a call while the case is Work In Progress, Awaiting Info, Waiting On WSO2, Solution Proposed, or Reopened) — nothing in the FE explained this before a doomed submit attempt.

Goals

Describe the solutions that this feature/fix will introduce to resolve the problems described above

  1. Make the e2e cases-list suite deterministic: wait for genuine load-settlement before counting rows; self-skip specs whose preconditions can't be deterministically satisfied instead of flaking.
  2. Let a CS engineer set any subset of the three fix-ETA estimates and optionally share them with the customer (with the required Product/Public-ticket context) in a single save.
  3. Prevent a user from attempting to create a call request on a case in a state SN will reject, and tell them why.

Approach

Describe how you are implementing the solutions. Include an animated GIF or screenshot if the change affects the UI (email documentation@wso2.com to review all UI text). Include a link to a Markdown file or Google doc if the feature write-up is too long to paste here.

  1. e2e stabilization: added rowCountSettled() to CasesListPage and used it as the initial-count gate in search/filters/sort/pagination specs. The sort spec now self-skips if the list empties and doesn't repopulate (a backing re-query defect, not an e2e bug). Recent-nav specs (QuickNav, recent-views) are skipped — they depend on a same-tab localStorage write being reflected without a reload, which isn't deterministic. The watchers spec now queries by the signed-in user's email domain (a one-letter query previously matched only empty-email accounts) and self-skips if the picked candidate's watcher chip doesn't render.
  2. Set Fix ETA dialog: collapsed the three independent per-field Save buttons into one combined save. Added a "Share fix ETA with customer" toggle that reveals required Product/Public-ticket fields when enabled. All three ETA dates plus the optional addPublicComment/product/publicTicket fields go out in one combined PATCH /cases/{id} call. No existing e2e spec referenced the old multi-button UI, so no spec changes were needed for this part.
  3. Call-request state validation: added caseAcceptsCallRequests/callRequestCaseStateBlockReason helpers (reusing this codebase's existing case-state label constants). CreateCallRequestDialog disables Save and shows an inline message when the case's current state isn't one of the five SN-allowed states; CallRequestsWidget's trigger button follows the same disabled-with-tooltip pattern already used for a closed case, rather than hiding the action outright.

User stories

Summary of user stories addressed by this change>

  • As a CS engineer running the e2e suite, I want the cases-list specs to pass reliably against real data, not flake on load timing.
  • As a CS engineer setting a fix ETA, I want to share it with the customer in the same action I use to record the internal estimate, without three separate saves.
  • As a CS engineer trying to schedule a call, I want to know immediately if the case's state doesn't allow it, instead of getting a generic error after submitting.

Release note

Brief description of the new feature or bug fix as it will appear in the release notes

  • Fixed flaky e2e coverage for the CSM portal cases list.
  • The Set Fix ETA dialog now supports a single combined save and can optionally share the estimate with the customer.
  • The Create Call Request dialog now warns when a case's state doesn't allow scheduling a call, instead of failing silently on submit.

Documentation

Link(s) to product documentation that addresses the changes of this PR. If no doc impact, enter "N/A" plus brief explanation of why there's no doc impact

N/A — internal CSM-portal-only UI/test changes, no externally published documentation covers this workflow.

Training

Link to the PR for changes to the training content in https://github.com/wso2/WSO2-Training, if applicable

N/A — no training content exists for this internal tool.

Certification

Type "Sent" when you have provided new/updated certification questions, plus four answers for each question (correct answer highlighted in bold), based on this change. Certification questions/answers should be sent to certification@wso2.com and NOT pasted in this PR. If there is no impact on certification exams, type "N/A" and explain why.

N/A — internal tool, not covered by any certification exam.

Marketing

Link to drafts of marketing content that will describe and promote this feature, including product page changes, technical articles, blog posts, videos, etc., if applicable

N/A — internal tool, not customer/market-facing.

Automation tests

  • Unit tests

    Code coverage information

Added/updated unit tests for SetFixEtaDialog (rewritten for the combined-save UI) and callRequestState (3 new focused tests for the state-gating logic). Full pnpm test run: 479 passed / 9 failed, with the 9 failures reproduced identically on the pre-change base commit (CaseActivitiesFeed.test.tsx, CsmAnnouncementsPage.test.tsx, CaseActionBar.test.tsx) — confirmed pre-existing and unrelated to this PR.

  • Integration tests

    Details about the test cases and coverage

e2e: stabilized the existing cases-list Playwright/Cypress specs (see Approach above) — no new e2e scenarios added, existing ones made deterministic.

Security checks

  • Followed secure coding standards in http://wso2.com/technical-reports/wso2-secure-engineering-guidelines? yes
  • Ran FindSecurityBugs plugin and verified report? N/A — TypeScript/React, not a Java target for FindSecurityBugs; ran pnpm lint and tsc/pnpm build clean instead (one pre-existing, unrelated type error in CreateSecurityReportPage.tsx confirmed present on the base branch too).
  • Confirmed that this PR doesn't commit any keys, passwords, tokens, usernames, or other secrets? yes

Samples

Provide high-level details about the samples related to this feature

N/A

Related PRs

List any other related PRs

Builds on cs-tools #1283 (SRA attachments, name display, project filtering, parentCase.type — merged to main), which this branch was based on/rebased against.

Migrations (if applicable)

Describe migration steps and platforms on which migration has been tested

N/A — no data migration involved.

Test environment

List all JDK versions, operating systems, databases, and browser/versions on which this feature/fix was tested

Node/pnpm toolchain per apps/csm-portal/webapp/package.json; unit tests run via vitest; verified against the ServiceNow-backed dev tenant for the call-request state rule and fix-ETA share-comment behavior described above.

Learning

Describe the research phase and any blog posts, patterns, libraries, or add-ons you used to solve the problem.

The call-request state rule and the fix-ETA share-comment behavior were both confirmed by inspecting the ServiceNow scripted API's own validation logic directly (not inferred from documentation), to make sure the FE mirrors the actual backend contract rather than a guess.

Summary by CodeRabbit

  • New Features
    • Set multiple fix ETA estimates in one action.
    • Optionally share fix ETA details with customers, including product and public ticket info.
    • Added case-state guidance and restrictions for creating, scheduling, and rescheduling call requests.
  • Bug Fixes
    • Prevented call-request actions when the case is in an unsupported state (with clear blocking reasons).
    • Improved case-list loading and empty-state handling for more reliable results.
  • Documentation
    • Updated the “Set fix ETA” action description to match the new combined behavior.
  • Tests
    • Refreshed unit and e2e coverage for combined ETA saving, customer sharing rules, call-request restrictions, and settled list row counts.

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: c0654219-44eb-469b-9be8-a0be2307f8c2

📥 Commits

Reviewing files that changed from the base of the PR and between 34f57b3 and 250db1f.

📒 Files selected for processing (1)
  • apps/csm-portal/webapp/tests/e2e/pages/CasesListPage.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/csm-portal/webapp/tests/e2e/pages/CasesListPage.ts

📝 Walkthrough

Walkthrough

The PR consolidates fix ETA updates into one PATCH payload, adds case-state gating for call-request creation and scheduling, and stabilizes case-management end-to-end tests against loading delays and nondeterministic browser storage behavior.

Changes

Combined fix ETA submission

Layer / File(s) Summary
Combined fix ETA contract and save flow
apps/csm-portal/webapp/src/api/backend/types.ts, apps/csm-portal/webapp/src/features/csm-cases/components/SetFixEtaDialog.tsx, apps/csm-portal/webapp/src/features/csm-cases/pages/CsmCaseDetailPage.tsx, apps/csm-portal/webapp/src/features/csm-cases/components/CaseActionBar.tsx
Fix ETA values and optional customer-comment fields are submitted together through a single PATCH payload.
Combined save validation coverage
apps/csm-portal/webapp/src/features/csm-cases/components/SetFixEtaDialog.test.tsx
Tests cover combined ETA payloads, sharing-field validation, and disabled Save states.

Call-request case-state gating

Layer / File(s) Summary
Case-state permission rules
apps/csm-portal/webapp/src/features/csm-cases/utils/callRequestState.ts, apps/csm-portal/webapp/src/features/csm-cases/utils/callRequestState.test.ts
Allowed case states, blocking reasons, and undefined-state behavior are defined and tested.
Widget and dialog enforcement
apps/csm-portal/webapp/src/features/csm-cases/components/CallRequestsWidget.tsx, apps/csm-portal/webapp/src/features/csm-cases/components/CreateCallRequestDialog.tsx, apps/csm-portal/webapp/src/features/csm-cases/components/ScheduleCallDialog.tsx, apps/csm-portal/webapp/src/features/csm-cases/pages/CsmCaseDetailPage.tsx
The widget and dialogs receive case-state information, block unsupported actions, and display blocking reasons.

End-to-end test stabilization

Layer / File(s) Summary
Settled case-list assertions
apps/csm-portal/webapp/tests/e2e/pages/CasesListPage.ts, apps/csm-portal/webapp/tests/e2e/specs/cases/list.spec.ts
Case-list tests wait for settled row data and tolerate delayed resorting.
Watcher and recent-navigation resilience
apps/csm-portal/webapp/tests/e2e/specs/cases/detail-lifecycle.spec.ts, apps/csm-portal/webapp/tests/e2e/specs/shell/recent.spec.ts
Watcher search uses a derived query, while nondeterministic scenarios self-skip.

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

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant SetFixEtaDialog
  participant CsmCaseDetailPage
  participant CasesAPI
  User->>SetFixEtaDialog: enter ETA and sharing fields
  SetFixEtaDialog->>CsmCaseDetailPage: submit combined payload
  CsmCaseDetailPage->>CasesAPI: PATCH case with ETA fields
  CasesAPI-->>CsmCaseDetailPage: update result
Loading
sequenceDiagram
  participant CsmCaseDetailPage
  participant CallRequestsWidget
  participant CreateCallRequestDialog
  participant callRequestState
  CsmCaseDetailPage->>CallRequestsWidget: pass caseState
  CallRequestsWidget->>callRequestState: evaluate creation state
  callRequestState-->>CallRequestsWidget: block reason or allowed
  CallRequestsWidget->>CreateCallRequestDialog: open only when allowed
  CreateCallRequestDialog->>callRequestState: validate submission state
Loading

Possibly related PRs

Suggested labels: Type/Bug

Suggested reviewers: cloby99

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly captures the three main changes: e2e stabilization, combined Set Fix ETA, and call-request state validation.
Description check ✅ Passed The description follows the template and includes substantive content for each required section, with only minor optional fields left generic.
Docstring Coverage ✅ Passed Docstring coverage is 80.00% which is sufficient. The required threshold is 80.00%.
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 added 2 commits July 29, 2026 13:54
…efect paths

- CasesListPage: add rowCountSettled() — wait for the first row (or a genuine
  empty result) before counting, so a still-loading list isn't read as empty.
- cases list: use rowCountSettled() for the initial count in search/filters/
  sort/pagination (these were spuriously skipping as "0 cases" on a populated
  tenant). Sort now self-skips when the list empties and does not repopulate
  (a backing sort re-query defect), rather than hanging.
- recent-nav: skip the QuickNav and recent-views tests — both depend on the
  localStorage recent-views hook reflecting a same-tab write without a reload,
  which it does not do deterministically.
- watchers: query by the signed-in user's email domain (a one-letter query
  matched only empty-email accounts and skipped); self-skip if the picked
  candidate's watcher chip does not appear, instead of hard-failing.
@rksk
rksk force-pushed the csm-e2e-more-specs branch from 2a734b3 to f7f595b Compare July 29, 2026 08:27
@rksk rksk changed the title [CSM Portal] e2e: stabilize cases-list loads; self-skip flaky/known-defect paths [CSM Portal] stabilize e2e cases-list suite; combine Set Fix ETA dialog into one save Jul 29, 2026
The data source only accepts scheduling a call while the case is in one
of 5 states (Work in progress, Awaiting info, Waiting on WSO2, Solution
proposed, Reopened); any other state was silently rejected with a
generic "Invalid request payload." error only after submit. Add an
FE-side gate that surfaces the reason up front and disables both the
"Create call request" trigger and the dialog's submit action when the
case is in a disallowed state, re-derived live so it tracks the case's
current state rather than a snapshot taken when the dialog opened.
@rksk rksk changed the title [CSM Portal] stabilize e2e cases-list suite; combine Set Fix ETA dialog into one save [CSM Portal] stabilize e2e cases-list suite; combine Set Fix ETA dialog; validate call-request case state Jul 29, 2026

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
apps/csm-portal/webapp/src/features/csm-cases/pages/CsmCaseDetailPage.tsx (1)

1344-1358: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Dialog stays open after a successful combined save, hiding the success banner.

With one combined save there's no reason to keep the dialog mounted; the "Fix ETA updated." feedback renders on the page behind the modal, so the engineer sees no confirmation and may click Save again. Other single-shot dialogs here (autoclose hold, add tag) close in onSuccess.

🐛 Proposed fix
       patchCase.mutate(patch as BeCaseUpdatePayload, {
         onSuccess: () => {
+          setFixEtaOpen(false);
           setFeedback({
             message: "Fix ETA updated.",
🤖 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 1344 - 1358, Update the onSuccess handler in onSetFixEta to close
the Fix ETA dialog before or alongside setting the success feedback, matching
the autoclose hold and add-tag save behavior; preserve the existing success
message and error handling.
🧹 Nitpick comments (4)
apps/csm-portal/webapp/tests/e2e/specs/shell/recent.spec.ts (1)

133-141: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Track the unconditional skips for removal.

Both scenarios are skipped on every run, so QuickNav and recent-view regressions are no longer detected. Add a linked issue/owner or expiry and restore the assertions once same-tab reactivity is fixed.

Also applies to: 165-166

🤖 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/tests/e2e/specs/shell/recent.spec.ts` around lines 133
- 141, Track the unconditional skips in the QuickNav and recently-viewed
scenarios by adding a linked issue or owner and an explicit expiry, then restore
both assertions once the same-tab reactivity described around useRecentViews is
fixed. Update the test.skip cases at “recent nav — QuickNav search + navigate”
and the corresponding recently-viewed scenario so they cannot remain
indefinitely skipped without ownership or a removal target.
apps/csm-portal/webapp/src/features/csm-cases/components/SetFixEtaDialog.test.tsx (1)

125-151: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Consider covering the isSaving state.

The suite exercises validation and payload shape well, but nothing asserts that Save is disabled/loading and the fields are disabled while isSaving is true — the main way a double PATCH could slip in given the dialog stays open after save.

🤖 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/SetFixEtaDialog.test.tsx`
around lines 125 - 151, Extend the SetFixEtaDialog tests to render with isSaving
set to true and assert that the Save control is disabled or shows its loading
state, while the editable sharing fields such as product and public ticket are
disabled. Verify the dialog prevents another save submission during this state.
apps/csm-portal/webapp/src/api/backend/types.ts (1)

619-644: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick win

Combined variant accepts {}, so the "at least one estimate" rule is no longer compile-time enforced.

Every member of the new variant is optional, so an empty object (and { addPublicComment: true } alone) type-checks even though the doc block right above says at least one estimate must be present and that the contract is "enforced at compile time, not just in docs". A three-way required-one union keeps that guarantee.

♻️ Sketch: require at least one estimate
-  | (Omit<
-      BeCaseUpdateNever,
-      | "bestCaseFixEta"
-      | "mostLikelyFixEta"
-      | "worstCaseFixEta"
-      | "addPublicComment"
-      | "product"
-      | "publicTicket"
-    > & {
-      bestCaseFixEta?: string;
-      mostLikelyFixEta?: string;
-      worstCaseFixEta?: string;
-      addPublicComment?: boolean;
-      product?: string;
-      publicTicket?: string;
-    });
+  | (Omit<
+      BeCaseUpdateNever,
+      | "bestCaseFixEta"
+      | "mostLikelyFixEta"
+      | "worstCaseFixEta"
+      | "addPublicComment"
+      | "product"
+      | "publicTicket"
+    > &
+      BeCaseFixEtaEstimates & {
+        addPublicComment?: boolean;
+        product?: string;
+        publicTicket?: string;
+      });

with, above the union:

type BeCaseFixEtaEstimates =
  | { bestCaseFixEta: string; mostLikelyFixEta?: string; worstCaseFixEta?: string }
  | { bestCaseFixEta?: string; mostLikelyFixEta: string; worstCaseFixEta?: string }
  | { bestCaseFixEta?: string; mostLikelyFixEta?: string; worstCaseFixEta: string };
🤖 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/api/backend/types.ts` around lines 619 - 644,
Update the combined variant in the BeCaseUpdate type to require at least one
fix-ETA estimate at compile time. Define a three-way BeCaseFixEtaEstimates union
where each branch requires one of bestCaseFixEta, mostLikelyFixEta, or
worstCaseFixEta while keeping the other two optional, then intersect it with the
existing optional addPublicComment, product, and publicTicket fields.
apps/csm-portal/webapp/src/features/csm-cases/components/SetFixEtaDialog.tsx (1)

36-44: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Consider deriving this payload type from the backend contract.

FixEtaSavePayload restates the combined fix-ETA fields already declared in BeCaseUpdatePayload, and the caller in apps/csm-portal/webapp/src/features/csm-cases/pages/CsmCaseDetailPage.tsx (Line 1346) has to cast with as BeCaseUpdatePayload, which suppresses any future drift between the two shapes. Extracting the combined variant's field set in types.ts and reusing it here removes both the duplication and the cast.

🤖 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/SetFixEtaDialog.tsx`
around lines 36 - 44, The FixEtaSavePayload shape duplicates fields from
BeCaseUpdatePayload and requires an unsafe cast at the caller. Extract the
shared combined fix-ETA field set in types.ts, derive or reuse it for
FixEtaSavePayload, and update CsmCaseDetailPage to pass the payload without
casting to BeCaseUpdatePayload.
🤖 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/components/CallRequestsWidget.tsx`:
- Around line 108-118: Extend the stateBlockReason restriction beyond create
flows to scheduling and rescheduling: pass stateBlockReason into
ScheduleCallDialog so it displays the reason and disables submission, and update
handleSchedule to defensively reject the scheduled-state PATCH when a block
reason exists. Preserve the existing schedule/reschedule behavior when no block
reason is present.

In
`@apps/csm-portal/webapp/src/features/csm-cases/components/SetFixEtaDialog.tsx`:
- Around line 96-103: The clearable picker configuration in SetFixEtaDialog
conflicts with handleSave’s truthy-only payload construction, so cleared
estimates are not persisted. Remove clearable behavior from the picker field
slotProps (including the corresponding picker configuration around the second
estimate field), preserving the existing prefilled values and save flow.

In `@apps/csm-portal/webapp/tests/e2e/pages/CasesListPage.ts`:
- Around line 231-238: Update CasesListPage.rowCountSettled so a
rows().first().waitFor timeout is not treated as an empty list. Wait for either
a row or the page’s established empty-state/loading-complete signal, return the
count only after one terminal state is reached, and propagate or fail on timeout
when neither state occurs.

In `@apps/csm-portal/webapp/tests/e2e/specs/cases/detail-lifecycle.spec.ts`:
- Around line 352-356: Update the watcherChip wait flow in the added check to
catch only the expected 10-second visible-state timeout and return false for
that case; inspect the caught error and rethrow unexpected failures such as
closed pages, contexts, or invalid locators instead of silently treating them as
an absent chip.

---

Outside diff comments:
In `@apps/csm-portal/webapp/src/features/csm-cases/pages/CsmCaseDetailPage.tsx`:
- Around line 1344-1358: Update the onSuccess handler in onSetFixEta to close
the Fix ETA dialog before or alongside setting the success feedback, matching
the autoclose hold and add-tag save behavior; preserve the existing success
message and error handling.

---

Nitpick comments:
In `@apps/csm-portal/webapp/src/api/backend/types.ts`:
- Around line 619-644: Update the combined variant in the BeCaseUpdate type to
require at least one fix-ETA estimate at compile time. Define a three-way
BeCaseFixEtaEstimates union where each branch requires one of bestCaseFixEta,
mostLikelyFixEta, or worstCaseFixEta while keeping the other two optional, then
intersect it with the existing optional addPublicComment, product, and
publicTicket fields.

In
`@apps/csm-portal/webapp/src/features/csm-cases/components/SetFixEtaDialog.test.tsx`:
- Around line 125-151: Extend the SetFixEtaDialog tests to render with isSaving
set to true and assert that the Save control is disabled or shows its loading
state, while the editable sharing fields such as product and public ticket are
disabled. Verify the dialog prevents another save submission during this state.

In
`@apps/csm-portal/webapp/src/features/csm-cases/components/SetFixEtaDialog.tsx`:
- Around line 36-44: The FixEtaSavePayload shape duplicates fields from
BeCaseUpdatePayload and requires an unsafe cast at the caller. Extract the
shared combined fix-ETA field set in types.ts, derive or reuse it for
FixEtaSavePayload, and update CsmCaseDetailPage to pass the payload without
casting to BeCaseUpdatePayload.

In `@apps/csm-portal/webapp/tests/e2e/specs/shell/recent.spec.ts`:
- Around line 133-141: Track the unconditional skips in the QuickNav and
recently-viewed scenarios by adding a linked issue or owner and an explicit
expiry, then restore both assertions once the same-tab reactivity described
around useRecentViews is fixed. Update the test.skip cases at “recent nav —
QuickNav search + navigate” and the corresponding recently-viewed scenario so
they cannot remain indefinitely skipped without ownership or a removal target.
🪄 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 Plus

Run ID: 5842db14-29d4-4c7d-9290-9dbd2476aeff

📥 Commits

Reviewing files that changed from the base of the PR and between f0010f4 and 0b0623a.

📒 Files selected for processing (13)
  • apps/csm-portal/webapp/src/api/backend/types.ts
  • apps/csm-portal/webapp/src/features/csm-cases/components/CallRequestsWidget.tsx
  • apps/csm-portal/webapp/src/features/csm-cases/components/CaseActionBar.tsx
  • apps/csm-portal/webapp/src/features/csm-cases/components/CreateCallRequestDialog.tsx
  • apps/csm-portal/webapp/src/features/csm-cases/components/SetFixEtaDialog.test.tsx
  • apps/csm-portal/webapp/src/features/csm-cases/components/SetFixEtaDialog.tsx
  • apps/csm-portal/webapp/src/features/csm-cases/pages/CsmCaseDetailPage.tsx
  • apps/csm-portal/webapp/src/features/csm-cases/utils/callRequestState.test.ts
  • apps/csm-portal/webapp/src/features/csm-cases/utils/callRequestState.ts
  • apps/csm-portal/webapp/tests/e2e/pages/CasesListPage.ts
  • apps/csm-portal/webapp/tests/e2e/specs/cases/detail-lifecycle.spec.ts
  • apps/csm-portal/webapp/tests/e2e/specs/cases/list.spec.ts
  • apps/csm-portal/webapp/tests/e2e/specs/shell/recent.spec.ts

Comment thread apps/csm-portal/webapp/tests/e2e/pages/CasesListPage.ts Outdated
Comment thread apps/csm-portal/webapp/tests/e2e/specs/cases/detail-lifecycle.spec.ts Outdated
… case state, drop misleading clearable ETA pickers, fix e2e row-count/watcher-chip error handling

- ScheduleCallDialog now accepts stateBlockReason and displays/disables
  submit on it; CallRequestsWidget passes it through and defensively
  rejects handleSchedule when the case is in a non-eligible state, mirroring
  the create-call-request gate.
- SetFixEtaDialog's date pickers drop the clearable slot prop: the PATCH
  contract has no way to null out a single ETA field, so clearing one
  silently left the old value in place upstream. Removing the affordance
  avoids the misleading UI state.
- CasesListPage.rowCountSettled() now races the first row against the
  list's own empty-state message instead of treating any wait timeout as
  "empty"; if neither signal appears before the timeout it throws instead
  of silently returning 0, so callers can't mistake a slow-loading list for
  a confirmed empty result.
- detail-lifecycle.spec.ts's watcher-chip self-skip now only swallows
  Playwright's TimeoutError; any other failure (closed page/context, broken
  locator, etc.) rethrows instead of being downgraded to a skip.
@rksk

rksk commented Jul 29, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai resume

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Reviews resumed.

@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/tests/e2e/pages/CasesListPage.ts`:
- Around line 241-252: Update CasesListPage.rowCountSettled to await the row and
empty-state visibility checks with Promise.race so it resolves immediately when
either settled signal appears. Preserve the boolean outcomes needed to determine
which signal won, and throw only after both signals fail to appear within
timeoutMs.
🪄 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 Plus

Run ID: e9e2247e-c64f-4733-90c9-8642bcdcca98

📥 Commits

Reviewing files that changed from the base of the PR and between 0b0623a and 34f57b3.

📒 Files selected for processing (5)
  • apps/csm-portal/webapp/src/features/csm-cases/components/CallRequestsWidget.tsx
  • apps/csm-portal/webapp/src/features/csm-cases/components/ScheduleCallDialog.tsx
  • apps/csm-portal/webapp/src/features/csm-cases/components/SetFixEtaDialog.tsx
  • apps/csm-portal/webapp/tests/e2e/pages/CasesListPage.ts
  • apps/csm-portal/webapp/tests/e2e/specs/cases/detail-lifecycle.spec.ts
💤 Files with no reviewable changes (1)
  • apps/csm-portal/webapp/src/features/csm-cases/components/SetFixEtaDialog.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/csm-portal/webapp/tests/e2e/specs/cases/detail-lifecycle.spec.ts

Comment thread apps/csm-portal/webapp/tests/e2e/pages/CasesListPage.ts
… Promise.all

Promise.all waited for both waitFor calls to settle, so a fast row still
blocked for the full timeoutMs on the empty-state branch. Race them instead
and only fall back to awaiting both if the race's first settlement was a
rejection.
@rksk

rksk commented Jul 29, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai resume

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Reviews resumed.

@Rashmika998
Rashmika998 merged commit f478ed9 into wso2-open-operations:main Jul 29, 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