Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

[60358] Document the two variants of the DangerDialog (#17789)

Henriette Darge7a3e433bcf87
diff --git a/lookbook/docs/patterns/14-danger-dialog.md.erb b/lookbook/docs/patterns/14-danger-dialog.md.erb
index bae3e7beb81..b362ddca941 100644
--- a/lookbook/docs/patterns/14-danger-dialog.md.erb
+++ b/lookbook/docs/patterns/14-danger-dialog.md.erb
@@ -1,8 +1,13 @@
-The DangerDialog is used to get a second layer of confirmation from the user before they execute a potentially breaking, non-reversible action such as deletion.
+The DangerDialog is used to direct the user's attention towards a potentially destructive, non-reversible action such as deletion.
-The dial will inform the user that the action is not reversible and require one additional interaction before the user can confirm the deletion.
+There are two variants:
-The DangerDialog is a sub-component of FeedbackDialog.
+1. **Danger Confirmation** requires an addition interaction from the user (i.e, checking a checkbox) in addition to a visual and text warning before they are able to confirm the action
+2. **Danger Warning** simply presents the user with a visual and text warning before they confirm the action
+
+The dialog aims to reduce cases of accidental deletion that may result from the browser "Are you sure?" confirmation dialog not sufficiently conveying the potential risks of a particular user action.
+
+The DangerDialog is related to the FeedbackDialog, sharing some common behavior.
### Overview
@@ -13,13 +18,20 @@ The DangerDialog is a sub-component of FeedbackDialog.
The FeedbackDialog is a variation of FeedbackDialog. It consists of:
- A red warning icon
-- A heading with a confirmation question such as "Permanently delete?"
+- A title: a short description of the dialog action. This should be written in a neutral tone. The title is currently only used for accessibility purposes. Examples:
+ - "Delete work package"
+ - "Delete project"
+- A heading: a question inviting the user to take a decision, This should be written in an active tone. You may also to give the full descriptive name of the resource on which the action will take place (e.g. "meeting occurrence" rather than just "meeting"). Examples:
+ - "Permanently delete this work package?"
+ - "Cancel this meeting occurrence?"
- A message explaining the consequences
- An additional content slot
-- A confirmation checkbox with text: "I understand that this deletion cannot be reversed"
-- Footer actions: "Cancel" and "Delete permanently" (danger red)
+- (For the Danger Confirmation) A confirmation checkbox with text: "I understand that this deletion cannot be reversed"
+- Footer actions: "Cancel" and "Delete" (danger red)
+
+For the Danger Confirmation, the primary button text is "Delete permanently" and it is disabled until the user checks the confirmation checkbox.
-The "Delete permanently" button is disabled until the user checks the confirmation checkbox.
+The button text can be customized if the dialog action is not a deletion.
The additional content area can be replaced with other options, such as different text, a list of work packages or additional interaction.
@@ -38,7 +50,7 @@ If you need a variant with a different structure, please contact the UX and Fron
#### Do:
-- Do give the user relevant detail possible. For example, when bulk deleting, list the work packages that will be deleted.
+- Do give the user relevant detail possible. For example, when bulk deleting, list the work packages that will be deleted. If the relevant details are too detailed (for example, there are over 10 work packages to be deleted), provide a summary instead of listing all individual items.
- Do use the simplest variant that will do the job, usually the default with customised text tailored to the specific context. Only choose variations or add additional elements if absolutely required.
#### Don't:
@@ -62,12 +74,21 @@ The DangerDialog will replace the traditional Rails danger zone area in at least
- ldap_groups/synchronized_filters: destroy
- ldap_groups/synchronized_groups: destroy
- saml/providers: destroy
+- Deleting a meeting series
-The confirmation dialog should also be used where we are currently using browser dialogs or a non-Primer modal for high-risk operations, such as:
+The DangerDialog should also be used where we are currently using browser dialogs or a non-Primer modal for high-risk operations, such as:
- Bulk deleting work packages
- Deleting a custom field
+The Danger Warning dialog should replace the default browser native "Are you sure?" dialog if the action is destructive and non reversible, for example:
+
+- Deleting work packages
+- Deleting individual meetings (or individual occurrences of a meeting series)
+- Deleting a custom field
+- Deleting a custom action
+- Deleting a wiki
+
### Technical notes
* In order to actually delete some object, you will most likely need a form which the "delete" button then submits. We have two ways to achieve that: