From 992ccebbdb4635854ebada9c02e17846b7e82b90 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Thu, 3 Nov 2022 15:55:39 +0000 Subject: [PATCH] Bug 31028: Add feedback to the patron on submission This patch adds a success alert box when a patron submits a concern sucessfully. Signed-off-by: David Nind Signed-off-by: Helen Oliver Signed-off-by: Kyle M Hall Signed-off-by: Tomas Cohen Arazi --- .../bootstrap/en/includes/modals/catalog_concern.inc | 2 +- .../opac-tmpl/bootstrap/js/modals/catalog_concern.js | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/modals/catalog_concern.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/modals/catalog_concern.inc index 5b3d235249..70c5c6dcb8 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/modals/catalog_concern.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/modals/catalog_concern.inc @@ -41,7 +41,7 @@ diff --git a/koha-tmpl/opac-tmpl/bootstrap/js/modals/catalog_concern.js b/koha-tmpl/opac-tmpl/bootstrap/js/modals/catalog_concern.js index f5dab6aa13..817c9dd4a3 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/js/modals/catalog_concern.js +++ b/koha-tmpl/opac-tmpl/bootstrap/js/modals/catalog_concern.js @@ -41,13 +41,23 @@ $(document).ready(function() { reporter_id: reporter_id, }; + $('#concern-submit-spinner').show(); + $('#addConfirm').prop('disabled', true); $.ajax({ url: '/api/v1/public/tickets', type: 'POST', data: JSON.stringify(params), success: function(data) { + $('#concern-submit-spinner').hide(); $('#addConcernModal').modal('hide'); $('#concern_body').val(''); + $('#concern_title').val(''); + $('h1:first').before('
Your concern was sucessfully submitted.
'); + }, + error: function(data) { + $('#concern-submit-spinner').hide(); + $('#addConcernModal').modal('hide'); + $('h1:first').before('
There was an error when submitting your concern, please contact a librarian.
'); }, contentType: "json" }); -- 2.39.5