Background:
To help users explore templates and find the right one for their intended use, we will replace the close button with a back button in the TemplateDialog once a template has been selected from search results (T272354: Add back button to VE TemplateDialog). This only applies when inserting a new template. With this ticket, we will also add a warning message that will warn users about data loss if they have entered data into a selected template.
Requirements
- Implement behind feature flag with T272354: Add back button to VE TemplateDialog and T274263: Add button to delete template in the context menu
- Add warning about data loss when clicking the back button after having added data.
- Use OOUI error state component from OO.ui.ProcessDialog
- Title:"Go back?" Error message: "Going back will remove this template along with any information you have entered, returning you to the template selection window. This action is irreversible."
- Button options: "Cancel" (normal button) and "Remove template." (primary, destructive button)
- When no data has been entered, show no warning.
- Ensure it works on mobile
Mock
For reference, same specs as test instance (with .9 opacity white overlay), just different wording:
Related tickets:
- Prototyping ticket: T260887: Implement unsaved changes warning message