This patch makes the API representation of the identity providers
domains match the new metadata.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
As I traversed the REST API spec to add the `late_since_days` embed
option, I noticed an inconsistency in the embed options we defined in
each place a basket is to be returned.
This patch makes all the places have the same embed options.
Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi>
Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
This patch adds the option to embed the return value of the
`late_since_days` method in basket objects in the REST API.
It does so by just adding it to the list of embeds in the spec. It is
added in every place baskets can be returned.
Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi>
Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
This patch adds the required mapping in
`Koha::Acquisition::Order::Claim` and adds it's definition to the API
spec.
To test:
1. Apply the patches
2. Verify the mapping makes sense and conforms to the current style and
API coding guidelines.
3. Run:
$ ktd --shell
k$ prove xt/api.t
=> SUCCESS: Tests pass
4. Sign off :-D
Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com>
In order to prevent permission errors to user without the 'parameters'
permission we are introducing a separate endpoint for the ERM module to
retrieve additional fields for this specific module.
* Adds a new endpoint /erm/extended_attribute_types
* Adjusts Cypress and REST API tests
* Adds REST API swagger specs
I wanted to keep the code as simple as possible and decided to create a
wrapper for the additional fields API client. The magic is in
koha-tmpl/intranet-tmpl/prog/js/fetch/additional-fields-api-client.js
Ideally we should provide a test for this but I failed to write them.
If required by QA I would suggest to deal with them on a separate bug to
not delay this bugfix. The code has been kept designed to be used in
other contexts but the api client is not used outside of Vue and
outside of the ERM module.
Test plan:
Confirm that user without the 'parameters' permission can use the ERM
module with additional fields.
Sponsored-by: Karlsruhe Institute of Technology (KIT)
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit e0ca94ae18)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
The acquisition config route should be accessible to users
with at least one acquisition subpermission or erm permission.
The list vendors route should be accessible to users with the erm
permission.
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit b7bd25885e)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
TO TEST:
0. APPLY PATCHES, updatedatabase, restart_all
1. Create a user with limited permissions, making sure you give them the "batch_modify_holds" permission
2. Login as chosen patron.
3. Navigate to Tools page.
4. Note there's a link "Batch modify holds".
5. Remove permission from user.
6. Link to new tool is not displayed.
7. Navigate to new tool Tools->Batch modify holds.
8. Fill in some criteria to search holds with.
9. Confirm that holds found match your search criteria.
10. Set e.g. new expiration date for all or just selected holds.
11. Confirm that holds were modified as they should have.
12. Confirm this also from database.
13. Find holds with a found/waiting status.
14. Attempt to modify their suspend status.
15. Alert box with text "One or more holds have found status and can't be suspended." should be displayed.
16. Play around, test different modifications.
17. Create SQL report which contains column for reserve_id.
18. e.g "SELECT reserve_id FROM reserves limit 10".
19.. Run report.
20. Over report select "Batch operations" should be displayed and under that there should be option "Batch modify holds".
21. Click "Batch modify holds" option.
22. Confirm that holds displayed in "Batch mofidy holds" tool are same as found with your report.
23. Do a holds search that will bring up multiple pages of results
24. Try selecting some holds from different pages to modify
25. Ensure all selected holds are being modified
26. Play around, test different modifications.
Sponsored-by: Koha-Suomi Oy
Signed-off-by: Jason Robb <jrobb@sekls.org>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit f769e3c1e6)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit ad66f7d7d3)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
This patch removes this wrongly added embed and adjusts the patron holds
history to use `pickup_location.name` instead.
To test:
1. Have a patron with some past holds from different branches
2. Browse their holds history
3. Search on the 'Library' column by name
=> SUCCESS: It works :-D
4. Apply the patch
5. Run:
$ ktd --shell
k$ yarn api:bundle
k$ koha-plack --restart kohadev
6. Repeat 2-3
=> SUCCESS: Still works!
7. Sign off :-D
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 260a0af5db)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit f3b63bdded)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit aff0c6a447)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 38b19d72cb)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 316745f3e2)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
This patch updates the /auth/password/validation endpoint to use the new
api_validate_password permission instead of the generic borrowers
permission.
This provides more granular control over who can use the password
validation API endpoint.
To test:
1. Apply this patches
2. Rebuild the API spec
$ ktd --shell
k$ yarn api:bundle
3. Run:
$ ktd --shell
k$ prove t/db_dependent/api/v1/password_validation.t
=> SUCCESS: Tests pass!
4. Sign off :-D
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 812b38d02c)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
This patch makes holds endpoints be allowed to embed strings.
To test:
1. Use your favourite REST tool to hit /api/v1/holds
2. Add the `x-koha-embed: +strings` header.
=> FAIL: The API rejects because it is not equiped with the feature.
3. Apply this patches
4. Run:
$ ktd --shell
k$ yarn api:bundle
k$ koha-plack --restart kohadev
5. Repeat 2
=> SUCCESS: It works!
6. Sign off :-D
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit e90bc50209)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
We have insert_final_newline = true to ensure files will contain a new
line at the end. However we have seen commits with "No new line" added
in the git log.
We should have a xt test to prevent more occurrences.
We should also have a test at the QA script level:
https://gitlab.com/koha-community/qa-test-tools/-/issues/96
Test plan:
prove xt/find-missing-new-lines-at-the-end-of-file.t
should return green.
Remove the new line at the end of a file, eg.
vim -b mainpage.pl
:set noeol
:wq
Now
prove xt/find-missing-new-lines-at-the-end-of-file.t
is failing on mainpage.pl.
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit e9eb20249e)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
The test added in xt/api.t was not fully accurate, we skipped the
columns that have the same name as the api attribute (ie. the ones not
part of to_api_mapping)
Test plan:
prove xt/api.t should pass
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 410497a4f0)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Test plan:
Apply the "tests" patch first
prove xt/api.t
=> fail
Apply this patch
=> pass
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 958ff7427c)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Test plan:
Apply the "tests" patch first
prove xt/api.t
=> fail
Apply this patch
=> pass
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 8f6b15f4bb)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Test plan:
Apply the "tests" patch first
prove xt/api.t
=> fail
Apply this patch
=> pass
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 25dfe5e5da)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Test plan:
Apply the "tests" patch first
prove xt/api.t
=> fail
Apply this patch
=> pass
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit f461b4d419)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
This patch makes the method return an actual array instead of a
comma-separated string. The API spec is adjusted so it also expects an
array in the response.
Tests are adjusted for the new return value.
To test:
1. Apply this patch
2. Run:
$ ktd --shell
k$ yarn api:bundle
k$ prove t/db_dependent/Koha/Item.t
=> SUCCESS: Tests pass!
3. Sign off :-D
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This patch adds a strings_map method to allow the API to return the required authorised values needed for table displays
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
To test;
0. APPLY PATCH, restart_all
1. Go to a record details page (e.g. http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=285)
2. Click the 'Show filters' button above the table
3. Now, at the top of the Status column you should see a dropdown to filter by status
4. You'll have to create several item status to test everything.
5. Add some new items/or change some item status to: DAMAGED, WITHDRAWN, NOTFORLOAN, RESTRICTED, and LOST
6. Test the status filter for each of these statuses, ensuring the work correctly.
7. Create more new items and have some that are checked out, ensure that filter works
8. Put some items into transit and make sure the 'In transit' filter works
9. Put some items on hold, both item and bib level. Make sure the 'On hold' filter works.
10. Turn on the USERecalls system preference and make some recalls, both item and bib level. Make sure the 'Recalled' filter works
11. Create some bundles, make sure the 'In bundle' status works.
12. Also make sure that the available filter is working.
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi>
Bug 37334: Correct logic for filtering by in_bundle
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This patch adapts the definition file and also tweaks the attribute
names and descriptions to match our guidelines.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This patch makes the `data` attribute nullable. This happens when
`$job->finish()` is called with no parameters.
To test:
1. Apply the regression tests patch
2. Run:
$ ktd --shell
k$ prove t/db_dependent/api/v1/jobs.t
=> FAIL: Tests don't pass, a 500 is returned when `finish()` was called
with no data
3. Apply this patch
4. Rebuild the API spec:
k$ yarn api:bundle
5. Repeat 2
=> SUCCESS: Tests pass! The API doesn't explode
6. Sign off :-D
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Tadeusz „tadzik” Sośnierz <tadeusz@sosnierz.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This moves the permission check from top level to the specific place_hold
permission
To test:
1 - Create a club
2 - Enroll some patrons
3 - Find or create a staff user with 'place_holds' permission and catalogue permission
4 - Log in as that staff
5 - Find a book and go to holds tab'
6 - Search for your club
7 - Try to place hold
8 - Nothing happens FIXME we should alert of the 403 error or other
9 - Apply patch, yanr build, restart_all
10 - Place hold
11 - Success!
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Amended-by: Jonathan Druart
typo: subsicriptions => subscriptions
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
We don't need to whole list of baskets and subscriptions
(cherry picked from commit 391b4d3b32b57c97bfb7e66ab394020ae7eed0e5)
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>