[Bug 29408] New: The datatables api wrapper is badly named
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29408 Bug ID: 29408 Summary: The datatables api wrapper is badly named Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: martin.renvoize@ptfs-europe.com QA Contact: testopia@bugs.koha-community.org The dataTables Koha REST wrapper we added recently is badly named.. currently, it's the very unspecific 'api'.. we should start using a consistent naming convention for such JS wrapper functions. In bug 29397 we introduce a minimal select2 wrapper and call it kohaSelect.. I propose we take that as inspiration and rename the dataTables function from 'api' to 'kohaTable'. Thus, creating a new API driven dataTable would become: $(".selector").kohaTable(usual stuff here); -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29408 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |martin.renvoize@ptfs-europe |ity.org |.com -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29408 --- Comment #1 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 127272 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=127272&action=edit Bug 29408: Rename Koha dataTables wrapper This patch renames the Koha REST JS dataTables wrapper from the ambigious 'api' to the clearer 'kohaTable'. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29408 --- Comment #2 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 127273 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=127273&action=edit Bug 29408: Update all existing uses of .api to .kohaTable This patch goes through the codebase and updates existing revelant calls to .api referencing the Koha REST dataTables wrapper to use the name name 'kohaTable'. Test plan. 1) Ensure the tables on the following pages all continue to work as expected a) acqui/parcel b) admin/branches c) admin/cities d) admin/smtp_servers e) pos/register f) tools/quotes Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29408 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|enhancement |trivial -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29408 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart+koha@gmail. | |com, 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=29408 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29408 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=29397 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29408 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com, | |oleonard@myacpl.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29408 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|The datatables api wrapper |The datatables api wrapper |is badly named |is ambiguously named -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29408 --- Comment #3 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 127274 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=127274&action=edit Bug 29408: Begginings of JSDoc documentation I'd love to see the parameters clearly documented... I've started it off but need some help. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29408 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #127272|0 |1 is obsolete| | --- Comment #4 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 127282 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=127282&action=edit Bug 29408: Rename Koha dataTables wrapper This patch renames the Koha REST JS dataTables wrapper from the ambigious 'api' to the clearer 'kohaTable'. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29408 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #127273|0 |1 is obsolete| | --- Comment #5 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 127283 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=127283&action=edit Bug 29408: Update all existing uses of .api to .kohaTable This patch goes through the codebase and updates existing revelant calls to .api referencing the Koha REST dataTables wrapper to use the name name 'kohaTable'. Test plan. 1) Ensure the tables on the following pages all continue to work as expected a) acqui/parcel b) admin/branches c) admin/cities d) admin/smtp_servers e) pos/register f) tools/quotes Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29408 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #127274|0 |1 is obsolete| | --- Comment #6 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 127284 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=127284&action=edit Bug 29408: Begginings of JSDoc documentation I'd love to see the parameters clearly documented... I've started it off but need some help. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29408 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29408 --- Comment #7 from Tomás Cohen Arazi <tomascohen@gmail.com> --- I did git grep '\.api(' and the cases I found are correct (i.e. JS accessing the .api() method from DataTables. All looks good and works as before this patchset. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29408 --- Comment #8 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Thanks for testing.. yup, those two calls to .api( that still exist are one of the reasons I was really keen to make this change :-). -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29408 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kyle@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29408 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |kyle@bywatersolutions.com |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29408 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29408 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #127282|0 |1 is obsolete| | Attachment #127283|0 |1 is obsolete| | Attachment #127284|0 |1 is obsolete| | --- Comment #9 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 127290 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=127290&action=edit Bug 29408: Rename Koha dataTables wrapper This patch renames the Koha REST JS dataTables wrapper from the ambigious 'api' to the clearer 'kohaTable'. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29408 --- Comment #10 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 127291 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=127291&action=edit Bug 29408: Update all existing uses of .api to .kohaTable This patch goes through the codebase and updates existing revelant calls to .api referencing the Koha REST dataTables wrapper to use the name name 'kohaTable'. Test plan. 1) Ensure the tables on the following pages all continue to work as expected a) acqui/parcel b) admin/branches c) admin/cities d) admin/smtp_servers e) pos/register f) tools/quotes Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29408 --- Comment #11 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 127292 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=127292&action=edit Bug 29408: Beginnings of JSDoc documentation I'd love to see the parameters clearly documented... I've started it off but need some help. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29408 --- Comment #12 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- We already have "KohaTable", isn't this more ambiguous? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29408 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Signed Off --- Comment #13 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- (In reply to Jonathan Druart from comment #12)
We already have "KohaTable", isn't this more ambiguous?
I think the difference between `KohaTable('selector', settings)` and `$('selector').kohaTable(settings)` is clearer than the current `$('selector').api(settings)`.. what is `.api()`.. the jQuery API, the selected elements api.. it also doesn't help that datatables itself has an api() method to get back the datatables api object. I think we should slowly be migrating from template-driven datatables (KohaTable) to api driven datatable (kohaTable).. so to me, the similarity is deliberate and the distinction is clear. Also, by starting to add JSDoc, my hope is people will reach for kohaTable first in the future ;) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29408 --- Comment #14 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- I do have a couple of improvements to make on that last patch though.. I clarified a few things with Tomas this morning, but Kyle was super quick to review what was already there before I got to update it ;) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29408 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #127290|0 |1 is obsolete| | --- Comment #15 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 127313 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=127313&action=edit Bug 29408: Rename Koha dataTables wrapper This patch renames the Koha REST JS dataTables wrapper from the ambigious 'api' to the clearer 'kohaTable'. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29408 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #127291|0 |1 is obsolete| | --- Comment #16 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 127314 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=127314&action=edit Bug 29408: Update all existing uses of .api to .kohaTable This patch goes through the codebase and updates existing revelant calls to .api referencing the Koha REST dataTables wrapper to use the name name 'kohaTable'. Test plan. 1) Ensure the tables on the following pages all continue to work as expected a) acqui/parcel b) admin/branches c) admin/cities d) admin/smtp_servers e) pos/register f) tools/quotes Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29408 --- Comment #17 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 127315 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=127315&action=edit Bug 29408: Add JSDoc documentation for kohaTable function This patch adds some JSDoc formatted parameter documentation for the kohaTable function. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29408 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #127292|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29408 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29408 --- Comment #18 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Amendments to documentation made, with agreements from Tomas.. back to PQA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29408 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |29302 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29302 [Bug 29302] The dataTables Koha RESTful API wrapper should allow picking match type at the column level -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29408 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |29422 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29422 [Bug 29422] Add additional match types to dataTables api wrapper -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29408 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks|29422 | Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29422 [Bug 29422] Add additional match types to dataTables api wrapper -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29408 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |21.11.00 released in| | Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29408 --- Comment #19 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Pushed to master for 21.11, thanks to everybody involved! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29408 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |28854 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28854 [Bug 28854] [ALTERNATIVE] Add ability to create bundles of items -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29408 --- Comment #20 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Steps forward! \o/ -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29408 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |This patch 1) renames the release notes| |Koha REST JS dataTables | |wrapper from the | |ambiguous | |'api' to the clearer | |'kohaTable' 2) goes through | |the codebase and updates | |existing relevant calls to | |.api referencing the Koha | |REST dataTables wrapper to | |use the name 'kohaTable', | |and 3) adds JSDoc formatted | |parameter documentation for | |the kohaTable function. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29408 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au --- Comment #21 from David Cook <dcook@prosentient.com.au> --- (In reply to Martin Renvoize from comment #13)
I think we should slowly be migrating from template-driven datatables (KohaTable) to api driven datatable (kohaTable).. so to me, the similarity is deliberate and the distinction is clear.
Agreed and much appreciated! The .api() method name was driving me crazy. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29408 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|21.11.00 |21.11.00,21.05.05 released in| | Status|Pushed to master |Pushed to stable --- Comment #22 from Kyle M Hall <kyle@bywatersolutions.com> --- Pushed to 21.05.x for 21.05.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29408 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m --- Comment #23 from Fridolin Somers <fridolin.somers@biblibre.com> --- Shouldn't we also change in koha-tmpl/opac-tmpl/bootstrap/js/datatables.js ? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29408 --- Comment #24 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Good call... I didn't actually realise we had the api wrapper on the opac as yet... We need a better way of keeping files like this in sync.. I'd put money on there being other bits of the wrapper that are already out of sync -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29408 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |RESOLVED Resolution|--- |FIXED CC| |victor@tuxayo.net --- Comment #25 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Not backported to oldoldstable (20.11.x). Feel free to ask if it's needed. (and if the above comments are followed upon) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29408 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |29896 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29896 [Bug 29896] The datatables api wrapper is ambiguously named - OPAC -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org