From 96d2d5da9a2fc4591ab1677c9572659a2da103bb Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Tue, 30 Sep 2025 14:21:15 +0000 Subject: [PATCH] Bug 41001: Remove messages when dialog closes, even if not through the close button This ensures that when the dialog is closed, even when clicked outside of it, the messages are correctly removed, same as if the 'close' button had been clicked. Test plan: - create a data ERM provider /cgi-bin/koha/erm/eusage/usage_data_providers/add - dummy data should be sufficient - then go to data providers list /cgi-bin/koha/erm/eusage/usage_data_provider - open web development tools console (F12 firefox) - click on "Run now" - dismiss dialog by clicking outside the modal! - click again on "Run now" - check the logs for errors - any other clicks to create a modal won't work now ("run now", "delete") Apply patch. run yarn js:watch or yarn js:build. Repeat. Signed-off-by: Jan Kissig Signed-off-by: Jonathan Druart Signed-off-by: Laura Escamilla (cherry picked from commit 3908b7bc1cae3623bd2c96af7c9eb35cea154883) Signed-off-by: Baptiste Wojtkowski --- .../prog/js/vue/components/Dialog.vue | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Dialog.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Dialog.vue index 194573d3f8..e8decd1a61 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Dialog.vue +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Dialog.vue @@ -164,9 +164,12 @@ export default { return } nextTick(() => { - $("#warning.modal").modal("show") - }) - }) + $("#warning.modal").on("hidden.bs.modal", function () { + removeMessages(); + }); + $("#warning.modal").modal("show"); + }); + }); watch(confirmation, newConfirmation => { if (!newConfirmation) { @@ -174,9 +177,12 @@ export default { return } nextTick(() => { - $("#confirmation.modal").modal("show") - }) - }) + $("#confirmation.modal").on("hidden.bs.modal", function () { + removeConfirmationMessages(); + }); + $("#confirmation.modal").modal("show"); + }); + }); return { message,