From 0480f61226ce2d6e3ddcb0e028f26e6d45b30e4d Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Mon, 12 Sep 2022 14:54:08 -0300 Subject: [PATCH] Bug 30982: Adapt table to new API spec Disclaimer: this patch is highly opinionated :-D When I started looking at this patch I felt like the two tables (current/past jobs) implemented on bug 30462 was the way to go. In order to make this patches apply after it I had to redo all the things. Or most of them. But I decided to keep the idea of filtering out completed tasks, not just having the option to display 'the last hour' tasks. For the task I added some required helper methods and the relevant tests as well. So a behavior change. Hope you all agree with it. Signed-off-by: Tomas Cohen Arazi Signed-off-by: Martin Renvoize Signed-off-by: Marcel de Rooy Signed-off-by: Tomas Cohen Arazi --- .../prog/en/modules/admin/background_jobs.tt | 178 ++++-------------- 1 file changed, 39 insertions(+), 139 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 bc8d8dd56d..886c2cfc68 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 @@ -162,108 +162,15 @@

Background jobs

-
- - -
-
- [% IF queued.count %] - - - - - - - - - - - - - - [% FOREACH job IN queued %] - - - - - - - - - - [% END %] - -
Job IDStatusProgressTypeQueuedStartedActions
[% job.id | html %] - [% PROCESS show_job_status %] - [% job.progress || 0 | html %] / [% job.size | html %] - [% PROCESS show_job_type job_type => job.type %] - [% job.enqueued_on | $KohaDates with_hours = 1 %][% job.started_on| $KohaDates with_hours = 1 %] - View - [% IF job.status == 'new' || job.status == 'started' %] - Cancel - [% END %] -
- [% ELSE %] -
- There are no queued background jobs yet. -
- [% END %] -
- -
- [% IF complete.count %] -

Jobs completed in the last 60 minutes.

- - - - - - - - - - - - - - - [% FOREACH job IN complete %] - - - - - - - - - - - [% END %] - -
Job IDStatusProgressTypeQueuedStartedEndedActions
[% job.id | html %] - [% PROCESS show_job_status %] - [% job.progress || 0 | html %] / [% job.size | html %] - [% PROCESS show_job_type job_type => job.type %] - [% job.enqueued_on | $KohaDates with_hours = 1 %][% job.started_on| $KohaDates with_hours = 1 %][% job.ended_on| $KohaDates with_hours = 1 %] - View - [% IF job.status == 'new' || job.status == 'started' %] - Cancel - [% END %] -
- [% ELSE %] -
- There were no completed background jobs completed in the last 60 minutes. -
- [% END %] -
-
+
+ +
- - +
+ + +
@@ -296,26 +203,6 @@ [% INCLUDE 'js-date-format.inc' %] [% INCLUDE 'datatables.inc' %] [% IF op == 'view' %] [% PROCESS 'js' %] -- 2.39.5