From 59b7cff8bd62e0b503ff0646503fe232c06a4c48 Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Tue, 31 Dec 2024 15:27:18 +0000 Subject: [PATCH] Bug 35604: (QA follow-up): Cosmetic improvements These are improvements to the confirm auto backend stage screen on the Staff UI. Result of a chat with Tomas about this development. Sponsored-by: NHS England Sponsored-by: PTFS Europe Ltd Signed-off-by: David Nind Signed-off-by: Martin Renvoize --- .../prog/en/modules/ill/ill-requests.tt | 3 +- .../intranet-tmpl/prog/js/ill-autobackend.js | 80 +++++++++++++------ 2 files changed, 56 insertions(+), 27 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt index f0954bea6b0..512204500e9 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt @@ -855,8 +855,7 @@
-

Confirm backend:

-

+

diff --git a/koha-tmpl/intranet-tmpl/prog/js/ill-autobackend.js b/koha-tmpl/intranet-tmpl/prog/js/ill-autobackend.js index cfbfa1762a2..04461b15806 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/ill-autobackend.js +++ b/koha-tmpl/intranet-tmpl/prog/js/ill-autobackend.js @@ -86,23 +86,29 @@ $(document).ready(function () { function _addSuccessMessage(auto_backend_name, data) { _removeVerifyingMessage(auto_backend_name); - $(auto_ill_el + " > #backend-" + auto_backend_name).append( - ' ' + - __("Available.").format(auto_backend_name) + - " " + + $( + auto_ill_el + " > #backend-" + auto_backend_name + " #backendcol" + ).append( + '
' + + "" + + __("Available.") + + "
" + data.success + - "" + "
" ); } function _addErrorMessage(auto_backend_name, message) { _removeVerifyingMessage(auto_backend_name); - $(auto_ill_el + " > #backend-" + auto_backend_name).append( - ' ' + - __("Not readily available:").format(auto_backend_name) + - " " + + $( + auto_ill_el + " > #backend-" + auto_backend_name + " #backendcol" + ).append( + '
' + + "" + + __("Not readily available:") + + "
" + message + - "" + "
" ); $( auto_ill_el + @@ -114,24 +120,28 @@ $(document).ready(function () { function _addBackendOption(auto_backend_name) { $(auto_ill_el + " > #backend-" + auto_backend_name).append( - ' ' + - ' " + `` ); } function _addVerifyingMessage(auto_backend_name) { - $(auto_ill_el + " > #backend-" + auto_backend_name).append( - ' ' + - __("Verifying availability...").format(auto_backend_name) + - "" + $( + auto_ill_el + " > #backend-" + auto_backend_name + " #backendcol" + ).append( + '
' + + __("Verifying availability...") + + "
" ); } function _removeVerifyingMessage(auto_backend_name) { @@ -148,7 +158,9 @@ $(document).ready(function () { '#confirmautoill-form #autoillbackends input[id="' + auto_backend_name + '"]' - ).prop("checked", true); + ) + .prop("checked", true) + .trigger("change"); $(auto_ill_message_el).html( __( "The recommended backend for your request is %s." @@ -168,4 +180,22 @@ $(document).ready(function () { ); $(auto_ill_message_el).html(__("Fetching backends availability...")); } + + $("#confirmautoill-form").on( + "change", + 'input[name="backend"]', + function () { + $('input[name="backend"]') + .closest(".list-group-item") + .removeClass("bg-success") + .css({ + "background-color": "", + border: "", + }); + $(this).closest(".list-group-item").css({ + "background-color": "rgba(0, 128, 0, 0.1)", + border: "1px solid rgba(0, 128, 0, 0.7)", + }); + } + ); }); -- 2.39.5