Bugzilla – Attachment 159264 Details for
Bug 35392
HTML in translatable string
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35392: New getDialoJobEnqueueMessage
Bug-35392-New-getDialoJobEnqueueMessage.patch (text/plain), 5.37 KB, created by
Pedro Amorim
on 2023-11-27 11:01:17 UTC
(
hide
)
Description:
Bug 35392: New getDialoJobEnqueueMessage
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2023-11-27 11:01:17 UTC
Size:
5.37 KB
patch
obsolete
>From f53ef29ed3622540cba860c27fd96a349c4cc27f Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Date: Mon, 27 Nov 2023 10:49:45 +0000 >Subject: [PATCH] Bug 35392: New getDialoJobEnqueueMessage > >DRY the dialog message shown when a background job is enqueued in ERM > >This takes Tomas work in UsageStatisticsDataProvidersList.vue, DRYs it >and also applies it to UsageStatisticsDataProvidersFileImport.vue to address >the issue mentioned by Caroline. > >To test: >1) Do a regular harvest, >2) Do a file upload >3) Notice in both cases the message is shown as before >--- > .../ERM/UsageStatisticsDataProvidersFileImport.vue | 12 +++++++++--- > .../ERM/UsageStatisticsDataProvidersList.vue | 13 ++++++++++--- > koha-tmpl/intranet-tmpl/prog/js/vue/stores/erm.js | 13 +++++++++++++ > 3 files changed, 32 insertions(+), 6 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsDataProvidersFileImport.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsDataProvidersFileImport.vue >index abcaf414b6..37c0e56010 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsDataProvidersFileImport.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsDataProvidersFileImport.vue >@@ -46,8 +46,11 @@ export default { > > const { setMessage } = inject("mainStore") > >+ const { getDialogJobEnqueueMessage } = inject("reportsStore") >+ > return { > setMessage, >+ getDialogJobEnqueueMessage, > } > }, > data() { >@@ -89,9 +92,12 @@ export default { > success => { > let message = "" > success.jobs.forEach((job, i) => { >- message += this.$__( >- '<li>Job for uploaded file has been queued, <a href="/cgi-bin/koha/admin/background_jobs.pl?op=view&id=%s" target="_blank">click here</a> to check its progress.</li>' >- ).format(job.job_id) >+ message += this.getDialogJobEnqueueMessage( >+ this.$__( >+ "Job for uploaded file has been queued" >+ ), >+ job >+ ) > }) > this.setMessage(message, true) > }, >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsDataProvidersList.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsDataProvidersList.vue >index 7ebc4bcecb..a27e2a18a0 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsDataProvidersList.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsDataProvidersList.vue >@@ -48,6 +48,8 @@ export default { > const { setConfirmationDialog, setMessage, setWarning } = > inject("mainStore") > >+ const { getDialogJobEnqueueMessage } = inject("reportsStore") >+ > const table = ref() > > return { >@@ -56,6 +58,7 @@ export default { > setConfirmationDialog, > setMessage, > setWarning, >+ getDialogJobEnqueueMessage, > table, > } > }, >@@ -245,9 +248,13 @@ export default { > success => { > let message = "" > success.jobs.forEach((job, i) => { >- message += this.$__( >- '<li>Job for report type <strong>%s</strong> has been queued, <a href="/cgi-bin/koha/admin/background_jobs.pl?op=view&id=%s" target="_blank">click here</a> to check its progress.</li>' >- ).format(job.report_type, job.job_id) >+ message += >+ this.getDialogJobEnqueueMessage( >+ this.$__( >+ "Job for report type <strong>%s</strong> has been queued" >+ ), >+ job >+ ) > }) > this.setMessage(message, true) > }, >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/stores/erm.js b/koha-tmpl/intranet-tmpl/prog/js/vue/stores/erm.js >index 157cf5b676..430d4663b1 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/stores/erm.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/stores/erm.js >@@ -145,5 +145,18 @@ export const useReportsStore = defineStore("reports", { > if (!this.report_type_map.hasOwnProperty(report_type)) return false; > return this.report_type_map[report_type].includes(column); > }, >+ getDialogJobEnqueueMessage(message, job) { >+ return ( >+ "<li>" + >+ message.format(job.report_type) + >+ ', <a href="/cgi-bin/koha/admin/background_jobs.pl?op=view&id=' + >+ job.job_id + >+ '" target="_blank">' + >+ __("click here") + >+ "</a> " + >+ __("to check its progress.") + >+ "</li>" >+ ); >+ }, > }, > }); >-- >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 35392
:
159256
|
159263
|
159264
|
159265
|
159279
|
159280
|
159281
|
159283
|
160450
|
160451
|
160512
|
160513
|
164466
|
164467
|
164473
|
164474
|
164475