alan-turing-institute / AssurancePlatform

Project to facilitate creation of Assurance Cases
MIT License
17 stars 6 forks source link

[Bug] Add new modal for when a new element has unsaved changes. #513

Open chrisdburr opened 1 week ago

chrisdburr commented 1 week ago

Currently, two modals exist to warn users about a) unsaved changes during editing and b) deletion of elements.

However, there is also the risk of adding text to a new element, clicking away from the side pane, and the text being lost.

For consistency, we should have a modal that also alerts users to possible unsaved changes when navigating away from the side pane when a new element is being created.

This should only show if there is information in the element description. If no text has been added the alert should not be displayed.

The text from the other modal can be reused:

Are you sure? You have changes that have not been updated. Would you like to discard these changes?

Yes, discard changes! No, keep editing.

RichGriff commented 2 days ago

See branch 513-modal-unsaved-changes

This contains the fix for this as well as various other related issues such as copy correction and resetting the edit sheet when moving away and selecting another element.

RichGriff commented 2 days ago

In staging - @chrisdburr please review