Summary: | Hide finished ILL requests | ||
---|---|---|---|
Product: | Koha | Reporter: | Magnus Enger <magnus> |
Component: | ILL | Assignee: | Magnus Enger <magnus> |
Status: | CLOSED FIXED | QA Contact: | Katrin Fischer <katrin.fischer> |
Severity: | enhancement | ||
Priority: | P5 - low | CC: | andreas.jonsson, daniel.gaghan, jonathan.druart, lucas, Niamh.WalkerHeadon |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
See Also: | https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26030 | ||
GIT URL: | Change sponsored?: | --- | |
Patch complexity: | Small patch | Documentation contact: | |
Documentation submission: | Text to go in the release notes: |
This adds a new system preference ILLHiddenRequestStatuses that takes a list of ILL status codes to be hidden from the ILL requests table in the ILL module. This allows to hide finished and cancelled ILL requests improving the performance of the table in busy libraries but also making it easier to keep track of the pending requests.
|
|
Version(s) released in: |
20.11.00
|
Circulation function: | |
Bug Depends on: | |||
Bug Blocks: | 28641 | ||
Attachments: |
Bug 23391 - Hide finished ILL requests
Bug 23391 - Hide finished ILL requests Bug 23391 - Hide finished ILL requests Bug 23391: Hide finished ILL requests Bug 23391: Hide finished ILL requests Bug 23391: Remove warnings |
Description
Magnus Enger
2019-07-29 10:09:22 UTC
This is getting to be a real problem for some of our more ILL-active libraries. One solution could be to just have a syspref that takes a list of statuses that should be hidden by default, perhaps? Created attachment 96222 [details] [review] Bug 23391 - Hide finished ILL requests Currently, the main table of ILL requests will display all ILL requests in the database, regardless of their status. For libraries with active ILL this quickly leads to a lot of requests being displayed, and the main page of the ILL module taking a long time to load. This patch proposes to fix this by introducing the ILLHiddenRequestStatuses syspref, which can take a pipe-separated list of ILL statuses that will be hidden from view in the ILL module. This means that the only way to find a hidden request will be through a report. To test: - Apply the patch and make sure the atomic database update is run - Make sure you have a few ILL requests, with at least two different statuses - Check that all requests are still displayed in the main table of ILL requests - Add one of the statuses* you have in your database to the ILLHiddenRequestStatuses syspref, reload the ILL module frontpage and verify that requests with the given status are not displayed - Change the syspref to another status and verify requests with that status are now hidden - Change the syspref to hold both statuses, separated by the pipe symbol (e.g.: A|B). Verify that no requests with the given statuses are now displayed - Run the ILL REST API tests, e.g.: $ sudo koha-shell -c "prove t/db_dependent/api/v1/illrequests.t" kohadev * = The ILLHiddenRequestStatuses syspref should hold status codes, like "REQ" and "NEW", not their human readable counterparts. One point that should be considered: I take the string from the syspref and try to clean it up a bit with this syspref: $hidden_statuses_string =~ s/[^0-9A-Za-z_|]//g; This means that status code will only be able to contain numbers, lower and upper ascii letters and underscore. This is perhaps too strict? This is a great idea Magnus, I somehow missed this bug when it first appeared. I'm not sure of the value of cleaning up the codes to be tested for. Currently we have no restriction of status code formats, so the clean up could actually cause matching results to not be found. Happy to test and sign this off, it'll be a great addition, a few of our customers are wanting something like this! :) (In reply to Andrew Isherwood from comment #4) > This is a great idea Magnus, I somehow missed this bug when it first > appeared. > > I'm not sure of the value of cleaning up the codes to be tested for. > Currently we have no restriction of status code formats, so the clean up > could actually cause matching results to not be found. So do you think I should get rid of the cleanup? > Happy to test and sign this off, it'll be a great addition, a few of our > customers are wanting something like this! :) Yay! :-) (In reply to Magnus Enger from comment #5) > (In reply to Andrew Isherwood from comment #4) > So do you think I should get rid of the cleanup? I'm just not sure what it gives us other than potentially breaking the matching. I think we have to trust users to be able to enter the status codes without messing them up. Of course, I could be entirely missing your intention with the cleanup! (In reply to Andrew Isherwood from comment #6) > I'm just not sure what it gives us other than potentially breaking the > matching. I think we have to trust users to be able to enter the status > codes without messing them up. Of course, I could be entirely missing your > intention with the cleanup! I'm not sure myself, any longer... I'll do a revised patch. Created attachment 98390 [details] [review] Bug 23391 - Hide finished ILL requests Currently, the main table of ILL requests will display all ILL requests in the database, regardless of their status. For libraries with active ILL this quickly leads to a lot of requests being displayed, and the main page of the ILL module taking a long time to load. This patch proposes to fix this by introducing the ILLHiddenRequestStatuses syspref, which can take a pipe-separated list of ILL statuses that will be hidden from view in the ILL module. This means that the only way to find a hidden request will be through a report. To test: - Apply the patch and make sure the atomic database update is run - Make sure you have a few ILL requests, with at least two different statuses - Check that all requests are still displayed in the main table of ILL requests - Add one of the statuses* you have in your database to the ILLHiddenRequestStatuses syspref, reload the ILL module frontpage and verify that requests with the given status are not displayed - Change the syspref to another status and verify requests with that status are now hidden - Change the syspref to hold both statuses, separated by the pipe symbol (e.g.: A|B). Verify that no requests with the given statuses are now displayed - Run the ILL REST API tests, e.g.: $ sudo koha-shell -c "prove t/db_dependent/api/v1/illrequests.t" kohadev * = The ILLHiddenRequestStatuses syspref should hold status codes, like "REQ" and "NEW", not their human readable counterparts. New version of the patch is without the cleanup. Created attachment 98391 [details] [review] Bug 23391 - Hide finished ILL requests Currently, the main table of ILL requests will display all ILL requests in the database, regardless of their status. For libraries with active ILL this quickly leads to a lot of requests being displayed, and the main page of the ILL module taking a long time to load. This patch proposes to fix this by introducing the ILLHiddenRequestStatuses syspref, which can take a pipe-separated list of ILL statuses that will be hidden from view in the ILL module. This means that the only way to find a hidden request will be through a report. To test: - Apply the patch and make sure the atomic database update is run - Make sure you have a few ILL requests, with at least two different statuses - Check that all requests are still displayed in the main table of ILL requests - Add one of the statuses* you have in your database to the ILLHiddenRequestStatuses syspref, reload the ILL module frontpage and verify that requests with the given status are not displayed - Change the syspref to another status and verify requests with that status are now hidden - Change the syspref to hold both statuses, separated by the pipe symbol (e.g.: A|B). Verify that no requests with the given statuses are now displayed - Run the ILL REST API tests, e.g.: $ sudo koha-shell -c "prove t/db_dependent/api/v1/illrequests.t" kohadev * = The ILLHiddenRequestStatuses syspref should hold status codes, like "REQ" and "NEW", not their human readable counterparts. Signed-off-by: Andrew Isherwood <andrew.isherwood@ptfs-europe.com> Created attachment 106411 [details] [review] Bug 23391: Hide finished ILL requests Currently, the main table of ILL requests will display all ILL requests in the database, regardless of their status. For libraries with active ILL this quickly leads to a lot of requests being displayed, and the main page of the ILL module taking a long time to load. This patch proposes to fix this by introducing the ILLHiddenRequestStatuses syspref, which can take a pipe-separated list of ILL statuses that will be hidden from view in the ILL module. This means that the only way to find a hidden request will be through a report. To test: - Apply the patch and make sure the atomic database update is run - Make sure you have a few ILL requests, with at least two different statuses - Check that all requests are still displayed in the main table of ILL requests - Add one of the statuses* you have in your database to the ILLHiddenRequestStatuses syspref, reload the ILL module frontpage and verify that requests with the given status are not displayed - Change the syspref to another status and verify requests with that status are now hidden - Change the syspref to hold both statuses, separated by the pipe symbol (e.g.: A|B). Verify that no requests with the given statuses are now displayed - Run the ILL REST API tests, e.g.: $ sudo koha-shell -c "prove t/db_dependent/api/v1/illrequests.t" kohadev * = The ILLHiddenRequestStatuses syspref should hold status codes, like "REQ" and "NEW", not their human readable counterparts. Signed-off-by: Andrew Isherwood <andrew.isherwood@ptfs-europe.com> Rebased and fixed commit message - will continue testing. Created attachment 106599 [details] [review] Bug 23391: Hide finished ILL requests Currently, the main table of ILL requests will display all ILL requests in the database, regardless of their status. For libraries with active ILL this quickly leads to a lot of requests being displayed, and the main page of the ILL module taking a long time to load. This patch proposes to fix this by introducing the ILLHiddenRequestStatuses syspref, which can take a pipe-separated list of ILL statuses that will be hidden from view in the ILL module. This means that the only way to find a hidden request will be through a report. To test: - Apply the patch and make sure the atomic database update is run - Make sure you have a few ILL requests, with at least two different statuses - Check that all requests are still displayed in the main table of ILL requests - Add one of the statuses* you have in your database to the ILLHiddenRequestStatuses syspref, reload the ILL module frontpage and verify that requests with the given status are not displayed - Change the syspref to another status and verify requests with that status are now hidden - Change the syspref to hold both statuses, separated by the pipe symbol (e.g.: A|B). Verify that no requests with the given statuses are now displayed - Run the ILL REST API tests, e.g.: $ sudo koha-shell -c "prove t/db_dependent/api/v1/illrequests.t" kohadev * = The ILLHiddenRequestStatuses syspref should hold status codes, like "REQ" and "NEW", not their human readable counterparts. Signed-off-by: Andrew Isherwood <andrew.isherwood@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> I've heard about huge performance issues here as well for busy libraries and I think this is a good first step to fix the issue. In the future we could think about another option to pre-filter, but still allow to search with a limit on one of these status. The correct implementation would have been to move the statuses to a dedicated table. Then a "done" column could have replaced this syspref. Also I think we should have a button to display the "hidden" requests. Created attachment 107121 [details] [review] Bug 23391: Remove warnings t/db_dependent/api/v1/illrequests.t .. Use of uninitialized value $hidden_statuses_string in split at /kohadevbox/koha/Koha/REST/V1/Illrequests.pm line 61. Use of uninitialized value $hidden_statuses_string in split at /kohadevbox/koha/Koha/REST/V1/Illrequests.pm line 61. Use of uninitialized value $hidden_statuses_string in split at /kohadevbox/koha/Koha/REST/V1/Illrequests.pm line 61. Use of uninitialized value $hidden_statuses_string in split at /kohadevbox/koha/Koha/REST/V1/Illrequests.pm line 61. Use of uninitialized value $hidden_statuses_string in split at /kohadevbox/koha/Koha/REST/V1/Illrequests.pm line 61. t/db_dependent/api/v1/illrequests.t .. ok Pushed to master for 20.11, thanks to everybody involved! (In reply to Jonathan Druart from comment #15) > The correct implementation would have been to move the statuses to a > dedicated table. Then a "done" column could have replaced this syspref. > > Also I think we should have a button to display the "hidden" requests. I've filed bug 26030 for this. I attempted to backport this to 20.05.x but I see that I am failing tests: prove -v t/db_dependent/api/v1/illrequests.t # Failed test '200 OK' # at t/db_dependent/api/v1/illrequests.t line 179. # got: '503' # expected: '200' not ok 30 - exact match for JSON Pointer "" # Failed test 'exact match for JSON Pointer ""' # at t/db_dependent/api/v1/illrequests.t line 179. # Structures begin differing at: # $got = HASH(0x5621283b0dd0) # $expected = ARRAY(0x5621283a8a60) # Looks like you failed 21 tests of 30. not ok 1 - list() tests # Failed test 'list() tests' # at t/db_dependent/api/v1/illrequests.t line 183. # Looks like you failed 1 test of 1. Dubious, test returned 1 (wstat 256, 0x100) Failed 1/1 subtests I'd love to backport this if we could make the tests pass on 20.05. Until then, no backport |