Bugzilla – Attachment 147384 Details for
Bug 32991
Improve our Dialog component and remove routes for deletion
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32991: Allow for a confirmation title and a confirmation message in the dialog
Bug-32991-Allow-for-a-confirmation-title-and-a-con.patch (text/plain), 7.39 KB, created by
Pedro Amorim
on 2023-02-24 17:38:43 UTC
(
hide
)
Description:
Bug 32991: Allow for a confirmation title and a confirmation message in the dialog
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2023-02-24 17:38:43 UTC
Size:
7.39 KB
patch
obsolete
>From 4213f68aac38dcc60237b0c5ae7fbbf9a03e94b4 Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Date: Fri, 24 Feb 2023 17:31:13 +0000 >Subject: [PATCH] Bug 32991: Allow for a confirmation title and a confirmation > message in the dialog > >--- > .../prog/js/vue/components/Dialog.vue | 11 +++++--- > .../js/vue/components/ERM/AgreementsList.vue | 14 ++++++---- > .../intranet-tmpl/prog/js/vue/stores/main.js | 27 ++++++++++++------- > 3 files changed, 34 insertions(+), 18 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 45aa8f4661..0a871141de 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Dialog.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Dialog.vue >@@ -8,9 +8,10 @@ > {{ $__("Close") }} > </button> > </div> >- <div class="modal_centered" v-if="confirmation"> >+ <div class="modal_centered" v-if="confirmation_title"> > <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" >@@ -46,7 +47,8 @@ export default { > message, > error, > warning, >- confirmation, >+ confirmation_title, >+ confirmation_message, > accept_callback, > is_submitting, > is_loading, >@@ -56,7 +58,8 @@ export default { > message, > error, > warning, >- confirmation, >+ confirmation_title, >+ confirmation_message, > accept_callback, > is_submitting, > is_loading, >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsList.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsList.vue >index 251c4c892a..6b78fe883f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsList.vue >+++ b/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,10 @@ export default { > "/cgi-bin/koha/erm/agreements/edit/" + agreement_id > ) > }, >- delete_agreement: function (agreement_id) { >- this.setConfirmation( >+ delete_agreement: function (agreement_id, agreement_name) { >+ this.setConfirmationDialog( > this.$__("Are you sure you want to remove this agreement?"), >+ agreement_name, > () => { > const client = APIClient.erm > client.agreements.delete(agreement_id).then( >@@ -338,7 +339,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 >+ ) > }, > }, > [ >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 838ac6c9c9..78fee0d43d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/stores/main.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/stores/main.js >@@ -5,7 +5,8 @@ export const useMainStore = defineStore("main", { > _message: null, > _error: null, > _warning: null, >- _confirmation: null, >+ _confirmation_title: null, >+ _confirmation_message: null, > _accept_callback: null, > previousMessage: null, > previousError: null, >@@ -18,24 +19,27 @@ export const useMainStore = defineStore("main", { > this._error = null; > this._warning = null; > this._message = message; >- this._confirmation = null; >+ this._confirmation_title = null; >+ this._confirmation_message = null; > this.displayed_already = displayed; /* Will be displayed on the next view */ > }, > setError(error, displayed = true) { > this._error = error; > this._warning = null; > this._message = null; >- this._confirmation = null; >+ this._confirmation_title = null; >+ this._confirmation_message = null; > this.displayed_already = displayed; /* Is displayed on the current view */ > }, > setWarning(warning, displayed = true) { > this._error = null; > this._warning = warning; > this._message = null; >- this._confirmation = null; >+ this._confirmation_title = null; >+ this._confirmation_message = null; > this.displayed_already = displayed; /* Is displayed on the current view */ > }, >- setConfirmation(confirmation, accept_callback, displayed = true){ >+ setConfirmationDialog(confirmation_title, confirmation_message, accept_callback, displayed = true){ > if(accept_callback) { > this._accept_callback = async () => { > await accept_callback() >@@ -45,7 +49,8 @@ export const useMainStore = defineStore("main", { > this._error = null; > this._warning = null; > this._message = null; >- this._confirmation = confirmation; >+ this._confirmation_title = confirmation_title; >+ this._confirmation_message = confirmation_message; > this.displayed_already = displayed; /* Is displayed on the current view */ > }, > removeMessages() { >@@ -53,7 +58,8 @@ export const useMainStore = defineStore("main", { > this._error = null; > this._warning = null; > this._message = null; >- this._confirmation = null; >+ this._confirmation_title = null; >+ this._confirmation_message = null; > this._accept_callback = null; > } > this.displayed_already = true; >@@ -81,8 +87,11 @@ export const useMainStore = defineStore("main", { > message() { > return this._message > }, >- confirmation() { >- return this._confirmation >+ confirmation_title() { >+ return this._confirmation_title >+ }, >+ confirmation_message() { >+ return this._confirmation_message > }, > accept_callback() { > return this._accept_callback >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 32991
:
146828
|
146829
|
147051
|
147052
|
147053
|
147054
|
147082
|
147083
|
147281
|
147282
|
147291
|
147305
|
147350
|
147383
|
147384
|
147385
|
147387
|
147388
|
147389
|
147390
|
147391
|
147392
|
147393
|
147394
|
147429
|
147439
|
147445
|
147447
|
147448
|
147449
|
147450
|
147451
|
147452
|
147453
|
147454
|
147455
|
147456
|
147461
|
147483
|
147485
|
147486
|
147487
|
147542
|
147543
|
147544
|
147545
|
147546
|
147547
|
147548
|
147549
|
147550
|
147551
|
147552
|
147553
|
147554
|
147569
|
147573
|
147584
|
147588
|
147589
|
147590
|
147591
|
147592
|
147593
|
147594
|
147595
|
147596
|
147597
|
147598
|
147599
|
147600
|
147601
|
147602
|
147603
|
147604
|
147937
|
147938
|
147939
|
147940
|
147941
|
147942
|
147943
|
147944
|
147945
|
147946
|
147947
|
147948
|
147949
|
147950
|
147951