Warn before canceling work item creation
Summary
When working with the Create Work Item modal, users can input quite a bit of information prior to save. Clicking outside the modal causes the modal to close, which can be frustrating mid-edit.
Using the dropdowns in the sidebar, which can extend outside of the modal body, increase the chance of an "outside" click, and users also expect to be able to click outside these dropdowns to close/apply the values.
As a complex form, rather than a simple dialog, we should always require a more explicit action to leave the editing experience.
Proposal
When using "Cancel", if any data has been entered prompt the user with a modal to confirm. This should mirror the comment experience with text "Are you sure you want to cancel creating this [type]?" and options "Continue editing" and "Discard changes".
Behavior flow:
-
In the create modal, if the user didn't add any data
- If they click
cancelthe create modal closes - If they click outside the modal it closes
- If they click
-
In the create modal, if the user adds data
- If they click
cancelwe show the discard confirmation modal; on confirmation close the modal and clear draft - If they click outside the modal we do not show the discard confirmation modal
- If they click
-
In the full page create form, if the user didn't add any data
- If they click
cancelthe user is redirected to the type-specific list page (e.g. from/epics/new->/epics)
- If they click
-
In the full page create form, if the user adds data
- If they click
cancelwe show the discard confirmation modal; on confirmation redirect to list page and clear draft
- If they click