Bug 29896 - Sync the functionality of the datatables api wrapper on the OPAC with the Staff Client equivilent
Summary: Sync the functionality of the datatables api wrapper on the OPAC with the Sta...
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low trivial
Assignee: Martin Renvoize (ashimema)
QA Contact: Testopia
URL:
Keywords:
Depends on: 29408
Blocks:
  Show dependency treegraph
 
Reported: 2022-01-17 15:23 UTC by Martin Renvoize (ashimema)
Modified: 2022-01-17 15:48 UTC (History)
8 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
This patch 1) renames the 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.
Version(s) released in:
Circulation function:


Attachments
Bug 29896: Update datatables wrapper in the OPAC (2.17 KB, patch)
2022-01-17 15:46 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Renvoize (ashimema) 2022-01-17 15:23:32 UTC
+++ This bug was initially created as a clone of Bug #29408 +++

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);
Comment 1 Martin Renvoize (ashimema) 2022-01-17 15:33:27 UTC
Reworking this a bit.. lots of functionality is missing from the OPAC version
Comment 2 Martin Renvoize (ashimema) 2022-01-17 15:46:56 UTC
Created attachment 129540 [details] [review]
Bug 29896: Update datatables wrapper in the OPAC

This patch updates the datatables api wrapper from 'api' to 'kohaTable'
to match the function of the same intention with the name in the staff
client.
Comment 3 Martin Renvoize (ashimema) 2022-01-17 15:48:13 UTC
As far as I can tell.. this wrapper function isn't actually used anywhere in the OPAC as yet.. so I'll leave it here and when we come to use it I can pick the code back up again.

We need to implement the column ordering fixes, the match type fixes and the column filters fixes at some point.. assuming we need them at the OPAC.