Koha-clms/api/v1/swagger/definitions
Jonathan Druart eb2dfad0d1 Bug 30982: [22.05.x] Use the REST API for background job list view
Bug 30982: REST API specs

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Bug 30982: (QA follow-up) Double quoting and console.log

This patch fixes the issues highlighted by the QA script; We use double
quotes for translatable strings in JS and remove an errant console.log
call.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Bug 30982: Add tests and implement GET /background_jobs/$id

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Bug 30982: Make code more re-usable

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Bug 30982: Add 'context' to the REST API specs

context has been added by bug 30889

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Bug 30982: Add Koha::BackgroundJobs->filter_by_current

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Bug 30982: API tweaks

This patch makes the following changes to the 'background_jobs' API:

* We now call them 'jobs'
* Removed deprecated query parameter definitions
* Added only_current query parameter
* Controller gets adapted to use $rs->filter_by_current when
  only_current is passed

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

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 <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Bug 30982: Rename 'Background Jobs' => 'Jobs'

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Bug 30982: (QA follow-up) Resolve pod warning

Empty section in previous paragraph at line 32 in file Koha/BackgroundJobs.pm

Test plan:
Run podchecker again on this module.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Bug 30982: (QA follow-up) Spelling

[1] Correct: BackgrounJob
[2] If should filter out not current jobs
=> Had a hard time reading that one until I replaced if by it.
=> Decided to rephrase it in a more positive way.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Bug 30982: (QA follow-up) Remove redundancy from template

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>

Bug 30982: (QA follow-up) No userenv, no jobs

+    # Assume permission if context has no user
+    my $can_manage_background_jobs = 1;
=> This felt a bit unsafe.

Test plan:
Try interface for jobs. Call API with cookie. Call API with OAuth.
Run t/db_dependent/Koha/BackgroundJobs.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-11-01 21:40:18 +00:00
..
account_line.yaml Bug 29620: Move the OpenAPI spec to YAML format 2021-12-07 12:33:35 -10:00
advancededitormacro.yaml Bug 30194: (follow-up) Simply OpenAPI Specification 2022-03-29 16:44:31 +02:00
allows_renewal.yaml Bug 29620: Move the OpenAPI spec to YAML format 2021-12-07 12:33:35 -10:00
basket.yaml Bug 29620: Move the OpenAPI spec to YAML format 2021-12-07 12:33:35 -10:00
cashup.yaml Bug 29620: Move the OpenAPI spec to YAML format 2021-12-07 12:33:35 -10:00
checkout.yaml Bug 30194: (follow-up) Simply OpenAPI Specification 2022-03-29 16:44:31 +02:00
checkouts.yaml Bug 30194: (follow-up) Simply OpenAPI Specification 2022-03-29 16:44:31 +02:00
circ-rule-kind.yaml Bug 29620: Move the OpenAPI spec to YAML format 2021-12-07 12:33:35 -10:00
city.yaml Bug 30194: (follow-up) Simply OpenAPI Specification 2022-03-29 16:44:31 +02:00
club_hold.yaml Bug 29620: Move the OpenAPI spec to YAML format 2021-12-07 12:33:35 -10:00
club_hold_patron_hold.yaml Bug 29620: Move the OpenAPI spec to YAML format 2021-12-07 12:33:35 -10:00
club_hold_patron_holds.yaml Bug 30194: (follow-up) Simply OpenAPI Specification 2022-03-29 16:44:31 +02:00
club_holds.yaml Bug 30194: (follow-up) Simply OpenAPI Specification 2022-03-29 16:44:31 +02:00
error.yaml Bug 28020: Add error_code to error responses 2022-01-05 13:33:46 -10:00
fund.yaml Bug 30194: (follow-up) Simply OpenAPI Specification 2022-03-29 16:44:31 +02:00
hold.yaml Bug 29620: Move the OpenAPI spec to YAML format 2021-12-07 12:33:35 -10:00
holds.yaml Bug 30194: (follow-up) Simply OpenAPI Specification 2022-03-29 16:44:31 +02:00
ill_backend.yaml Bug 29620: Move the OpenAPI spec to YAML format 2021-12-07 12:33:35 -10:00
ill_backends.yaml Bug 30194: (follow-up) Simply OpenAPI Specification 2022-03-29 16:44:31 +02:00
import_batch_profile.yaml Bug 29620: Move the OpenAPI spec to YAML format 2021-12-07 12:33:35 -10:00
import_batch_profiles.yaml Bug 30194: (follow-up) Simply OpenAPI Specification 2022-03-29 16:44:31 +02:00
import_record_match.yaml Bug 22785: Allow option to choose which record match is applied during import 2022-05-03 11:19:50 -10:00
invoice.yaml Bug 29620: Move the OpenAPI spec to YAML format 2021-12-07 12:33:35 -10:00
item.yaml Bug 29105: Add effective_itemtype handling to items api 2022-08-23 19:19:03 +00:00
job.yaml Bug 30982: [22.05.x] Use the REST API for background job list view 2022-11-01 21:40:18 +00:00
library.yaml Bug 30194: (follow-up) Simply OpenAPI Specification 2022-03-29 16:44:31 +02:00
order.yaml Bug 29620: Move the OpenAPI spec to YAML format 2021-12-07 12:33:35 -10:00
patron.yaml Bug 29924: (QA follow-up) Remove password_expiration_date from API 2022-05-06 10:33:09 -10:00
patron_account_credit.yaml Bug 29620: Move the OpenAPI spec to YAML format 2021-12-07 12:33:35 -10:00
patron_balance.yaml Bug 30194: (follow-up) Simply OpenAPI Specification 2022-03-29 16:44:31 +02:00
patron_extended_attribute.yaml Bug 29620: Move the OpenAPI spec to YAML format 2021-12-07 12:33:35 -10:00
quote.yaml Bug 30903: Fix POST /quote 2022-08-12 15:39:33 +00:00
return_claim.yaml Bug 30194: (follow-up) Simply OpenAPI Specification 2022-03-29 16:44:31 +02:00
smtp_server.yaml Bug 29620: Move the OpenAPI spec to YAML format 2021-12-07 12:33:35 -10:00
suggestion.yaml Bug 17314: OpenAPI spec 2021-10-28 17:32:34 +02:00
transfer_limit.yaml Bug 29620: Move the OpenAPI spec to YAML format 2021-12-07 12:33:35 -10:00
vendor.yaml Bug 30194: (follow-up) Simply OpenAPI Specification 2022-03-29 16:44:31 +02:00