Bug 35648 - Allow sorting of patron categories in overdue notice/status triggers
Summary: Allow sorting of patron categories in overdue notice/status triggers
Status: Needs documenting
Alias: None
Product: Koha
Classification: Unclassified
Component: Tools (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Owen Leonard
QA Contact: Kyle M Hall (khall)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-12-23 22:26 UTC by Juliet Heltibridle
Modified: 2024-05-24 15:06 UTC (History)
4 users (show)

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


Attachments
Bug 35648: Allow sorting of patron categories in Overdue notice/status triggers (3.28 KB, patch)
2024-01-03 11:50 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 35648: Allow sorting of patron categories in Overdue notice/status triggers (3.32 KB, patch)
2024-01-03 17:57 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 35648: Allow sorting of patron categories in Overdue notice/status triggers (3.38 KB, patch)
2024-01-03 18:54 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 35648: (follow-up) Clear table filter before submitting (1.82 KB, patch)
2024-03-22 13:10 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 35648: (follow-up) Remove sorting from transport columns (1.66 KB, patch)
2024-05-03 17:15 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 35648: Allow sorting of patron categories in Overdue notice/status triggers (3.43 KB, patch)
2024-05-07 16:40 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 35648: (follow-up) Clear table filter before submitting (1.88 KB, patch)
2024-05-07 16:40 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 35648: (follow-up) Remove sorting from transport columns (1.71 KB, patch)
2024-05-07 16:40 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Juliet Heltibridle 2023-12-23 22:26:15 UTC
It would be really helpful to be able to choose the sorting method on the Overdue notice/status triggers page. Currently, the patron categories are sorted by Code. We include the branch name at the start of the Category name. If we could sort by that instead of the Code, we could find our branch's patron categories much quicker in order to make changes.
Comment 1 Owen Leonard 2024-01-03 11:50:24 UTC
Created attachment 160455 [details] [review]
Bug 35648: Allow sorting of patron categories in Overdue notice/status triggers

This patch adds a basic DataTables configuration to the table of patron
categories on the Overdue notice/status triggers page. The table can be
sorted by patron category and can be filtered.

To test, apply the patch and go to Tools -> Overdue notice/status
triggers.

- Confirm that the table of patron categories is sorted by default by
   patron category
- Other columns should not be sortable
- You should see a search field above the table which works to filter by
  patron category.
Comment 2 Lucas Gass (lukeg) 2024-01-03 16:22:01 UTC
Owen,

This is nice but the dataTable only applies to the first table. The 2nd and 3rd table do not become dataTables. 

We actually have invalid HTML on this page because the table ID is reused ( #overduerulest )

Should a separate bug be filed for that? Or can we deal with it here?
Comment 3 Owen Leonard 2024-01-03 17:27:17 UTC
Thanks Lucas, that was a dumb oversight. I will redo the patch and correct the ID error.
Comment 4 Owen Leonard 2024-01-03 17:57:46 UTC
Created attachment 160495 [details] [review]
Bug 35648: Allow sorting of patron categories in Overdue notice/status triggers

This patch adds a basic DataTables configuration to the table of patron
categories on the Overdue notice/status triggers page. The table can be
sorted by patron category and can be filtered.

To test, apply the patch and go to Tools -> Overdue notice/status
triggers.

- Confirm that the table of patron categories is sorted by default by
   patron category
- Other columns should not be sortable
- You should see a search field above the table which works to filter by
  patron category.
Comment 5 Lucas Gass (lukeg) 2024-01-03 18:54:06 UTC
Created attachment 160498 [details] [review]
Bug 35648: Allow sorting of patron categories in Overdue notice/status triggers

This patch adds a basic DataTables configuration to the table of patron
categories on the Overdue notice/status triggers page. The table can be
sorted by patron category and can be filtered.

To test, apply the patch and go to Tools -> Overdue notice/status
triggers.

- Confirm that the table of patron categories is sorted by default by
   patron category
- Other columns should not be sortable
- You should see a search field above the table which works to filter by
  patron category.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 6 Jonathan Druart 2024-01-12 11:05:41 UTC
Data loss possible.

If you submit the form while at least one of the table is filtered, you will lose the rows that are not displayed.

IIRC we had the same problem when saving the ES mappings. A solution was to remove search, redraw and finally submit the form.
Comment 7 Owen Leonard 2024-03-22 13:10:12 UTC
Created attachment 163702 [details] [review]
Bug 35648: (follow-up) Clear table filter before submitting

This patch takes advise from elasticsearch-mappings.js and adds an
onsubmit event to clear any DataTables filter before submitting. This
should prevent hidden fields from being overwritten.

To test, filter the table and make a change to one of the visible rows.
After submitting, confirm that the previously-hidden rows retain the
same settings as before.
Comment 8 Kyle M Hall (khall) 2024-05-03 15:14:41 UTC
The transport columns appear to be sortable but do not actually sort.
Comment 9 Owen Leonard 2024-05-03 17:15:21 UTC
Created attachment 166153 [details] [review]
Bug 35648: (follow-up) Remove sorting from transport columns

There's not a simple way to handle sorting of a column containing only
checkboxes, so I think it makes sense to remove the sorting unless
someone feels strongly about it being necessary.
Comment 10 Kyle M Hall (khall) 2024-05-07 16:40:03 UTC
Created attachment 166312 [details] [review]
Bug 35648: Allow sorting of patron categories in Overdue notice/status triggers

This patch adds a basic DataTables configuration to the table of patron
categories on the Overdue notice/status triggers page. The table can be
sorted by patron category and can be filtered.

To test, apply the patch and go to Tools -> Overdue notice/status
triggers.

- Confirm that the table of patron categories is sorted by default by
   patron category
- Other columns should not be sortable
- You should see a search field above the table which works to filter by
  patron category.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 11 Kyle M Hall (khall) 2024-05-07 16:40:09 UTC
Created attachment 166313 [details] [review]
Bug 35648: (follow-up) Clear table filter before submitting

This patch takes advise from elasticsearch-mappings.js and adds an
onsubmit event to clear any DataTables filter before submitting. This
should prevent hidden fields from being overwritten.

To test, filter the table and make a change to one of the visible rows.
After submitting, confirm that the previously-hidden rows retain the
same settings as before.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 12 Kyle M Hall (khall) 2024-05-07 16:40:11 UTC
Created attachment 166314 [details] [review]
Bug 35648: (follow-up) Remove sorting from transport columns

There's not a simple way to handle sorting of a column containing only
checkboxes, so I think it makes sense to remove the sorting unless
someone feels strongly about it being necessary.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 13 Katrin Fischer 2024-05-08 16:25:05 UTC
Pushed for 24.05!

Well done everyone, thank you!
Comment 14 Fridolin Somers 2024-05-24 15:06:33 UTC
Not backported to 23.11.x