From 671d1bef664fe1ae47623e259efb9e87972f0481 Mon Sep 17 00:00:00 2001 From: Pedro Amorim <pedro.amorim@ptfs-europe.com> Date: Fri, 24 Feb 2023 17:10:03 +0000 Subject: [PATCH] Bug 32991: accept is a callback, rename accept to accept_callback --- .../prog/js/vue/components/Dialog.vue | 8 ++++---- .../intranet-tmpl/prog/js/vue/stores/main.js | 18 +++++++++--------- 2 files changed, 13 insertions(+), 13 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 85ce4bd2e7..45aa8f4661 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Dialog.vue +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Dialog.vue @@ -12,10 +12,10 @@ <div class="dialog alert confirmation"> <h1 v-html="confirmation"></h1> <button - v-if="accept" + v-if="accept_callback" id="accept_modal" class="approve" - @click="accept" + @click="accept_callback" > <i class="fa fa-fw fa-check"></i> {{ $__("Accept") }} @@ -47,7 +47,7 @@ export default { error, warning, confirmation, - accept, + accept_callback, is_submitting, is_loading, } = storeToRefs(mainStore) @@ -57,7 +57,7 @@ export default { error, warning, confirmation, - accept, + accept_callback, is_submitting, is_loading, removeMessages, 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 8938caf88d..838ac6c9c9 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/stores/main.js +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/stores/main.js @@ -6,7 +6,7 @@ export const useMainStore = defineStore("main", { _error: null, _warning: null, _confirmation: null, - _accept: null, + _accept_callback: null, previousMessage: null, previousError: null, displayed_already: false, @@ -28,17 +28,17 @@ export const useMainStore = defineStore("main", { this._confirmation = null; this.displayed_already = displayed; /* Is displayed on the current view */ }, - setWarning(warning, accept, displayed = true) { + setWarning(warning, displayed = true) { this._error = null; this._warning = warning; this._message = null; this._confirmation = null; this.displayed_already = displayed; /* Is displayed on the current view */ }, - setConfirmation(confirmation, accept, displayed = true){ - if(accept) { - this._accept = async () => { - await accept() + setConfirmation(confirmation, accept_callback, displayed = true){ + if(accept_callback) { + this._accept_callback = async () => { + await accept_callback() this.removeMessages() } } @@ -54,7 +54,7 @@ export const useMainStore = defineStore("main", { this._warning = null; this._message = null; this._confirmation = null; - this._accept = null; + this._accept_callback = null; } this.displayed_already = true; }, @@ -84,8 +84,8 @@ export const useMainStore = defineStore("main", { confirmation() { return this._confirmation }, - accept() { - return this._accept + accept_callback() { + return this._accept_callback }, is_submitting(){ return this._is_submitting -- 2.30.2