From 354af20bf1389a8fc1f6368ce708d177c203d3d9 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 --- .../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 3456fed233..7922a2e80e 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 @@ -156,108 +156,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 %] -
-
+
+ +
- - +
+ + +
@@ -290,26 +197,6 @@ [% INCLUDE 'js-date-format.inc' %] [% INCLUDE 'datatables.inc' %] [% IF op == 'view' %] [% PROCESS 'js' %] -- 2.34.1