Bug 18117 - Convert browser alerts to modals
Summary: Convert browser alerts to modals
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Galen Charlton
QA Contact: Testopia
Depends on: 25280 25281 21870
  Show dependency treegraph
Reported: 2017-02-14 21:44 UTC by Christopher Brannon
Modified: 2020-04-24 16:15 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:


Note You need to log in before you can comment on or make changes to this bug.
Description Christopher Brannon 2017-02-14 21:44:40 UTC
With modals becoming more active in Koha, I think we need to move away from alert messages and stick with modals.

Alert messages look different from browser to browser, and you have less/no control over the look and feel of the alert.

Modals would allow for more enhancement, such as color and sound, if someone chose that.

The big concern is consistency.  We lack consistency between alerts and modals, and with alerts between browsers.

I would proposed a stop on use of alert messages, and convert existing uses of alerts to modal.

That's my opinion.  Would like to hear others.
Comment 1 Owen Leonard 2017-02-15 13:08:56 UTC
I think it's important to distinguish between a couple of different situations in which we ask the user for confirmation of an action:

- "Simple" delete confirmations, where we ask
  "Are you sure? Yes/No" -- Usually a JS alert

- Confirmation requests which display more information
  for the user to consider before they confirm. Commonly
  seen in Administration scripts.

The latter of those two seem more suited to conversion to modals, although it would require API work to ensure that the additional information could be pulled via AJAX for display in the modal. For instance: "This library cannot be deleted. Patrons or items are still using it."

Personally I think the ease and speed of a JavaScript alert makes it appropriate for simple delete confirmations. All modal operations come with the added overhead of more code and are slower to operate.

I don't find the visual consistency between browsers to be an issue. I would think people know what their browser's alerts look like and are not concerned that they look different from another browser's alert.

Going forward I think we should keep in mind that the conversion to modals isn't simple template work (for the AJAXy reason above) and without that problem prepared for we'll still be stuck with inconsistency for quite a while.
Comment 2 Christopher Brannon 2018-09-16 05:52:43 UTC
We seem to be moving in this direction.
Comment 3 Owen Leonard 2018-09-16 17:54:23 UTC
I would like to keep this open because I have some patches in progress.