From ee2939c3ae4f88d4fb046c26f06830f714254520 Mon Sep 17 00:00:00 2001 From: Pedro Amorim <pedro.amorim@ptfs-europe.com> Date: Mon, 27 Feb 2023 15:09:41 +0000 Subject: [PATCH] Bug 32991: Allow for a confirmation title, message, accept_label and cancel_label in Dialog.vue MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com> Signed-off-by: AgustÃn Moyano <agustinmoyano@theke.io> --- koha-tmpl/intranet-tmpl/prog/js/vue/components/Dialog.vue | 7 ++++--- koha-tmpl/intranet-tmpl/prog/js/vue/stores/main.js | 2 +- 2 files changed, 5 insertions(+), 4 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 45aa8f4661c..c7b167faf90 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Dialog.vue +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Dialog.vue @@ -10,7 +10,8 @@ </div> <div class="modal_centered" v-if="confirmation"> <div class="dialog alert confirmation"> - <h1 v-html="confirmation"></h1> + <h1 v-html="confirmation.title"></h1> + <p v-html="confirmation.message"></p> <button v-if="accept_callback" id="accept_modal" @@ -18,11 +19,11 @@ @click="accept_callback" > <i class="fa fa-fw fa-check"></i> - {{ $__("Accept") }} + <span v-html="confirmation.accept_label"></span> </button> <button id="close_modal" class="deny" @click="removeMessages"> <i class="fa fa-fw fa-remove"></i> - {{ $__("Close") }} + <span v-html="confirmation.cancel_label"></span> </button> </div> </div> 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 838ac6c9c9c..21e04f69eca 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/stores/main.js +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/stores/main.js @@ -35,7 +35,7 @@ export const useMainStore = defineStore("main", { this._confirmation = null; this.displayed_already = displayed; /* Is displayed on the current view */ }, - setConfirmation(confirmation, accept_callback, displayed = true){ + setConfirmationDialog(confirmation, accept_callback, displayed = true){ if(accept_callback) { this._accept_callback = async () => { await accept_callback() -- 2.25.1