kit

Destructive action

Built revision v17.10.0

Phoenix
Topics

Human support

Bring a missing role, layout, or state, or a rendering against the standard, to the session working on kit. Name the package and the entry.

On Stepped flow

Destructive action

A Destructive action confirming an Inline consequence.

Oakmere WI booking

Deleting this booking frees Tuesday in the Main Hall and removes its invoice.

Takes effect as soon as you confirm.

A Destructive action last in an Action group.

Return to bookings

A Destructive action that waits.

You can delete the hall once its last booking is over.

A Destructive action leading a Dialog.

Delete the booking

Delete the booking

Oakmere WI booking

Deleting this booking frees Tuesday in the Main Hall and removes its invoice.

Takes effect as soon as you confirm.

A Dialog that asks for the name of work others share before deleting it.

Delete the workspace

Delete the workspace

Northwind

Deleting Northwind removes its projects and files for everyone in it, and cannot be undone.

Takes effect as soon as you confirm.

No name typed

Type Northwind to delete it.

A Destructive action committing a Stepped flow.

  1. CompleteChoose
  2. Confirm

Delete a hirer

Riverside Scouts

Deleting Riverside Scouts removes their bookings and invoices, and cannot be undone.

Takes effect as soon as you confirm.

Back to hirers

Source
<Kit.Phoenix.Roles.DestructiveAction.destructive_action icon="trash">Delete the booking</Kit.Phoenix.Roles.DestructiveAction.destructive_action>
<p class="specimen-case-line">A Destructive action confirming an Inline consequence.</p>
<Kit.Phoenix.Roles.InlineConsequence.inline_consequence aria-label="Delete the Oakmere WI booking">
  <:subject>Oakmere WI booking</:subject>
  <:consequence>Deleting this booking frees Tuesday in the Main Hall and removes its invoice.</:consequence>
  <:effective_time>Takes effect as soon as you confirm.</:effective_time>
  <:correction_path></:correction_path>
  <:action><Kit.Phoenix.Roles.DestructiveAction.destructive_action icon="trash">Delete the booking</Kit.Phoenix.Roles.DestructiveAction.destructive_action></:action>
</Kit.Phoenix.Roles.InlineConsequence.inline_consequence>
<p class="specimen-case-line">A Destructive action last in an Action group.</p>
<Kit.Phoenix.Roles.ActionGroup.action_group>
  <:lead><Kit.Phoenix.Roles.PrimaryAction.primary_action>Save the booking</Kit.Phoenix.Roles.PrimaryAction.primary_action></:lead>
  <:secondary><Kit.Phoenix.Roles.SecondaryAction.secondary_action>Duplicate</Kit.Phoenix.Roles.SecondaryAction.secondary_action></:secondary>
  <:secondary><Kit.Phoenix.Roles.DestructiveAction.destructive_action icon="trash">Delete the booking</Kit.Phoenix.Roles.DestructiveAction.destructive_action></:secondary>
  <:return><Kit.Phoenix.Roles.WayBack.way_back href="#role-destructive-action">Return to bookings</Kit.Phoenix.Roles.WayBack.way_back></:return>
</Kit.Phoenix.Roles.ActionGroup.action_group>
<p class="specimen-case-line">A Destructive action that waits.</p>
<Kit.Phoenix.Roles.ActionGroup.action_group><:secondary action="destructive-action" action_state={Kit.Phoenix.ActionState.inert("delete-hall", "You can delete the hall once its last booking is over.")} icon="trash">Delete the hall</:secondary></Kit.Phoenix.Roles.ActionGroup.action_group>
<p class="specimen-case-line">A Destructive action leading a Dialog.</p>
<details>
  <summary>Delete the booking</summary>
  <Kit.Phoenix.Roles.SecondaryAction.secondary_action id="destructive-booking-dialog-opener">Delete the booking</Kit.Phoenix.Roles.SecondaryAction.secondary_action>
  <Kit.Phoenix.Roles.Dialog.dialog open id="destructive-booking-dialog" return_focus="destructive-booking-dialog-opener" aria-labelledby="destructive-booking-dialog-title">
    <:heading rest={%{id: "destructive-booking-dialog-title"}}>Delete the booking</:heading>
    <Kit.Phoenix.Roles.InlineConsequence.inline_consequence region="consequence" aria-label="Delete the Oakmere WI booking">
      <:subject>Oakmere WI booking</:subject>
      <:consequence>Deleting this booking frees Tuesday in the Main Hall and removes its invoice.</:consequence>
      <:effective_time>Takes effect as soon as you confirm.</:effective_time>
      <:correction_path></:correction_path>
    </Kit.Phoenix.Roles.InlineConsequence.inline_consequence>
    <:destructive_action icon="trash">Delete the booking</:destructive_action>
    <:secondary_action>Keep the booking</:secondary_action>
  </Kit.Phoenix.Roles.Dialog.dialog>
</details>
<p class="specimen-case-line">A Dialog that asks for the name of work others share before deleting it.</p>
<details>
  <summary>Delete the workspace</summary>
  <Kit.Phoenix.Roles.SecondaryAction.secondary_action id="destructive-workspace-dialog-opener">Delete the workspace</Kit.Phoenix.Roles.SecondaryAction.secondary_action>
  <Kit.Phoenix.Roles.Dialog.dialog open id="destructive-workspace-dialog" return_focus="destructive-workspace-dialog-opener" aria-labelledby="destructive-workspace-dialog-title">
    <:heading rest={%{id: "destructive-workspace-dialog-title"}}>Delete the workspace</:heading>
    <:form_groups>
      <Kit.Phoenix.Roles.FormGroup.form_group kind={Kit.Phoenix.Roles.FormGroup.Kind.text(:medium)} id="destructive-workspace-name-form-group" control_rest={%{id: "destructive-workspace-name", name: "name", type: "text"}}><:printed_value>No name typed</:printed_value>
        <:label rest={%{for: "destructive-workspace-name"}}>Workspace name</:label>
      </Kit.Phoenix.Roles.FormGroup.form_group>
    </:form_groups>
    <Kit.Phoenix.Roles.InlineConsequence.inline_consequence region="consequence" aria-label="Delete the Northwind workspace">
      <:subject>Northwind</:subject>
      <:consequence>Deleting Northwind removes its projects and files for everyone in it, and cannot be undone.</:consequence>
      <:effective_time>Takes effect as soon as you confirm.</:effective_time>
      <:correction_path></:correction_path>
    </Kit.Phoenix.Roles.InlineConsequence.inline_consequence>
    <:destructive_action icon="trash" state={Kit.Phoenix.Roles.Dialog.DestructiveState.confirmation("Northwind", "destructive-workspace-delete", "Type Northwind to delete it.")}>Delete the workspace</:destructive_action>
    <:secondary_action>Keep the workspace</:secondary_action>
  </Kit.Phoenix.Roles.Dialog.dialog>
</details>
<p class="specimen-case-line">A Destructive action committing a Stepped flow.</p>
<Kit.Phoenix.Layouts.SteppedFlow.stepped_flow id="role-destructive-action-stepped-flow" subject_state={Kit.Phoenix.State.none()} progress_rest={%{"aria-label": "Deletion progress"}}>
  <:progress name="Choose" state="done" />
  <:progress name="Confirm" state="current" />
  <:current_step id="destructive-step" rest={%{"aria-labelledby": "destructive-step-title"}} heading="Delete a hirer" heading_rest={%{id: "destructive-step-title"}}>
    <Kit.Phoenix.Roles.InlineConsequence.inline_consequence region="consequence" aria-label="Delete Riverside Scouts">
      <:subject>Riverside Scouts</:subject>
      <:consequence>Deleting Riverside Scouts removes their bookings and invoices, and cannot be undone.</:consequence>
      <:effective_time>Takes effect as soon as you confirm.</:effective_time>
      <:correction_path></:correction_path>
    </Kit.Phoenix.Roles.InlineConsequence.inline_consequence>
  </:current_step>
  <:back><Kit.Phoenix.Roles.WayBack.way_back href="#destructive-step-title">Back to hirers</Kit.Phoenix.Roles.WayBack.way_back></:back>
  <:destructive_action icon="trash">Delete the hirer</:destructive_action>
</Kit.Phoenix.Layouts.SteppedFlow.stepped_flow>

Destructive action, submitting

Source
<Kit.Phoenix.Roles.DestructiveAction.destructive_action icon="trash" submitting>Delete the booking</Kit.Phoenix.Roles.DestructiveAction.destructive_action>