Bugzilla – Attachment 140896 Details for
Bug 30982
Use the REST API for background job list view
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30982: (QA follow-up) Remove redundancy from template
Bug-30982-QA-follow-up-Remove-redundancy-from-temp.patch (text/plain), 5.56 KB, created by
Marcel de Rooy
on 2022-09-23 09:45:57 UTC
(
hide
)
Description:
Bug 30982: (QA follow-up) Remove redundancy from template
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2022-09-23 09:45:57 UTC
Size:
5.56 KB
patch
obsolete
>From 934b4d9aabf50cffde8cf35aee56592990e1cc48 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Fri, 23 Sep 2022 08:48:05 +0000 >Subject: [PATCH] Bug 30982: (QA follow-up) Remove redundancy from template >Content-Type: text/plain; charset=utf-8 > >The template now contains two lists for both status and type: >a TT list and a JS list. The type list already proves that >redundancy leads to bugs. We miss three types at one side: > Unknown job type 'stage_marc_for_import' > Unknown job type 'marc_import_commit_batch' > Unknown job type 'marc_import_revert_batch' > >This patch removes the TT list. And gets the status and type >via an additional js call. For that reason I hide the fieldset >until document ready. This can be improved later when needed. > >Test plan: >Look at status and type on both job list and detail view. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > .../prog/en/modules/admin/background_jobs.tt | 78 ++++++------------- > 1 file changed, 24 insertions(+), 54 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/background_jobs.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/background_jobs.tt >index 70bfd32b81..1432cbdc2a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/background_jobs.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/background_jobs.tt >@@ -3,54 +3,6 @@ > [% USE Asset %] > [% USE KohaDates %] > [% SET footerjs = 1 %] >-[% BLOCK show_job_status %] >- [% SWITCH job.status %] >- [% CASE "new" %] >- <span>New</span> >- [% CASE "cancelled" %] >- <span>Cancelled</span> >- [% CASE "finished" %] >- <span>Finished</span> >- [% CASE "started" %] >- <span>Started</span> >- [% CASE "running" %] >- <span>Running</span> >- [% CASE "failed" %] >- <span>Failed</span> >- [% CASE # Default case %] >- [% job.status | html %] >- [% END -%] >-[% END %] >-[% BLOCK show_job_type %] >- [% SWITCH job_type %] >- [% CASE 'batch_biblio_record_modification' %] >- <span>Batch bibliographic record modification</span> >- [% CASE 'batch_biblio_record_deletion' %] >- <span>Batch bibliographic record record deletion</span> >- [% CASE 'batch_authority_record_modification' %] >- <span>Batch authority record modification</span> >- [% CASE 'batch_authority_record_deletion' %] >- <span>Batch authority record deletion</span> >- [% CASE 'batch_item_record_modification' %] >- <span>Batch item record modification</span> >- [% CASE 'batch_item_record_deletion' %] >- <span>Batch item record deletion</span> >- [% CASE "batch_hold_cancel" %] >- <span>Batch hold cancellation</span> >- [% CASE 'update_elastic_index' %] >- <span>Update Elasticsearch index</span> >- [% CASE 'update_holds_queue_for_biblios' %] >- <span>Holds queue update</span> >- [% CASE 'stage_marc_for_import' %] >- <span>Staged MARC records for import</span> >- [% CASE 'marc_import_commit_batch' %] >- <span>Import MARC records</span> >- [% CASE 'marc_import_revert_batch' %] >- <span>Revert import MARC records</span> >- [% CASE %]<span>Unknown job type '[% job_type | html %]'</span> >- [% END %] >- >-[% END %] > [% INCLUDE 'doc-head-open.inc' %] > <title> > [% IF op == 'view' %] >@@ -118,17 +70,17 @@ > > [% PROCESS "background_jobs/${job.type}.inc" %] > >- <fieldset class="rows"> >+ <fieldset class="rows" style="display:none;"> > <ol> > <li><span class="label">Job ID: </span>[% job.id | html %]</li> > <li> > <label for="job_status">Status: </label> >- [% PROCESS show_job_status %] >+ <span id="job_status_description"></span> > </li> > <li><label for="job_progress">Progress: </label>[% job.progress || 0 | html %] / [% job.size | html %]</li> > <li> > <label for="job_type">Type: </label> >- [% PROCESS show_job_type job_type => job.type %] >+ <span id="job_type_description"></span> > </li> > <li> > <label for="job_enqueued_on">Queued: </label> >@@ -249,13 +201,25 @@ > '_str': _("Batch hold cancellation") > }, > { >- '_id': 'update_elastic_index' >- , '_str': _("Update Elasticsearch index") >+ '_id': 'update_elastic_index', >+ '_str': _("Update Elasticsearch index") > }, > { > '_id': 'update_holds_queue_for_biblios', > '_str': _("Holds queue update") >- } >+ }, >+ { >+ '_id': 'stage_marc_for_import', >+ '_str': _("Staged MARC records for import") >+ }, >+ { >+ '_id': 'marc_import_commit_batch', >+ '_str': _("Import MARC records") >+ }, >+ { >+ '_id': 'marc_import_revert_batch', >+ '_str': _("Revert import MARC records") >+ }, > ]; > > function get_job_type (job_type) { >@@ -267,6 +231,12 @@ > } > > $(document).ready(function() { >+ [% IF op == 'view' %] >+ $("#job_status_description").html( get_job_status("[% job.status | html %]") ); >+ $("#job_type_description").html( get_job_type("[% job.type | html %]") ); >+ $("fieldset.rows").show(); >+ [% END %] >+ > let additional_filters = { > started_on: function(){ > let now = new Date(); >-- >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 30982
:
136245
|
136246
|
136670
|
136671
|
136672
|
136707
|
136708
|
136715
|
138114
|
139636
|
139637
|
139638
|
139639
|
139640
|
139641
|
140488
|
140489
|
140490
|
140491
|
140492
|
140493
|
140494
|
140495
|
140496
|
140497
|
140498
|
140589
|
140590
|
140591
|
140592
|
140593
|
140594
|
140595
|
140596
|
140597
|
140598
|
140599
|
140789
|
140884
|
140885
|
140886
|
140887
|
140888
|
140889
|
140890
|
140891
|
140892
|
140893
|
140894
|
140895
| 140896 |
140897
|
142859