[Bug 37637] New: Use the REST API to display items on the staff edit items view
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37637 Bug ID: 37637 Summary: Use the REST API to display items on the staff edit items view Change sponsored?: --- Product: Koha Version: Main Hardware: All OS: All Status: ASSIGNED Severity: enhancement Priority: P5 - low Component: Staff interface Assignee: samalau@gmail.com Reporter: samalau@gmail.com QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com Depends on: 33568 Currently, the additems table is rendered using the DB, which can cause performance issues for large amounts of items. It makes sense to switch to using the REST API (/api/v1/biblios/{biblionumber}/items) Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33568 [Bug 33568] Use the REST API to display items on the staff biblio detail view -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37637 Sam Lau <samalau@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |37639 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37639 [Bug 37639] items.stack ( shelving control number ) not included in items API endpoint -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37637 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@gmail.com --- Comment #1 from Jonathan Druart <jonathan.druart@gmail.com> --- Hi Sam, this seems like a huge work. Please share with us your plan before starting :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37637 --- Comment #2 from Sam Lau <samalau@gmail.com> --- (In reply to Jonathan Druart from comment #1)
Hi Sam, this seems like a huge work. Please share with us your plan before starting :)
Sure. Firstly, we need to remove all of the body code for building the table using a for loop in additem.tt and fixup the headers as well. Then in the cataloging_additem.js, we would need to build the table using kohaTable with '/api/v1/biblios/' + biblionumber + '/items?' as the ajax url. Then for the columns we can simply grab the responses from the api, and make necessary render or function changes for certain ones. For example, the actions button will need to have a custom data function to ensure the button functionality still works. Also, the home and holding libraries (among other things) need to be rendered as a string rather than the code. Also need to hide the columns that have no data upon loading. That's pretty much the big stuff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37637 --- Comment #3 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- This table does handle column visibility a bit different than others - not sure it needs to stay that way, but worth looking into when tackling the project maybe. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37637 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37637 --- Comment #4 from Jonathan Druart <jonathan.druart@gmail.com> --- I was wondering we could reuse what have been done on bug 33568. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37637 --- Comment #5 from Sam Lau <samalau@gmail.com> --- (In reply to Jonathan Druart from comment #4)
I was wondering we could reuse what have been done on bug 33568.
Yes, a lot of that is being reused. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37637 Catrina Berka <catrina@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |catrina@bywatersolutions.co | |m -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37637 --- Comment #6 from Sam Lau <samalau@gmail.com> --- Created attachment 170482 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=170482&action=edit Bug 37637: Use the API to load the items table This patch removes the previous use of the database to load the additem table and instead uses the API. To test: 1) Test the current datatable behavior: visit an item's detail page and select 'Edit' then 'Edit items' 2) Apply the patches, restart_all, reset_all, clear caches, etc. 3) Again, test the table behaviors. Try adding items, using the actions, filtering and sorting the items, etc. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37637 --- Comment #7 from Sam Lau <samalau@gmail.com> --- Created attachment 170483 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=170483&action=edit Bug 37637: Hide the timestamp column by default -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37637 --- Comment #8 from Sam Lau <samalau@gmail.com> --- Here are some initial patches in need of review and heavy testing. Any feedback would be greatly appreciated. (In reply to Katrin Fischer from comment #3)
This table does handle column visibility a bit different than others - not sure it needs to stay that way, but worth looking into when tackling the project maybe.
I decided to switch the way this table handled column visibility to match that of the items table on the details page. I find this to be an improvement but if anyone disagrees, let me know. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37637 Sam Lau <samalau@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37637 holly@bywatersolutions.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |holly@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37637 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |34832 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34832 [Bug 34832] [OMNIBUS] API all the Tables! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37637 ByWater Sandboxes <bws.sandboxes@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #170483|0 |1 is obsolete| | --- Comment #9 from ByWater Sandboxes <bws.sandboxes@gmail.com> --- Created attachment 170507 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=170507&action=edit Bug 37637: Hide the timestamp column by default Signed-off-by: Catrina <catrina@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37637 Catrina Berka <catrina@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off --- Comment #10 from Catrina Berka <catrina@bywatersolutions.com> --- Adding items, filtering and sorting all work for me as expected. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37637 --- Comment #11 from Lucas Gass <lucas@bywatersolutions.com> --- Doesn't apply cleanly anymore. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37637 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Patch doesn't apply -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37637 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #170482|0 |1 is obsolete| | --- Comment #12 from Lucas Gass <lucas@bywatersolutions.com> --- Created attachment 170789 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=170789&action=edit Bug 37637: Use the API to load the items table This patch removes the previous use of the database to load the additem table and instead uses the API. To test: 1) Test the current datatable behavior: visit an item's detail page and select 'Edit' then 'Edit items' 2) Apply the patches, restart_all, reset_all, clear caches, etc. 3) Again, test the table behaviors. Try adding items, using the actions, filtering and sorting the items, etc. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37637 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #170507|0 |1 is obsolete| | --- Comment #13 from Lucas Gass <lucas@bywatersolutions.com> --- Created attachment 170790 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=170790&action=edit Bug 37637: Hide the timestamp column by default Signed-off-by: Catrina <catrina@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37637 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Failed QA --- Comment #14 from Lucas Gass <lucas@bywatersolutions.com> --- Rebased, but still needs more work due to Bootstrap changes. Action buttons no longer work. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37637 --- Comment #15 from Lucas Gass <lucas@bywatersolutions.com> --- Also, just like the catalog detail page the date_last_seen should be datetime. ( See 37688) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37637 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37637 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37637 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA --- Comment #16 from Jonathan Druart <jonathan.druart@gmail.com> --- The header is broken: https://snipboard.io/8pyjWM.jpg => Library columns should have a dropdown list for the filter => Headers are missing https://snipboard.io/zhOF5j.jpg => Column list is missing labels "Home library" actually displays barcodes. Please fix those obvious errors and I will try to come back. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37637 --- Comment #17 from Jonathan Druart <jonathan.druart@gmail.com> --- "Actions" menu is not opening -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37637 --- Comment #18 from Lucas Gass <lucas@bywatersolutions.com> --- Created attachment 171953 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=171953&action=edit Bug 37637: (follow-up) Fix action menu -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37637 Bug 37637 depends on bug 37639, which changed state. Bug 37639 Summary: items.stack ( shelving control number ) not included in items API endpoint https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37639 What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to main |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37637 Bug 37637 depends on bug 33568, which changed state. Bug 33568 Summary: Use the REST API to display items on the staff biblio detail view https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33568 What |Removed |Added ---------------------------------------------------------------------------- Status|Needs documenting |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org