Module

FPO.UI.Modals.DeleteModal

#deleteConfirmationModal

deleteConfirmationModal :: forall w a action. Translator Labels -> a -> (a -> String) -> action -> (a -> action) -> action -> Maybe RefLabel -> String -> HTML w action

Modal for confirming the deletion of a group.

TODO: This only statically shows the modal whenever the user requests to delete a group. Because of this binary show/hide logic, we can't use fancy features like modal animations (fade-in, etc.). Instead, we could use JSS to toggle the modal visibility, but this would of course require external JavaScript code. See https://getbootstrap.com/docs/5.3/components/modal/.

Requires:

  1. a translator for the UI texts
  2. something to determine what object to delete, like an ID
  3. something to derive a label for the object to delete
  4. an action to cancel the deletion
  5. an action to proceed the deletion
  6. a no-op action as a default do-nothing action
  7. an optional reference label for the delete button
  8. a name for the type of the given object

TODO: As of now, this modal exposes a reference label interface for the delete button. This allows for two things: 1. Focusing the delete button when the modal opens, for fast keyboard interaction (main use case). 2. Just focusing the modal in general, allowing for closing it with "Escape" (secondary use case). We might not want to have the delete button focused by default, but rather just the modal itself. This would allow for closing the modal with "Escape", but would require the user to tab to the delete button before being able to confirm the deletion with "Enter". For this, we can easily just associate the reference label with some other element, like the modal body or footer.

Modules