Bug 25845

Summary: Cannot limit system logs to 'api' interface
Product: Koha Reporter: Nick Clemens <nick>
Component: ToolsAssignee: Tomás Cohen Arazi <tomascohen>
Status: Pushed to master --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: aleisha, chris, jonathan.druart, lucas, tomascohen
Version: master   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Who signed the patch off: Text to go in the release notes:
Version(s) released in:
20.11.00, 20.05.03
Bug Depends on: 22600    
Bug Blocks:    
Attachments: Bug 25845: Add 'api' to the log viewer interface options
Bug 25845: Add 'api' to the log viewer interface options
Bug 25845: (QA follow-up) Call it REST API instead of just API

Description Nick Clemens 2020-06-22 19:25:44 UTC
Bug 22600 added the 'api' interface to the system, we should also add this as a limit in the tools
Comment 1 Tomás Cohen Arazi 2020-06-23 14:13:29 UTC
Created attachment 106210 [details] [review]
Bug 25845: Add 'api' to the log viewer interface options

This patch simply adds the API option to the log viewer.

To test:
1. Have BorrowersLog set
2. Update some patron using the API. For example
   curl --location --request PUT 'http://koha:koha@kohadev-intra.mydnsname.org:8081/api/v1/patrons/1' \
--header 'Content-Type: application/json' \
--data-raw '{
"firstname": "Tomasito",
"surname": "None",
"address": "Address",
"category_id": "ST",
"city": "Córdoba",
"library_id": "MPL"
}'
3. Open the log viewer
=> FAIL: There's no way to filter on interface, choosing API
4. Apply this patch
5. Reload the log viewer
=> SUCCESS: There are options to filter by 'API' interface
=> SUCCESS: Filtering by 'API' works
6. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 2 Nick Clemens 2020-06-30 00:41:31 UTC
Created attachment 106421 [details] [review]
Bug 25845: Add 'api' to the log viewer interface options

This patch simply adds the API option to the log viewer.

To test:
1. Have BorrowersLog set
2. Update some patron using the API. For example
   curl --location --request PUT 'http://koha:koha@kohadev-intra.mydnsname.org:8081/api/v1/patrons/1' \
--header 'Content-Type: application/json' \
--data-raw '{
"firstname": "Tomasito",
"surname": "None",
"address": "Address",
"category_id": "ST",
"city": "Córdoba",
"library_id": "MPL"
}'
3. Open the log viewer
=> FAIL: There's no way to filter on interface, choosing API
4. Apply this patch
5. Reload the log viewer
=> SUCCESS: There are options to filter by 'API' interface
=> SUCCESS: Filtering by 'API' works
6. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 3 Nick Clemens 2020-06-30 00:41:45 UTC
Trivial, passing QA
Comment 4 Jonathan Druart 2020-07-20 10:49:08 UTC
I think we should use "REST API", not simply "API".
Comment 5 Tomás Cohen Arazi 2020-07-20 12:51:20 UTC
Created attachment 107098 [details] [review]
Bug 25845: (QA follow-up) Call it REST API instead of just API

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 6 Jonathan Druart 2020-07-22 08:31:42 UTC
Pushed to master for 20.11, thanks to everybody involved!
Comment 7 Lucas Gass 2020-07-28 15:21:00 UTC
backported to 20.05.x for 20.05.03
Comment 8 Aleisha Amohia 2020-08-03 23:35:15 UTC
enhancement, not backported to 19.11.x
Comment 9 Nick Clemens 2020-08-04 11:44:19 UTC
(In reply to Aleisha Amohia from comment #8)
> enhancement, not backported to 19.11.x

Hi Aliesha, the api logs exist in 19.11 but cannot be searched specifically, the patch adds a string to allow selecting them. Would you reconsider?