Bug 32991: Allow for a confirmation title, message, accept_label and cancel_label in Dialog.vue

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>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a8d6d80ad5)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
This commit is contained in:
Pedro Amorim 2023-02-27 15:09:41 +00:00 committed by Jacob O'Mara
parent 8f5a774064
commit 695d2e2d0f
2 changed files with 5 additions and 4 deletions

View file

@ -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>

View file

@ -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()