https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383

--- Comment #66 from Tomás Cohen Arazi (tcohen) <[email protected]> ---
Created attachment 209617
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209617&action=edit
Bug 42383: (QA follow-up) Play audio alerts after each check-in

The check-in page marks the latest row with the audio-alert-warning or
audio-alert-success classes, and the confirmation modal with
audio-alert-action, so the default AudioAlerts selectors match them.
But js_includes.inc only looks for the configured selectors and calls
playSound() once, on document ready. The legacy page was reloaded
after every check-in so it played a sound each time; the Vue page
never did.

This patch (QA comment point 6) adds a playAudioAlert() helper to the
check-in page, which repeats the js_includes.inc logic: it walks
window.AUDIO_ALERTS in precedence order and plays the sound of the
first selector found in the page. It is called once the result of each
check-in has been rendered, and when the next pending modal is opened
after resolving one.

The error box displayed for unknown barcodes and failed requests also
gets the audio-alert-warning class, so these produce the warning
sound like on the legacy page.

Test plan:
1. Enable the AudioAlerts system preference
2. On the check-in page, check in:
   - an item that is checked out
   - a barcode that does not exist
   - an item with a hold on it
=> FAIL: No sound is played
3. Apply this patch and rebuild:
   $ ktd --shell
  k$ yarn js:build
  k$ restart_all
4. Repeat step 2 (check items out and place the hold again)
=> SUCCESS: The 'beep' sound plays for the normal check-in
=> SUCCESS: The 'critical' sound plays for the unknown barcode
=> SUCCESS: The 'opening' sound plays when the hold modal opens
5. Disable AudioAlerts and repeat step 2
=> SUCCESS: No sound is played
6. Sign off :-D

Assisted-by: Opus 5.5 (Anthropic)

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to