@@ -, +, @@
message in the dialog
---
.../prog/js/vue/components/Dialog.vue | 7 +++---
.../js/vue/components/ERM/AgreementsList.vue | 22 ++++++++++++++-----
.../intranet-tmpl/prog/js/vue/stores/main.js | 2 +-
3 files changed, 21 insertions(+), 10 deletions(-)
--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Dialog.vue
+++ a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Dialog.vue
@@ -10,7 +10,8 @@
-
+
+
--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsList.vue
+++ a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsList.vue
@@ -49,7 +49,7 @@ export default {
const AVStore = inject("AVStore")
const { get_lib_from_av, map_av_dt_filter } = AVStore
- const { setConfirmation, setMessage } = inject("mainStore")
+ const { setConfirmationDialog, setMessage } = inject("mainStore")
const table_id = "agreement_list"
useDataTable(table_id)
@@ -59,7 +59,7 @@ export default {
get_lib_from_av,
map_av_dt_filter,
table_id,
- setConfirmation,
+ setConfirmationDialog,
setMessage,
}
},
@@ -114,9 +114,16 @@ export default {
"/cgi-bin/koha/erm/agreements/edit/" + agreement_id
)
},
- delete_agreement: function (agreement_id) {
- this.setConfirmation(
- this.$__("Are you sure you want to remove this agreement?"),
+ delete_agreement: function (agreement_id, agreement_name) {
+ this.setConfirmationDialog(
+ {
+ title: this.$__(
+ "Are you sure you want to remove this agreement?"
+ ),
+ message: agreement_name,
+ accept_label: this.$__("Yes, delete"),
+ cancel_label: this.$__("No, do not delete"),
+ },
() => {
const client = APIClient.erm
client.agreements.delete(agreement_id).then(
@@ -338,7 +345,10 @@ export default {
class: "btn btn-default btn-xs",
role: "button",
onClick: () => {
- delete_agreement(agreement_id)
+ delete_agreement(
+ agreement_id,
+ api.row(tr).data().name
+ )
},
},
[
--- a/koha-tmpl/intranet-tmpl/prog/js/vue/stores/main.js
+++ a/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()
--