From 03777e80fc7ab4e5b05ebfa22ba8ca5c8509463c 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit If we cancel the confirmation box we should not clear all the messages Signed-off-by: Jonathan Druart Signed-off-by: Pedro Amorim Signed-off-by: Agustín Moyano Signed-off-by: Tomas Cohen Arazi (cherry picked from commit 8cee1f287d81eb1693c1bde564a0a1b6d85affd2) Signed-off-by: Jacob O'Mara --- .../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 c7b167faf9..bb50be5c8c 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 21e04f69ec..6a3f290032 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.20.1