feat(metadata-admin): approval as a flow node, not a standalone designer (ADR-0019)#1422
Merged
Merged
Conversation
…ner (ADR-0019) Aligns the Studio flow designer and the runtime record-approval UI to the ADR-0019 model, where an approval is a Flow node (`type: 'approval'`) rather than a standalone "approval process" metadata type. Designer: - Add `approval` to the flow node-type options + add-node palette (teal UserCheck icon/tone, canvas summary). - Hardcode the Approval node config inspector (approvers / behavior / lockRecord / approvalStatusField / gated escalation) mirroring ApprovalNodeConfigSchema. The published @objectstack/spec predates ADR-0019, so the schema can't be imported yet — the config is declared inline. - Retire the standalone approval-process pieces: delete ApprovalStepInspector and ApprovalPreview, drop their inspector/preview/anchor registrations and the engine.inspector.approvalStep.* i18n keys. Validation: - clientValidation: route `workflow` to StateMachineSchema; make the `flow` validator forward-compatible so the published spec's closed FlowNode.type enum no longer false-flags `approval` / `connector_action` (suppress only the `.type` enum mismatch for those node types; every other field still validates). Runtime UI: - Rewrite useRecordApprovals to the node model: drop submit/recall (those endpoints are gone); read /approvals/requests and let a pending approver approve/reject. RecordDetailView surfaces approve/reject actions only when the current user is a pending approver. Verified live in the Studio dev server: approval node adds to the canvas, the inspector renders, the validation banner clears. tsc clean; 75 tests pass.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
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.
Aligns the Studio flow designer and the runtime record-approval UI to the ADR-0019 model, where an approval is a Flow node (
type: 'approval') rather than a standalone "approval process" metadata type. This is the objectui (frontend) follow-up to framework PRs #1407–#1410.Designer
approvalto the flow node-type options + add-node palette (tealUserCheckicon/tone, canvas summary).approvers/behavior/lockRecord/approvalStatusField/ gatedescalation— mirroringApprovalNodeConfigSchema. The published@objectstack/specpredates ADR-0019 P4, so the schema can't be imported yet; the config is declared inline as a forward-compat shim.ApprovalStepInspectorandApprovalPreview, drop their inspector/preview/anchor registrations and theengine.inspector.approvalStep.*i18n keys.Validation
clientValidation: routeworkflowtoStateMachineSchema; make theflowvalidator forward-compatible so the published spec's closedFlowNode.typeenum no longer false-flagsapproval/connector_action. Only the.typeenum mismatch is suppressed for those node types — every other field still validates.Runtime UI
useRecordApprovalsto the node model: drop submit/recall (those endpoints are gone); read/approvals/requestsand let a pending approver approve/reject.RecordDetailViewsurfaces approve/reject actions only when the current user is a pending approver.Verification
tsc --noEmitclean; 75 tests pass. No new eslint errors (the oneno-emptyerror is pre-existing, unrelated to these hunks).Note on the published spec
Merging the framework branch to
maindoes not republish@objectstack/specto npm, so the forward-compat shim (inline approval config + validation filter) remains necessary until a spec at or beyond the ADR-0019 cut is published. Once that lands, the inline config can be replaced with the importedApprovalNodeConfigSchemaand the validation filter removed.