feat(approvals): pending-approvals inbox with approve / reject#73
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
useApprovalslists the current user's pendingsys_approval_requestrows.useDecideApprovalrecords 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.Server (
apps/server)@objectstack/plugin-approvalsand registerApprovalsServicePluginso the dev server registerssys_approval_request(previously "object not registered").Verification
PATCH status=approved→ the item leaves the inbox (empty state), and the Reject dialog enforces a reason (button disabled while empty).useApprovals+RejectReasonDialogtests;tsc+eslintclean; full suite green (1171 passed).Note
The decision records
statuson 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 noplugin-workflow, and that service exposes no public client route here).🤖 Generated with Claude Code