Koha/admin
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
..
searchengine/elasticsearch Bug 30879: Allow biblionumber as sort option in Elasticsearch 2022-09-29 16:47:07 +00:00
additional-fields.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
admin-home.pl Bug 31401: Update administration sidebar to match entries on administration start page 2022-10-31 20:14:06 +00:00
adveditorshortcuts.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
aqbudgetperiods.pl Bug 29429: (bug 17600 follow-up) Fix import in aqbudgetperiods.pl 2021-11-08 12:11:44 +01:00
aqbudgets.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
aqcontract.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
aqplan.pl Bug 28327: Unify CSV delimiter special behavior for tabulation 2022-10-14 19:29:41 +00:00
audio_alerts.pl Bug 29844: Fix ->search occurrences 2022-02-09 15:36:23 -10:00
auth_subfields_structure.pl Bug 30489: Convert MARC and authority subfield edit tabs to Bootstrap 2022-05-02 11:22:57 -10:00
auth_tag_structure.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
authorised_values.pl Bug 7374: Add remote image option for authorized values 2022-02-10 14:44:23 -10:00
authtypes.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
background_jobs.pl Bug 30982: [22.05.x] Use the REST API for background job list view 2022-11-01 21:40:18 +00:00
biblio_framework.pl Bug 30848: Add an ExpandCodedFields RecordProcessor filter 2022-07-29 17:15:30 +00:00
branch_transfer_limits.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
branches.pl Bug 29859: Use iterator instead of as_list 2022-02-09 15:36:23 -10:00
cash_registers.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
categories.pl Bug 29924: Add password expiration feature 2022-05-06 10:33:09 -10:00
check_budget_parent.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
check_parent_total.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
checkmarc.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
cities.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
classsources.pl Bug 29844: Fix ->search occurrences 2022-02-09 15:36:23 -10:00
clone-rules.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
columns_settings.pl Bug 30494: Replace the use of jQueryUI Accordion on the table settings page 2022-05-02 11:22:57 -10:00
columns_settings.yml Bug 30798: Change column order on account-fines table column settings 2022-07-13 19:30:28 +00:00
credit_types.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
currency.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
debit_types.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
desks.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
didyoumean.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
edi_accounts.pl Bug 30130: Use new standard field in account definition 2022-04-13 15:55:39 +02:00
edi_ean_accounts.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
import_export_authtype.pl Bug 13952: (follow-up) JS translatability, clean warns, other 2022-04-04 16:23:46 +02:00
import_export_framework.pl Bug 13952: (follow-up) Fixing export on default biblio framework 2022-04-04 16:23:45 +02:00
item_circulation_alerts.pl Bug 29859: Use iterator instead of as_list 2022-02-09 15:36:23 -10:00
items_search_field.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
items_search_fields.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
itemtypes.pl Bug 29859: Use iterator instead of as_list 2022-02-09 15:36:23 -10:00
koha2marclinks.pl Bug 29844: Fix ->search occurrences 2022-02-09 15:36:23 -10:00
library_groups.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
localization.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
marc-overlay-rules.pl Bug 14957: Fix perlcritic error on admin/marc-overlay-rules.pl 2021-10-27 09:16:42 +02:00
marc_subfields_structure.pl Bug 31238: Fix typo in marc_subfields_structure.pl 2022-09-29 14:37:08 +00:00
marctagstructure.pl Bug 30848: Add an ExpandCodedFields RecordProcessor filter 2022-07-29 17:15:30 +00:00
matching-rules.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
oai_set_mappings.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
oai_sets.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
overdrive.pl Bug 29844: Fix ->search occurrences 2022-02-09 15:36:23 -10:00
patron-attr-types.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
preferences.pl Bug 29695: Make "modalselect" syspref's values translatable 2022-04-12 11:40:16 +02:00
share_content.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
smart-rules.pl Revert "Bug 29012: Add default values for blank circulation rules that weren't saved to the database" 2022-10-13 17:31:41 +00:00
sms_providers.pl Bug 29859: Use iterator instead of as_list 2022-02-09 15:36:23 -10:00
smtp_servers.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
sru_modmapping.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
systempreferences.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
transfer_limits.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
transport-cost-matrix.pl Bug 29844: Fix ->search occurrences 2022-02-09 15:36:23 -10:00
usage_statistics.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
z3950servers.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00