Skip to content
Calm motion: animations on this site only fade, with no movement

Approval flow ​

The steps of a request, with approvers and their decisions

Shows who must sign off a request, in which order, and what each person decided. If it is the turn of the reader, they can approve or reject. For steps that one person goes through, use the stepper.

Basic

Waiting for: Producer review

  1. Edit is finalApprovedAll must approve
    • Budi SantosoApproved15 Nov, 16:20
  2. Producer reviewWaitingOne approval is enough
    • Ana PutriWaiting
    • Citra DewiWaiting
      “I listen tonight.”
  3. Sponsor checkWaitingAll must approve
    • Sponsor teamWaiting
  • steps is a list of steps in order. Each step has an id, a title, a list of approvers, and a rule.
  • Each approver has a name, and an optional avatar, decision, note, and time. The decision is approved, rejected, or pending.
  • With the rule all (default), every approver must approve. With any, one approval is enough. One rejection rejects the step.
  • The current step is the first step that is not approved. The line at the top says what the flow waits for, or that it is done or stopped.
  • me is the name of the reader. If the reader is a waiting approver of the current step, a note field and the Approve and Reject buttons show. A decision emits decide with the step id, the decision, and the note. Save it, then update steps.
  • Each step and each decision has a mark and a word, so the state does not rest on the color. Change the words with labels or a label pack: title, approved, rejected, pending, approve, reject, note, all, any, done, stopped, and waiting (a function of the step).

Usage ​

ts
import { BlessApprovalFlow } from "blessing-ui";

API ​

Props

NameTypeDefaultDescription
steps*BlessApprovalStep[]—
mestring—the name of the reader: if they are a waiting approver of the current step, they get the buttons
labelsPartial<Record<BlessDecision, string> & { title: string; approve: string; reject: string; note: string; all: string; any: string; done: string; stopped: string; waiting: (step: string) => string; }>—

Events

NamePayloadDescription
decide[stepId: string, decision: "approved" | "rejected", note: string]

Released under the MIT License. Character names and artwork belong to their owners.