Bug 18117

Summary: Convert browser alerts to modals
Product: Koha Reporter: Christopher Brannon <cbrannon>
Component: Architecture, internals, and plumbingAssignee: Galen Charlton <gmcharlt>
Status: RESOLVED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: katrin.fischer, oleonard
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21346
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 21870, 25280, 25281    
Bug Blocks:    

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.
Comment 4 Katrin Fischer 2023-09-10 12:41:03 UTC
(In reply to Owen Leonard from comment #3)
> I would like to keep this open because I have some patches in progress.

Owen, should this still remain open? Linked bugs have been all resolved.
Comment 5 Owen Leonard 2023-09-12 15:33:55 UTC
(In reply to Katrin Fischer from comment #4)
> Owen, should this still remain open? Linked bugs have been all resolved.

I'm not actively working on any more instances of this issue so I think it can be closed.