Skip to content

[CSM Portal] case work-state actions, claim flow, and v2 contract realignment - #2

Closed
rksk wants to merge 1 commit into
csm-case-write-contractfrom
csm-case-workstate-claimflow
Closed

[CSM Portal] case work-state actions, claim flow, and v2 contract realignment#2
rksk wants to merge 1 commit into
csm-case-write-contractfrom
csm-case-workstate-claimflow

Conversation

@rksk

@rksk rksk commented Jun 23, 2026

Copy link
Copy Markdown
Owner

Stacked on top of csm-case-write-contract (upstream PR wso2-open-operations#893). Review/merge wso2-open-operations#893 first; this PR's diff is only the delta on top of it.

Work state + claim flow

  • Surface the work sub-state (ongoing/paused) on the case detail header.
  • Pause/Resume the work sub-state from the action-bar More menu, shown only when the case is in progress and assigned to the current user.
  • Start work on a case (open/waiting → in progress) enforces a single active case:
    1. look up the engineer's other ongoing cases,
    2. move this case to in progress,
    3. no conflict → mark it ongoing; conflict → prompt to pause the other ongoing case(s) and make this one active.
  • Resolve assignee == me from assignedEngineer.email vs the JWT email. The search exposes no assignee/work-state filter, so "my ongoing cases" is narrowed by stateKeys:[work_in_progress] server-side and matched on assignee + workState === "ongoing" client-side (a null work state is never ongoing).

UX

  • Case lifecycle state renders as a solid status chip (shared StateChip), consistent on list + detail; all case-list columns left-aligned.
  • Rename the Administration nav item and page heading to Settings.
  • Cases project filter loads the first page on open and lazy-loads more on scroll (still narrows as you type).
  • Rename the FE correlation header to X-CSM-Correlation-ID to match the gateway-safe backend header.

v2 contract realignment (entity/BFF breaking changes)

  • PATCH /cases/{id}: stateKey / severityKey / workStateKey (was state / priority / workState).
  • Case create: typeKey + severityKey + issueTypeKey.
  • Case search filters: severityKeys (was priorityKeys); dropped unsupported fields.
  • Responses: severity (was priority); added reopened state and case type.

Notes / known limitations

  • Assignee search filter still does not exist on the backend, so the cases-list Assignee filter stays disabled against live, and the claim-flow lookup uses the client-side match above.
  • Work-state writes require the ServiceNow update path to accept workStateKey (now present after the latest entity changes); if a target backend predates that, those PATCHes 400.

Testing

  • pnpm build — green
  • pnpm test — 90 passed
  • pnpm lint — clean

…lignment

Builds on the case-write-contract work with the case work-state lifecycle,
the start-work claim flow, identity-aware gating, list/nav UX polish, and a
realignment of the FE contract layer to the latest entity/BFF changes.

Work state + claim flow
- Surface the work sub-state (ongoing/paused) on the case detail header.
- Pause/Resume the work sub-state from the case action-bar "More" menu,
  shown only when the case is in progress and assigned to the current user.
- Starting work on a case (open/waiting -> in progress) enforces a single
  active case: look up the engineer's other ongoing cases, move this case to
  in progress, then either mark it ongoing (no conflict) or prompt to pause
  the other ongoing case(s) and make this one active.
- Resolve assignee == current user from assignedEngineer.email vs the JWT
  email (the search has no assignee filter, so "my ongoing cases" is found by
  state on the server + assignee/ongoing match on the client; null work state
  is never treated as ongoing).

UX
- Render case lifecycle state as a solid status chip (shared StateChip),
  consistent on the list and detail; left-align all case-list columns.
- Rename the "Administration" nav item and page heading to "Settings".
- Cases project filter loads the first page on open and lazy-loads more on
  scroll (and narrows as you type).
- Rename the FE correlation header to X-CSM-Correlation-ID to match the
  gateway-safe backend header.

v2 contract realignment
- PATCH /cases/{id}: stateKey / severityKey / workStateKey (was state /
  priority / workState).
- Case create: typeKey + severityKey + issueTypeKey.
- Case search filters: severityKeys (was priorityKeys); drop unsupported
  fields. Responses: severity (was priority); add reopened state and case type.
@rksk

rksk commented Jun 23, 2026

Copy link
Copy Markdown
Owner Author

Wrong target. Reopening against v2 on wso2-open-operations/cs-tools.

@rksk rksk closed this Jun 23, 2026
rksk added a commit that referenced this pull request Jun 26, 2026
…pen-operations#957 contract)

Per PR wso2-open-operations#957 the BE now accepts the string `type` enum
(primary_production|staging|qa|stress|uat|development) instead of the old
integer typeKey for both POST /deployments and PATCH /deployments/{id}.

Type payload changes (types.ts):
- BeDeploymentDetailUpdatePayload now includes `type?: BeDeploymentType` and
  uses a never-based discriminated union so deactivate and detail payloads are
  mutually exclusive and type-safe (CodeRabbit CR #1).
- Add BeDeploymentCreatePayload and BeDeploymentCreateResponse for POST /deployments.

EditDeploymentDialog: replace the read-only type chip ("Type changes aren't
available yet") with a Select over all 6 BeDeploymentType values. Type is
included in change detection and sent in the PATCH payload only when changed.
Tests updated accordingly.

CreateDeploymentDialog + useCreateDeployment: new dialog (name, type selector,
description; projectId locked to context) and mutation hook that POST /deployments
and invalidates the project deployment list. "Create deployment" button added
to DeploymentsTab.

DeploymentsTab: close edit/deactivate dialog before surfacing page-level error
alert so the feedback is not hidden behind the modal backdrop (CodeRabbit CR wso2-open-operations#3).

CaseMetaBand: cast deploymentCategory to BeDeploymentType when passing to
DeploymentDetailsDialog — both unions share identical values; the cast removes
the type mismatch without changing runtime behaviour (CodeRabbit CR #2).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant