From 00710463905b7a23ad71f9dd92d64e0f3eae8a17 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 28 Feb 2023 11:48:55 +0100 Subject: [PATCH] Bug 32991: Don't remove all messages when confirm box is closed If we cancel the confirmation box we should not clear all the messages Signed-off-by: Jonathan Druart --- .../intranet-tmpl/prog/js/vue/components/Dialog.vue | 9 +++++++-- koha-tmpl/intranet-tmpl/prog/js/vue/stores/main.js | 9 +++++---- 2 files 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 c7b167faf90..bb50be5c8cb 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Dialog.vue +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Dialog.vue @@ -21,7 +21,11 @@ - @@ -52,7 +56,7 @@ export default { is_submitting, is_loading, } = storeToRefs(mainStore) - const { removeMessages } = mainStore + const { removeMessages, removeConfirmationMessages } = mainStore return { message, error, @@ -62,6 +66,7 @@ export default { is_submitting, is_loading, removeMessages, + removeConfirmationMessages, } }, } diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/stores/main.js b/koha-tmpl/intranet-tmpl/prog/js/vue/stores/main.js index 21e04f69eca..6a3f2900323 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/stores/main.js +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/stores/main.js @@ -39,12 +39,9 @@ export const useMainStore = defineStore("main", { if(accept_callback) { this._accept_callback = async () => { await accept_callback() - this.removeMessages() + this.removeConfirmationMessages() } } - this._error = null; - this._warning = null; - this._message = null; this._confirmation = confirmation; this.displayed_already = displayed; /* Is displayed on the current view */ }, @@ -58,6 +55,10 @@ export const useMainStore = defineStore("main", { } this.displayed_already = true; }, + removeConfirmationMessages(){ + this._confirmation = null; + this._accept_callback = null; + }, submitting(){ this._is_submitting = true; }, -- 2.25.1