Provisioning
Plan the DNS changes for a domain, show the customer every create, no-op, and conflict the plan carries, and apply only the operations they approved.
Provision.Flow is the review step on its own: a trigger that plans, then the review dialog.
export function ReviewChanges() {
return <Provision.Flow domain={domain} requirements={requirements} trigger="Review changes" />;
}Usage
export function ReviewChanges() {
return <Provision.Flow domain={domain} requirements={requirements} trigger="Review changes" />;
}What the customer sees
The dialog lists every operation the plan carries: the creates, the records that already match, and the conflicts. Approve authorizes the plan’s digest and applies it in one action; Decline records a refusal that closes the attempt for good.
A partial receipt is a normal outcome, not an error. The outcome line says how many records landed and re-planning turns them into no-ops.
Parts
| Part | Renders |
|---|---|
Provision.Dialog |
The review surface, with a render prop of its own |
Provision.Actions |
Approve and Decline, disabled while a step is running |
Provision.Status |
What the flow is doing right now |
Provision.Outcome |
The receipt, or the failure |
Composing it yourself
/**
* `approve` authorizes the digest and applies it in one action. `reject` records the refusal and
* is terminal. `retry` re-plans when the reason says the old plan is gone and re-runs the failed
* step otherwise.
*/
export function ReviewActions({ domain }: { readonly domain: string }) {
const provisioning = Provision.useController({ domain, requirements });
const state = provisioning.state;
if (state._tag !== "Planned") return null;
return (
<div>
<button onClick={() => provisioning.approve()} type="button">
Approve {state.plan.operations.length} change(s)
</button>
<button onClick={() => provisioning.reject("Not now")} type="button">
Decline
</button>
</div>
);
}