Skip to content

approvals: sys_approval_request.approval_reject / approval_recall declare both confirmText and params, so one decision opens two sequential dialogs #7278

Description

@yinlianghui

Out-of-scope finding from objectui#3055 (record page now runs these declared actions). Filed per PD #10unassigned, ungraded.

Fact

The shared console action runner chains confirmation then param collection, both awaited, in packages/core/src/actions/ActionRunner.ts of the objectui repo:

  • :794-806confirmTextconfirmHandler(...), cancel aborts;
  • :809-832 — immediately after, actionParams / a params array → paramCollectionHandler(...), a second dialog.

packages/plugins/plugin-approvals/src/sys-approval-request.object.ts declares both keys on two actions:

action line confirmText params
approval_reject :277-296 "Reject this request? A rejection is final for every approver." comment, attachments
approval_recall :370-384 "Recall this request? Approvers can no longer act on it…" comment

So rejecting is: confirm prompt → Continue → another dialog the approver did not ask for → Confirm. Nothing is sent until the second one.

Why this is the producer's to decide, not the consumer's

objectui#3126 hit exactly this shape on the record page's hand-written reject button and removed confirmText there, keeping the question as the param dialog's description — "the param dialog IS the confirmation: it is titled by this label, carries the confirm question as its description, and nothing is sent until its own Confirm." That reasoning was applied to console code because the buttons were console code.

objectui#3055 retires those hand-written buttons in favour of these declared actions, so the record page now inherits the declared shape — and the approvals inbox has had it all along. The fix belongs in the declaration, not in a consumer special-case: a console that stripped confirmText when params are present would be deciding a metadata author's intent for them, and would do it for every object, not just this one.

Worth noting the two dialogs are not cosmetic on a decision surface: the first one already reads as "the action is running", which is what made objectui#3126's version read as a silent no-op.

Suggested fix (left to triage, not self-selected)

  1. Drop confirmText from both actions and carry the question as the param dialog's description (mirrors objectui#3126's ruling for the same wording on the same decision);
  2. keep confirmText and drop the params from these two (loses the reject comment + attachments — almost certainly wrong);
  3. rule that confirm-then-collect is intended for irreversible decisions and leave both.

Leaning 1: one condition, one wording, one dialog — and the approver is already being asked to confirm, in a dialog titled by the action.

Dedup

Searched open issues in this repo for approval_reject confirmText param dialog: no hits. objectui#3126 is the same question decided for the retired console-side copy, i.e. the precedent, not a duplicate.

Refs: objectui#3055, objectui#3126, objectui#2678.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions