equinor / fmu-editor

5 stars 2 forks source link

[FEATURE] Get user's confirmation before deleting a file #33

Open rubenthoms opened 1 year ago

rubenthoms commented 1 year ago

In the file explorer, users can delete files. However, there is no modal dialog yet making the users confirm the action. In order, to inform the users about the consequences of their desctructive action, this should be implemented.

A general component based on MUI's dialog component could be implemented taking a title, a message and an array of actions, each having a label, a color and a callback function. In addition a default cancel action could be added, triggered when clicking the dialog's cross button. When users choose to delete a file, the dialog component could be fed with an array of two actions, delete and cancel. Delete could have a red background color, cancel the default one. The delete callback function would trigger the deletion of the file, while the other action would not trigger anything. This general dialog component could be very helpful whenever a users confirmation is required.