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.
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.
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?
Thanks Lucas, that was a dumb oversight. I will redo the patch and correct the ID error.
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.
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>
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.
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.
The transport columns appear to be sortable but do not actually sort.
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.
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>
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>
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>
Pushed for 24.05! Well done everyone, thank you!
Not backported to 23.11.x