Bug 32890

Summary: Add DataTables to curbside pickups
Product: Koha Reporter: Caroline Cyr La Rose <caroline.cyr-la-rose>
Component: TemplatesAssignee: Owen Leonard <oleonard>
Status: Signed Off --- QA Contact: Lucas Gass (lukeg) <lucas>
Severity: enhancement    
Priority: P5 - low CC: jonathan.druart, lucas
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32883
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on: 37761, 30650    
Bug Blocks:    
Attachments: Bug 32890: Add DataTables to curbside pickups
Bug 32890: Add DataTables to curbside pickups
Bug 32890: Add DataTables to curbside pickups

Description Caroline Cyr La Rose 2023-02-06 17:00:30 UTC
This comes from https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32883#c2 I'm creating a new bug report as it was outside the scope of the other one.

I suggested adding Datatables to the curbside pickup module, to be able to manage the ordering and the columns in table settings.

- "To be staged" tab
- "Staged & ready" tab
- "Patron is outside" tab
- "Delivered today" tab
Comment 1 Owen Leonard 2023-07-20 17:49:35 UTC Comment hidden (obsolete)
Comment 2 Caroline Cyr La Rose 2023-07-20 18:59:52 UTC Comment hidden (obsolete)
Comment 3 Caroline Cyr La Rose 2023-07-20 19:00:17 UTC
Much better! Thanks Owen!
Comment 4 Jonathan Druart 2023-09-01 12:30:15 UTC
Are not we then loosing the default sort we implemented on bug 32883?
Comment 5 Caroline Cyr La Rose 2023-09-01 12:50:37 UTC
Could the default ordering be the default, but then the user can change it if needed?
Comment 6 Caroline Cyr La Rose 2023-09-01 13:27:50 UTC
To be staged tab = default order should be on Pickup date/time soonest to latest

Staged & ready tab = default order should be on Pickup date/time soonest to latest

Patron is outside tab = default order should be on Pickup date/time soonest to latest

Delivered today tab = default sort should be on Deliver date/time soonest to latest (Jonathan mentioned this one was ordered by *desc*)
Comment 7 Owen Leonard 2023-10-06 14:37:11 UTC
I'm not sure I'm seeing the issue with the default sort under each tab. Can someone take another look?
Comment 8 Owen Leonard 2024-06-06 13:12:08 UTC
Created attachment 167542 [details] [review]
Bug 32890: Add DataTables to curbside pickups

This patch modifies the curbside pickups page in the staff interface so
that each table is a DataTable with configurable columns.

The patch also replaces the patron name output with patron-title.inc for
consistency and to display names 'surname, firstname' for correct
column sorting.

To test, apply the patch and restart services.

- Enable the CurbsidePickup system preference if necessary.
- Properly testing requires testing data. You can run this command to
  REPLACE your curbside pickup data with sample data:

  bash <(curl -s https://gitlab.com/-/snippets/2572579/raw/main/test_curbside_pickups.sh)

- Go to Circulation -> Curbside pickups.
  - Test DataTable functionality under each tab: sorting, paging,
    filtering, column visibility, and export.
- Go to Administration -> Table settings -> Circulation -> Curbside
  pickup
  - Confirm that changes made to the configuration of each of the
    4 curbside pickup tables is correctly applied on the curbside
    pickups page.

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Comment 9 Owen Leonard 2024-06-06 13:13:41 UTC
I've rebased this patch and I set it back to "Signed off" because I don't see any issue with the table sorting.
Comment 10 Lucas Gass (lukeg) 2024-08-28 14:44:16 UTC
I think everything looks good here except the Bootstrap 5 stuff is making the tables looks odd. 

I think just dropping the class="table table-striped" does the trick. 

Also, it looks like the tabs are not displaying well, I can file a different bug for that.