Skip to content

feat(approvals): pending-approvals inbox with approve / reject#73

Merged
xuyushun441-sys merged 1 commit into
mainfrom
feat/approvals-inbox
Jun 2, 2026
Merged

feat(approvals): pending-approvals inbox with approve / reject#73
xuyushun441-sys merged 1 commit into
mainfrom
feat/approvals-inbox

Conversation

@xuyushun441-sys
Copy link
Copy Markdown
Contributor

Summary

Surfaces the approvals workflow that previously had nav entries but no screen and an unused approve/reject hook — completing the automation suite (actions ✅, flows ✅, state machines ✅, approvals ✅).

Client / UI

  • useApprovals lists the current user's pending sys_approval_request rows.
  • useDecideApproval records the decision on the request row (status → approved/rejected; reject reason appended to the comment), which drops it from the pending inbox.
  • app/approvals/index.tsx — inbox screen: each request shows process / target record / step / submitter comment / time, with Approve (cross-platform confirm) and Reject (required-reason dialog) actions; loading / error / empty states; auto-refetch after a decision.
  • RejectReasonDialog — cross-platform reason prompt; Reject disabled until a reason is entered.
  • More tab gains Automation → Approvals; i18n in en/zh/ar.

Server (apps/server)

  • Add @objectstack/plugin-approvals and register ApprovalsServicePlugin so the dev server registers sys_approval_request (previously "object not registered").

Verification

  • ✅ In-browser against the local 7.5.0 server: the inbox lists a pending request (localized card), Approve confirms → PATCH status=approved → the item leaves the inbox (empty state), and the Reject dialog enforces a reason (button disabled while empty).
  • ✅ New useApprovals + RejectReasonDialog tests; tsc + eslint clean; full suite green (1171 passed).

Note

The decision records status on the request row (and removes it from the pending inbox). Resuming a flow that's blocked on the request is handled server-side by the approval/workflow service when present (the local dev server has no plugin-workflow, and that service exposes no public client route here).

🤖 Generated with Claude Code

Surfaces the approvals workflow that previously had nav entries but no screen
and an unused approve/reject hook.

Client/UI:
- useApprovals: lists the current user's pending `sys_approval_request` rows.
- useDecideApproval: approve/reject records the decision on the request row
  (status → approved/rejected; reject reason appended to the comment), which
  drops it from the pending inbox.
- app/approvals/index.tsx: inbox screen — each request shows process / target
  record / step / submitter comment / time, with Approve (cross-platform
  confirm) and Reject (required-reason dialog) actions; loading / error /
  empty states; auto-refetch after a decision.
- RejectReasonDialog: cross-platform reason prompt; Reject disabled until a
  reason is entered.
- More tab gains "Automation → Approvals"; i18n in en/zh/ar.

Server (apps/server):
- Add @objectstack/plugin-approvals and register ApprovalsServicePlugin so the
  dev server registers sys_approval_request (previously "object not registered").

Verified in-browser against the local 7.5.0 server: the inbox lists a pending
request (localized), Approve confirms then PATCHes status=approved and the item
leaves the inbox (empty state), and the Reject dialog enforces a reason. Adds
useApprovals + RejectReasonDialog tests; typecheck + lint clean; full suite
green (1171 passed).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@xuyushun441-sys xuyushun441-sys merged commit 342dc2d into main Jun 2, 2026
1 of 4 checks passed
@xuyushun441-sys xuyushun441-sys deleted the feat/approvals-inbox branch June 2, 2026 01:09
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.

2 participants