From Julian: I don't like the two available filters and the fact that they are enabled by default. 99% of the time I see an empty table because the jobs I just launched are already finished by the time I go to this page or because the job I want to check was queued more than an hour ago. Why don't we display the last X queued jobs by default ? I don't want to see unfinished jobs or "queued less than an hour ago" jobs. I want to see the more recent jobs. An option to filter out finished jobs is useful but in my case it would be less annoying if it was disabled by default. However, the 1 hour filter is arbitrary (why 1 hour ?) and not so useful in my opinion, as long as we can sort by queued date/time
I agree that for my purposes seeing the last X jobs is probably better than last hour. A filter for unfinished jobs would definitely be helpful. I am almost always checking on a batch metadata ingest and I just want to keep tabs on only that until it finishes.
Created attachment 172388 [details] [review] 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
I can't get this patch to apply against main. Am I perhaps doing something wrong? I will leave it at needs signoff. I'm doing this manually, not with git-bz, and I've successfully applied patches before. If I `git am -3 -i -u <name_of_patch_file>` like the wiki recommends, I get "error: sha1 information is lacking or useless (koha-tmpl/intranet-tmpl/prog/en/modules/admin/background_jobs.tt). error: could not build fake ancestor" If I try `git apply` or `cat patch_file | patch -p1` I get portions that are unable to be applied: "2 out of 4 hunks failed--saving rejects to 'koha-tmpl/intranet-tmpl/prog/en/modules/admin/background_jobs.tt.rej'" The rejected chunks are the `let additional_filters...` JS is and the third chunk of JS further down that references that var and adds an on change handler.
If I'm not mistaken, the patch also needs to update the `query_filters` function on lines 262-72 here https://gitlab.com/koha-community/Koha/-/blob/main/koha-tmpl/intranet-tmpl/prog/en/modules/admin/background_jobs.tt#L262-272 since the #include_last_hour element no longer exists.
(In reply to Eric Phetteplace from comment #3) > I can't get this patch to apply against main. The patch depends on bug 37905. You need to apply it first. (In reply to Eric Phetteplace from comment #4) > If I'm not mistaken, the patch also needs to update the `query_filters` > function on lines 262-72 here > https://gitlab.com/koha-community/Koha/-/blob/main/koha-tmpl/intranet-tmpl/ > prog/en/modules/admin/background_jobs.tt#L262-272 since the > #include_last_hour element no longer exists. the query_filters function is removed by bug 37905
OK my apologies! I've never signed off on a bug where I needed to apply a dependent patch. I should be able to QA this today or tomorrow.
Created attachment 172503 [details] [review] Bug 37888: Show all jobs, order by "queued", remove last hour filter
(In reply to Eric Phetteplace from comment #6) > OK my apologies! I've never signed off on a bug where I needed to apply a > dependent patch. I should be able to QA this today or tomorrow. No need for apologies, we've all been there ;) Thank you for testing!
Created attachment 172905 [details] [review] 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 Signed-off-by: Eric Phetteplace <phette23@gmail.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Simpler and cleaner UX with this.. Passing QA
Pushed for 24.11! Well done everyone, thank you!
Enhancement, no 24.05.x backport