Bugzilla – Attachment 172388 Details for
Bug 37888
Default filtering of background jobs could be improved
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37888: Show all jobs, order by "queued", remove last hour filter
Bug-37888-Show-all-jobs-order-by-queued-remove-las.patch (text/plain), 3.58 KB, created by
Julian Maurice
on 2024-10-04 12:04:19 UTC
(
hide
)
Description:
Bug 37888: Show all jobs, order by "queued", remove last hour filter
Filename:
MIME Type:
Creator:
Julian Maurice
Created:
2024-10-04 12:04:19 UTC
Size:
3.58 KB
patch
obsolete
>From 25fc61b5e69daf79ecb340e8f1a91f69edf26711 Mon Sep 17 00:00:00 2001 >From: Julian Maurice <julian.maurice@biblibre.com> >Date: Fri, 4 Oct 2024 13:41:44 +0200 >Subject: [PATCH] Bug 37888: Show all jobs, order by "queued", remove last hour > filter > >By default the background jobs page now shows the most recently queued >jobs, whatever their status is. > >By doing that, the jobs enqueued less an hour ago are always visible if >there are any (well, the first page at least), so the "last hour" filter >becomes way less useful and it's better to remove it as it caused >problems (see bug 37905) and the "1 hour" duration was arbitrary. > >The "current jobs only" filter is still useful as lots of quick >background jobs can push running jobs away from the first page and it's >a common use case to list running jobs > >Test plan: >1. Start some background jobs (batch item modification for instance) >2. Make them run and wait for finish >3. Stop the background jobs workers >4. Start some more background jobs >5. You should now have running and non-running background jobs. Go to > the admin background jobs page >6. Verify that all background jobs are shown and that they ordered by > queued time (last queued job first) >7. Verify that "Current jobs only" filter still works >--- > .../prog/en/modules/admin/background_jobs.tt | 26 +++---------------- > 1 file changed, 3 insertions(+), 23 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 9ca777c1e0..e6b5fbf38c 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 >@@ -119,15 +119,10 @@ > <h1>Jobs</h1> > > <div> >- <input type="checkbox" id="only_current" checked /> >+ <input type="checkbox" id="only_current" /> > <label for="only_current">Current jobs only</label> > </div> > >- <div> >- <input type="checkbox" id="include_last_hour" checked /> >- <label for="include_last_hour">Only include jobs enqueued in the last hour</label> >- </div> >- > <div class="page-section"> > <table id="table_jobs"> > <thead> >@@ -259,16 +254,6 @@ > $("#job_details").show(); > [% END %] > >- let additional_filters = { >- enqueued_date: function(){ >- if ( $("#include_last_hour").is(":checked") ) { >- return { ">": dayjs().subtract(1, 'hour').format() }; >- } else { >- return { "<": dayjs().format()}; >- } >- } >- }; >- > let only_current_filter = function(){ > if ( $("#only_current").is(":checked") ) { > return 'only_current=1'; >@@ -281,7 +266,7 @@ > "ajax": { > "url": "/api/v1/jobs?" + only_current_filter() > }, >- "order": [[ 1, "desc" ]], >+ "order": [[ 4, "desc" ]], > "columns": [ > { > "data": "job_id", >@@ -348,12 +333,7 @@ > "orderable": false > } > ] >- }, null, 1, additional_filters); >- >- $("#include_last_hour").on("change", function(){ >- jobs_table.DataTable().draw(); >- return false; >- }); >+ }, null, 1); > > $("#only_current").on("change", function(){ > jobs_table.DataTable().ajax.url("/api/v1/jobs?" + only_current_filter()).load(); >-- >2.39.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 37888
:
172388
|
172503
|
172905