Bug 38311

Summary: DataTables - Simplify the building of the dropdown list filters
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: Architecture, internals, and plumbingAssignee: Jonathan Druart <jonathan.druart>
Status: Pushed to main --- QA Contact: Matt Blenkinsop <matt.blenkinsop>
Severity: enhancement    
Priority: P5 - low CC: blawlor, lucas, matt.blenkinsop, oleonard, paul.derscheid, pedro.amorim
Version: unspecified   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38310
GIT URL: Initiative type: ---
Sponsorship status: --- Comma delimited list of Sponsors:
Crowdfunding goal: 0 Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
25.11.00
Circulation function:
Bug Depends on: 38201, 40565, 40709, 36640    
Bug Blocks:    
Attachments: Bug 38311: Do not use ID for column filters
Bug 38311: wip Vue
Bug 38311: Add dropdown list to column filters linked to an AV - Vue components
Bug 38311: Do not use ID for column filters
Bug 38311: Add dropdown list to column filters linked to an AV - Vue components
Bug 38311: Add dropdown list to column filters linked to an AV - Vue components
Bug 38311: Do not use ID for column filters
Bug 38311: Add dropdown list to column filters linked to an AV - Vue components
Bug 38311: Fix 'Bookings to collect'/pendingbookings
Bug 38311: Do not use ID for column filters
Bug 38311: Add dropdown list to column filters linked to an AV - Vue components
Bug 38311: Fix 'Bookings to collect'/pendingbookings
Bug 38311: Fix Selenium and Cypress tests

Description Jonathan Druart 2024-10-31 13:54:35 UTC
See "Bug 36640: Fix itemsearch", there is a lot of duplicated code to build the select nodes. We should refactor and simplify this code.

Same on the item list of the bib detail page.
Comment 1 Jonathan Druart 2025-07-31 13:48:03 UTC
Created attachment 184926 [details] [review]
Bug 38311: Do not use ID for column filters
Comment 2 Jonathan Druart 2025-07-31 13:48:05 UTC
Created attachment 184927 [details] [review]
Bug 38311: wip Vue
Comment 3 Jonathan Druart 2025-09-05 14:25:40 UTC
Created attachment 186209 [details] [review]
Bug 38311: Add dropdown list to column filters linked to an AV - Vue components
Comment 4 Jonathan Druart 2025-09-05 14:26:11 UTC Comment hidden (obsolete)
Comment 5 Jonathan Druart 2025-09-05 14:26:31 UTC
This is ready but blocked by parent bugs.
Comment 6 Jonathan Druart 2025-10-03 10:17:37 UTC
Created attachment 187376 [details] [review]
Bug 38311: Do not use ID for column filters
Comment 7 Jonathan Druart 2025-10-03 10:17:40 UTC
Created attachment 187377 [details] [review]
Bug 38311: Add dropdown list to column filters linked to an AV - Vue components
Comment 8 Jonathan Druart 2025-10-03 10:19:35 UTC
This is now ready for testing.
Comment 9 Jonathan Druart 2025-10-23 09:37:23 UTC
This is an easy one, it removes a bad pattern and improves the readability of the code. Can we get a signoff please?
Comment 10 Jonathan Druart 2025-10-23 09:48:56 UTC
Created attachment 188314 [details] [review]
Bug 38311: Add dropdown list to column filters linked to an AV - Vue components
Comment 11 Owen Leonard 2025-10-27 11:00:59 UTC
Created attachment 188468 [details] [review]
Bug 38311: Do not use ID for column filters

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 12 Owen Leonard 2025-10-27 11:01:02 UTC
Created attachment 188469 [details] [review]
Bug 38311: Add dropdown list to column filters linked to an AV - Vue components

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 13 Matt Blenkinsop 2025-10-28 09:22:37 UTC
Comment on attachment 188468 [details] [review]
Bug 38311: Do not use ID for column filters

Review of attachment 188468 [details] [review]:
-----------------------------------------------------------------

::: koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingbookings.tt
@@ +159,5 @@
>                  e['_str'] = e.branchname;
>                  return e;
>              });
>              let filters_options = {
> +                libraries: all_libraries,

Are we missing a dataFilter in a column definition here?
Comment 14 Jonathan Druart 2025-11-03 10:45:18 UTC
Created attachment 188924 [details] [review]
Bug 38311: Fix 'Bookings to collect'/pendingbookings

it was missing the dataFilter. Also needs coded_values to work correctly
(which needs to be defined outside of document.ready).
Comment 15 Jonathan Druart 2025-11-03 10:45:26 UTC
(In reply to Matt Blenkinsop from comment #13)
> Comment on attachment 188468 [details] [review] [review]
> Bug 38311: Do not use ID for column filters
> 
> Review of attachment 188468 [details] [review] [review]:
> -----------------------------------------------------------------
> 
> ::: koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingbookings.tt
> @@ +159,5 @@
> >                  e['_str'] = e.branchname;
> >                  return e;
> >              });
> >              let filters_options = {
> > +                libraries: all_libraries,
> 
> Are we missing a dataFilter in a column definition here?

Yes, good catch, thanks!
Comment 16 Matt Blenkinsop 2025-11-06 16:14:47 UTC
Created attachment 189184 [details] [review]
Bug 38311: Do not use ID for column filters

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk>
Comment 17 Matt Blenkinsop 2025-11-06 16:14:49 UTC
Created attachment 189185 [details] [review]
Bug 38311: Add dropdown list to column filters linked to an AV - Vue components

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk>
Comment 18 Matt Blenkinsop 2025-11-06 16:14:52 UTC
Created attachment 189186 [details] [review]
Bug 38311: Fix 'Bookings to collect'/pendingbookings

it was missing the dataFilter. Also needs coded_values to work correctly
(which needs to be defined outside of document.ready).

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk>
Comment 19 Lucas Gass (lukeg) 2025-12-01 19:55:04 UTC
Nice work everyone!

Pushed to main for 25.11
Comment 20 Jonathan Druart 2025-12-02 10:20:44 UTC
Created attachment 190071 [details] [review]
Bug 38311: Fix Selenium and Cypress tests

.dt-select-filter does no longer exist

Here we rely on DT's API to retrieve the correct visible column index.
However we cannot for Selenium tests, not ideal but it fixes the
failure.
Comment 21 Lucas Gass (lukeg) 2025-12-02 17:08:32 UTC
follow-up pushed to main