Bug 38255 - Do not use dataTable constructor directly
Summary: Do not use dataTable constructor directly
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Jonathan Druart
QA Contact: Martin Renvoize (ashimema)
URL:
Keywords: roadmap_25_05
Depends on: 36640 38596
Blocks: 26553 38440
  Show dependency treegraph
 
Reported: 2024-10-24 09:38 UTC by Jonathan Druart
Modified: 2025-01-28 11:28 UTC (History)
8 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 38255: Replace dataTable constructor with kohaTable - Staff (135.30 KB, patch)
2024-12-04 13:45 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 38255: Replace dataTable constructor with kohaTable - OPAC (23.27 KB, patch)
2024-12-04 13:45 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 38255: Add kohaTable - OPAC (12.91 KB, patch)
2024-12-04 13:45 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 38255: Early return if the node does not exist (1.04 KB, patch)
2024-12-04 13:45 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 38255: Exceptions (3.93 KB, patch)
2024-12-04 13:45 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 38255: Fix JS error (2.12 KB, patch)
2024-12-10 14:27 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 38255: Exception - Manage staged MARC records (1013 bytes, patch)
2024-12-17 09:53 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 38255: Allow instantiation without parameters (4.23 KB, patch)
2024-12-17 09:53 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 38255: Exception - Item search (936 bytes, patch)
2024-12-21 12:17 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 38255: (follow-up) Replace dataTable constructor with kohaTable - Staff (5.07 KB, patch)
2024-12-21 12:22 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 38255: Replace dataTable constructor with kohaTable - Staff (135.17 KB, patch)
2025-01-02 15:38 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 38255: Replace dataTable constructor with kohaTable - OPAC (23.27 KB, patch)
2025-01-02 15:38 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 38255: Add kohaTable - OPAC (12.91 KB, patch)
2025-01-02 15:38 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 38255: Early return if the node does not exist (1.04 KB, patch)
2025-01-02 15:39 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 38255: Exceptions (3.93 KB, patch)
2025-01-02 15:39 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 38255: Fix JS error (2.12 KB, patch)
2025-01-02 15:39 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 38255: Exception - Manage staged MARC records (1013 bytes, patch)
2025-01-02 15:39 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 38255: Allow instantiation without parameters (4.23 KB, patch)
2025-01-02 15:40 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 38255: Exception - Item search (936 bytes, patch)
2025-01-02 15:40 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 38255: (follow-up) Replace dataTable constructor with kohaTable - Staff (5.07 KB, patch)
2025-01-02 15:40 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 38255: Fix Cash registers (2.26 KB, patch)
2025-01-06 09:16 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 38255: Replace dataTable constructor with kohaTable - Staff (135.23 KB, patch)
2025-01-10 14:53 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 38255: Replace dataTable constructor with kohaTable - OPAC (23.32 KB, patch)
2025-01-10 14:53 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 38255: Add kohaTable - OPAC (12.96 KB, patch)
2025-01-10 14:53 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 38255: Early return if the node does not exist (1.09 KB, patch)
2025-01-10 14:53 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 38255: Exceptions (3.99 KB, patch)
2025-01-10 14:53 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 38255: Fix JS error (2.18 KB, patch)
2025-01-10 14:53 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 38255: Exception - Manage staged MARC records (1.04 KB, patch)
2025-01-10 14:53 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 38255: Allow instantiation without parameters (4.28 KB, patch)
2025-01-10 14:53 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 38255: Exception - Item search (991 bytes, patch)
2025-01-10 14:53 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 38255: (follow-up) Replace dataTable constructor with kohaTable - Staff (5.12 KB, patch)
2025-01-10 14:53 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 38255: Fix Cash registers (2.32 KB, patch)
2025-01-10 14:53 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 38255: Replace dataTable constructor with kohaTable - Staff (134.91 KB, patch)
2025-01-15 11:30 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 38255: Replace dataTable constructor with kohaTable - OPAC (23.32 KB, patch)
2025-01-15 11:30 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 38255: Add kohaTable - OPAC (12.96 KB, patch)
2025-01-15 11:30 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 38255: Early return if the node does not exist (1.09 KB, patch)
2025-01-15 11:30 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 38255: Exceptions (3.99 KB, patch)
2025-01-15 11:30 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 38255: Fix JS error (2.18 KB, patch)
2025-01-15 11:30 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 38255: Exception - Manage staged MARC records (1.04 KB, patch)
2025-01-15 11:30 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 38255: Allow instantiation without parameters (4.28 KB, patch)
2025-01-15 11:30 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 38255: Exception - Item search (991 bytes, patch)
2025-01-15 11:30 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 38255: (follow-up) Replace dataTable constructor with kohaTable - Staff (5.12 KB, patch)
2025-01-15 11:30 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 38255: Fix Cash registers (2.32 KB, patch)
2025-01-15 11:30 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 38255: Replace dataTable constructor with kohaTable - Staff (135.03 KB, patch)
2025-01-23 20:23 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 38255: Replace dataTable constructor with kohaTable - OPAC (23.32 KB, patch)
2025-01-23 20:24 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 38255: Add kohaTable - OPAC (12.96 KB, patch)
2025-01-23 20:24 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 38255: Early return if the node does not exist (1.09 KB, patch)
2025-01-23 20:24 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 38255: Exceptions (3.99 KB, patch)
2025-01-23 20:24 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 38255: Fix JS error (2.18 KB, patch)
2025-01-23 20:24 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 38255: Exception - Manage staged MARC records (1.04 KB, patch)
2025-01-23 20:24 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 38255: Allow instantiation without parameters (4.28 KB, patch)
2025-01-23 20:24 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 38255: Exception - Item search (991 bytes, patch)
2025-01-23 20:24 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 38255: (follow-up) Replace dataTable constructor with kohaTable - Staff (5.12 KB, patch)
2025-01-23 20:24 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 38255: Fix Cash registers (2.32 KB, patch)
2025-01-23 20:24 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 38255: Replace dataTable constructor with kohaTable - Staff (134.67 KB, patch)
2025-01-28 08:35 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 38255: Replace dataTable constructor with kohaTable - OPAC (23.32 KB, patch)
2025-01-28 08:35 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 38255: Add kohaTable - OPAC (12.96 KB, patch)
2025-01-28 08:35 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 38255: Early return if the node does not exist (1.09 KB, patch)
2025-01-28 08:36 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 38255: Exceptions (3.99 KB, patch)
2025-01-28 08:36 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 38255: Fix JS error (2.18 KB, patch)
2025-01-28 08:36 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 38255: Exception - Manage staged MARC records (1.04 KB, patch)
2025-01-28 08:36 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 38255: Allow instantiation without parameters (4.28 KB, patch)
2025-01-28 08:36 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 38255: Exception - Item search (991 bytes, patch)
2025-01-28 08:36 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 38255: (follow-up) Replace dataTable constructor with kohaTable - Staff (5.12 KB, patch)
2025-01-28 08:36 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 38255: Fix Cash registers (2.32 KB, patch)
2025-01-28 08:36 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 38255: Fix additional-contents (2.67 KB, patch)
2025-01-28 11:24 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2024-10-24 09:38:42 UTC
We should not use dataTable() but our own KohaTable or kohaTable.

It will help to get rid of repeated rules (eg. NoSort).
Comment 1 Jonathan Druart 2024-12-04 13:45:07 UTC
Created attachment 175181 [details] [review]
Bug 38255: Replace dataTable constructor with kohaTable - Staff
Comment 2 Jonathan Druart 2024-12-04 13:45:09 UTC
Created attachment 175182 [details] [review]
Bug 38255: Replace dataTable constructor with kohaTable - OPAC
Comment 3 Jonathan Druart 2024-12-04 13:45:12 UTC
Created attachment 175183 [details] [review]
Bug 38255: Add kohaTable - OPAC
Comment 4 Jonathan Druart 2024-12-04 13:45:14 UTC
Created attachment 175184 [details] [review]
Bug 38255: Early return if the node does not exist
Comment 5 Jonathan Druart 2024-12-04 13:45:17 UTC
Created attachment 175185 [details] [review]
Bug 38255: Exceptions

Those tables are using a svc script, not the REST API. It is not compatible
with kohaTable's default 'ajax' options.
Comment 6 Jonathan Druart 2024-12-04 13:53:57 UTC
We are removing the occurrences of instantiations of dataTable(), and replace them with our own kohaTable.

To make this possible we:
1. Set the default ajax options (_dt_default_ajax from datatables.js) only if an 'ajax' option is passed already
2. Simply replace 'dataTable' with 'kohaTable', and remove the merge with dataTablesDefaults (we do it already in datatables.js)
3. Introduce kohaTable at the OPAC (a shorter version of what we have staff-side as we provide less features)
4. Deal with the svc script, see the "Exceptions" patch: we pass a flag "bKohaAjaxSVC" to tell to not inject the default ajax options even if we using server-side processing (should be remove in the future, and not be used by new patches).

Test plan:
Test some of the tables modified by this patchset and search for errors/regressions

QA note: this patch introduces way more changes than needed, I wanted to indent correctly the kohaTable block to catch potential syntax error. Happened when I forgot to remove the extra parenthesis:
-            }));
+            });
Comment 7 Jonathan Druart 2024-12-04 14:07:49 UTC
QA:
  `git grep '\.dataTable(' ':(exclude)*datatables*.js'|wc -l`
must return 0
Comment 8 Owen Leonard 2024-12-05 18:50:50 UTC
I'm still going through all the changes, but I ran into this when I opened the "Clubs" tab from the patron detail page:

Uncaught SyntaxError: redeclaration of let clubs_dt_params
Comment 9 Jonathan Druart 2024-12-10 14:27:57 UTC
Created attachment 175352 [details] [review]
Bug 38255: Fix JS error

Uncaught SyntaxError: redeclaration of let
Comment 10 Owen Leonard 2024-12-16 18:24:00 UTC
I only found a few other problems:

- Manage staged MARC records - The table of staged MARC records isn't loading. There isn't an error in the console, but the table info says "No entries to show (filtered from NaN total entries)"

- OPAC -> User's account -> Charges. "Uncaught TypeError: can't access property "cell", s[(a + i)][r] is undefined"

- OPAC -> User's account -> Alert subscriptions: "Uncaught TypeError: can't access property "buttons", settings is null"
Comment 11 Jonathan Druart 2024-12-17 09:53:27 UTC
Created attachment 175598 [details] [review]
Bug 38255: Exception - Manage staged MARC records
Comment 12 Jonathan Druart 2024-12-17 09:53:30 UTC
Created attachment 175599 [details] [review]
Bug 38255: Allow instantiation without parameters

`$(node).kohaTable()` should work.

Without this patch we got `Uncaught TypeError: settings is null`
Comment 13 Jonathan Druart 2024-12-17 09:54:37 UTC
(In reply to Owen Leonard from comment #10)
> I only found a few other problems:

Nice ones, thanks a lot!

> - Manage staged MARC records - The table of staged MARC records isn't
> loading. There isn't an error in the console, but the table info says "No
> entries to show (filtered from NaN total entries)"

Fixed in "Exception - Manage staged MARC records"

> - OPAC -> User's account -> Charges. "Uncaught TypeError: can't access
> property "cell", s[(a + i)][r] is undefined"

I don't recreate this one! What do you have in the table?

> - OPAC -> User's account -> Alert subscriptions: "Uncaught TypeError: can't
> access property "buttons", settings is null"

This one was hiding something bigger.

Fixed in "Allow instantiation without parameters"
Comment 14 Owen Leonard 2024-12-19 13:09:54 UTC
> > - OPAC -> User's account -> Charges. "Uncaught TypeError: can't access
> > property "cell", s[(a + i)][r] is undefined"
> 
> I don't recreate this one! What do you have in the table?

I'm not exactly sure what data is required to trigger it, but this is Bug 38753.
Comment 15 Jonathan Druart 2024-12-21 12:17:59 UTC
Created attachment 175872 [details] [review]
Bug 38255: Exception - Item search
Comment 16 Jonathan Druart 2024-12-21 12:22:15 UTC
Created attachment 175873 [details] [review]
Bug 38255: (follow-up) Replace dataTable constructor with kohaTable - Staff
Comment 17 Jonathan Druart 2025-01-02 15:38:22 UTC
Created attachment 176062 [details] [review]
Bug 38255: Replace dataTable constructor with kohaTable - Staff
Comment 18 Jonathan Druart 2025-01-02 15:38:33 UTC
Created attachment 176063 [details] [review]
Bug 38255: Replace dataTable constructor with kohaTable - OPAC
Comment 19 Jonathan Druart 2025-01-02 15:38:57 UTC
Created attachment 176064 [details] [review]
Bug 38255: Add kohaTable - OPAC
Comment 20 Jonathan Druart 2025-01-02 15:39:09 UTC
Created attachment 176065 [details] [review]
Bug 38255: Early return if the node does not exist
Comment 21 Jonathan Druart 2025-01-02 15:39:29 UTC
Created attachment 176066 [details] [review]
Bug 38255: Exceptions

Those tables are using a svc script, not the REST API. It is not compatible
with kohaTable's default 'ajax' options.
Comment 22 Jonathan Druart 2025-01-02 15:39:42 UTC
Created attachment 176067 [details] [review]
Bug 38255: Fix JS error

Uncaught SyntaxError: redeclaration of let
Comment 23 Jonathan Druart 2025-01-02 15:39:51 UTC
Created attachment 176068 [details] [review]
Bug 38255: Exception - Manage staged MARC records
Comment 24 Jonathan Druart 2025-01-02 15:40:01 UTC
Created attachment 176069 [details] [review]
Bug 38255: Allow instantiation without parameters

`$(node).kohaTable()` should work.

Without this patch we got `Uncaught TypeError: settings is null`
Comment 25 Jonathan Druart 2025-01-02 15:40:31 UTC
Created attachment 176070 [details] [review]
Bug 38255: Exception - Item search
Comment 26 Jonathan Druart 2025-01-02 15:40:46 UTC
Created attachment 176071 [details] [review]
Bug 38255: (follow-up) Replace dataTable constructor with kohaTable - Staff
Comment 27 Jonathan Druart 2025-01-02 15:43:50 UTC
Patches rebased.
Comment 28 Lucas Gass (lukeg) 2025-01-02 23:38:11 UTC
I've tested almost all staff interface tables. Only one problem stood out to me 

1 .admin/cash_registers.pl
    -Change Filter by Library 
    -Uncaught TypeError: table.column is not a function


I have yet to test any OPAC tables.
Comment 29 Lucas Gass (lukeg) 2025-01-03 18:00:34 UTC
Going through the OPAC tables, everything seems good.
Comment 30 Jonathan Druart 2025-01-06 09:16:31 UTC
Created attachment 176146 [details] [review]
Bug 38255: Fix Cash registers

This patch fixes the following error:
 Uncaught TypeError: table.column is not a function

We needed to pass table.DataTable() to filterDataTable
I've decided to clean the code as it does not make sense to me:
filterDataTable is called from a single place, and clearFilter is not
needed (we should not interfer with the 'Clear filter' button here)
Comment 31 Lucas Gass (lukeg) 2025-01-10 14:53:10 UTC
Created attachment 176348 [details] [review]
Bug 38255: Replace dataTable constructor with kohaTable - Staff

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 32 Lucas Gass (lukeg) 2025-01-10 14:53:12 UTC
Created attachment 176349 [details] [review]
Bug 38255: Replace dataTable constructor with kohaTable - OPAC

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 33 Lucas Gass (lukeg) 2025-01-10 14:53:14 UTC
Created attachment 176350 [details] [review]
Bug 38255: Add kohaTable - OPAC

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 34 Lucas Gass (lukeg) 2025-01-10 14:53:17 UTC
Created attachment 176351 [details] [review]
Bug 38255: Early return if the node does not exist

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 35 Lucas Gass (lukeg) 2025-01-10 14:53:19 UTC
Created attachment 176352 [details] [review]
Bug 38255: Exceptions

Those tables are using a svc script, not the REST API. It is not compatible
with kohaTable's default 'ajax' options.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 36 Lucas Gass (lukeg) 2025-01-10 14:53:21 UTC
Created attachment 176353 [details] [review]
Bug 38255: Fix JS error

Uncaught SyntaxError: redeclaration of let

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 37 Lucas Gass (lukeg) 2025-01-10 14:53:24 UTC
Created attachment 176354 [details] [review]
Bug 38255: Exception - Manage staged MARC records

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 38 Lucas Gass (lukeg) 2025-01-10 14:53:26 UTC
Created attachment 176355 [details] [review]
Bug 38255: Allow instantiation without parameters

`$(node).kohaTable()` should work.

Without this patch we got `Uncaught TypeError: settings is null`

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 39 Lucas Gass (lukeg) 2025-01-10 14:53:29 UTC
Created attachment 176356 [details] [review]
Bug 38255: Exception - Item search

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 40 Lucas Gass (lukeg) 2025-01-10 14:53:31 UTC
Created attachment 176357 [details] [review]
Bug 38255: (follow-up) Replace dataTable constructor with kohaTable - Staff

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 41 Lucas Gass (lukeg) 2025-01-10 14:53:33 UTC
Created attachment 176358 [details] [review]
Bug 38255: Fix Cash registers

This patch fixes the following error:
 Uncaught TypeError: table.column is not a function

We needed to pass table.DataTable() to filterDataTable
I've decided to clean the code as it does not make sense to me:
filterDataTable is called from a single place, and clearFilter is not
needed (we should not interfer with the 'Clear filter' button here)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 42 Jonathan Druart 2025-01-15 11:30:13 UTC
Created attachment 176550 [details] [review]
Bug 38255: Replace dataTable constructor with kohaTable - Staff

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 43 Jonathan Druart 2025-01-15 11:30:17 UTC
Created attachment 176551 [details] [review]
Bug 38255: Replace dataTable constructor with kohaTable - OPAC

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 44 Jonathan Druart 2025-01-15 11:30:20 UTC
Created attachment 176552 [details] [review]
Bug 38255: Add kohaTable - OPAC

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 45 Jonathan Druart 2025-01-15 11:30:23 UTC
Created attachment 176553 [details] [review]
Bug 38255: Early return if the node does not exist

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 46 Jonathan Druart 2025-01-15 11:30:26 UTC
Created attachment 176554 [details] [review]
Bug 38255: Exceptions

Those tables are using a svc script, not the REST API. It is not compatible
with kohaTable's default 'ajax' options.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 47 Jonathan Druart 2025-01-15 11:30:30 UTC
Created attachment 176555 [details] [review]
Bug 38255: Fix JS error

Uncaught SyntaxError: redeclaration of let

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 48 Jonathan Druart 2025-01-15 11:30:33 UTC
Created attachment 176556 [details] [review]
Bug 38255: Exception - Manage staged MARC records

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 49 Jonathan Druart 2025-01-15 11:30:36 UTC
Created attachment 176557 [details] [review]
Bug 38255: Allow instantiation without parameters

`$(node).kohaTable()` should work.

Without this patch we got `Uncaught TypeError: settings is null`

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 50 Jonathan Druart 2025-01-15 11:30:39 UTC
Created attachment 176558 [details] [review]
Bug 38255: Exception - Item search

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 51 Jonathan Druart 2025-01-15 11:30:42 UTC
Created attachment 176559 [details] [review]
Bug 38255: (follow-up) Replace dataTable constructor with kohaTable - Staff

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 52 Jonathan Druart 2025-01-15 11:30:46 UTC
Created attachment 176560 [details] [review]
Bug 38255: Fix Cash registers

This patch fixes the following error:
 Uncaught TypeError: table.column is not a function

We needed to pass table.DataTable() to filterDataTable
I've decided to clean the code as it does not make sense to me:
filterDataTable is called from a single place, and clearFilter is not
needed (we should not interfer with the 'Clear filter' button here)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 53 Jonathan Druart 2025-01-23 20:23:58 UTC
Created attachment 177076 [details] [review]
Bug 38255: Replace dataTable constructor with kohaTable - Staff

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 54 Jonathan Druart 2025-01-23 20:24:02 UTC
Created attachment 177077 [details] [review]
Bug 38255: Replace dataTable constructor with kohaTable - OPAC

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 55 Jonathan Druart 2025-01-23 20:24:05 UTC
Created attachment 177078 [details] [review]
Bug 38255: Add kohaTable - OPAC

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 56 Jonathan Druart 2025-01-23 20:24:08 UTC
Created attachment 177079 [details] [review]
Bug 38255: Early return if the node does not exist

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 57 Jonathan Druart 2025-01-23 20:24:12 UTC
Created attachment 177080 [details] [review]
Bug 38255: Exceptions

Those tables are using a svc script, not the REST API. It is not compatible
with kohaTable's default 'ajax' options.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 58 Jonathan Druart 2025-01-23 20:24:15 UTC
Created attachment 177081 [details] [review]
Bug 38255: Fix JS error

Uncaught SyntaxError: redeclaration of let

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 59 Jonathan Druart 2025-01-23 20:24:18 UTC
Created attachment 177082 [details] [review]
Bug 38255: Exception - Manage staged MARC records

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 60 Jonathan Druart 2025-01-23 20:24:21 UTC
Created attachment 177083 [details] [review]
Bug 38255: Allow instantiation without parameters

`$(node).kohaTable()` should work.

Without this patch we got `Uncaught TypeError: settings is null`

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 61 Jonathan Druart 2025-01-23 20:24:24 UTC
Created attachment 177084 [details] [review]
Bug 38255: Exception - Item search

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 62 Jonathan Druart 2025-01-23 20:24:27 UTC
Created attachment 177085 [details] [review]
Bug 38255: (follow-up) Replace dataTable constructor with kohaTable - Staff

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 63 Jonathan Druart 2025-01-23 20:24:30 UTC
Created attachment 177086 [details] [review]
Bug 38255: Fix Cash registers

This patch fixes the following error:
 Uncaught TypeError: table.column is not a function

We needed to pass table.DataTable() to filterDataTable
I've decided to clean the code as it does not make sense to me:
filterDataTable is called from a single place, and clearFilter is not
needed (we should not interfer with the 'Clear filter' button here)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 64 Jonathan Druart 2025-01-23 20:24:54 UTC
just a rebase.
Comment 65 Jonathan Druart 2025-01-28 08:35:53 UTC
Created attachment 177214 [details] [review]
Bug 38255: Replace dataTable constructor with kohaTable - Staff

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 66 Jonathan Druart 2025-01-28 08:35:56 UTC
Created attachment 177215 [details] [review]
Bug 38255: Replace dataTable constructor with kohaTable - OPAC

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 67 Jonathan Druart 2025-01-28 08:35:59 UTC
Created attachment 177216 [details] [review]
Bug 38255: Add kohaTable - OPAC

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 68 Jonathan Druart 2025-01-28 08:36:03 UTC
Created attachment 177217 [details] [review]
Bug 38255: Early return if the node does not exist

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 69 Jonathan Druart 2025-01-28 08:36:06 UTC
Created attachment 177218 [details] [review]
Bug 38255: Exceptions

Those tables are using a svc script, not the REST API. It is not compatible
with kohaTable's default 'ajax' options.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 70 Jonathan Druart 2025-01-28 08:36:09 UTC
Created attachment 177219 [details] [review]
Bug 38255: Fix JS error

Uncaught SyntaxError: redeclaration of let

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 71 Jonathan Druart 2025-01-28 08:36:13 UTC
Created attachment 177220 [details] [review]
Bug 38255: Exception - Manage staged MARC records

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 72 Jonathan Druart 2025-01-28 08:36:16 UTC
Created attachment 177221 [details] [review]
Bug 38255: Allow instantiation without parameters

`$(node).kohaTable()` should work.

Without this patch we got `Uncaught TypeError: settings is null`

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 73 Jonathan Druart 2025-01-28 08:36:19 UTC
Created attachment 177222 [details] [review]
Bug 38255: Exception - Item search

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 74 Jonathan Druart 2025-01-28 08:36:22 UTC
Created attachment 177223 [details] [review]
Bug 38255: (follow-up) Replace dataTable constructor with kohaTable - Staff

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 75 Jonathan Druart 2025-01-28 08:36:26 UTC
Created attachment 177224 [details] [review]
Bug 38255: Fix Cash registers

This patch fixes the following error:
 Uncaught TypeError: table.column is not a function

We needed to pass table.DataTable() to filterDataTable
I've decided to clean the code as it does not make sense to me:
filterDataTable is called from a single place, and clearFilter is not
needed (we should not interfer with the 'Clear filter' button here)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 76 Jonathan Druart 2025-01-28 08:36:39 UTC
Yet another rebase.
Comment 77 Jonathan Druart 2025-01-28 11:24:55 UTC
Created attachment 177262 [details] [review]
Bug 38255: Fix additional-contents