-
Notifications
You must be signed in to change notification settings - Fork 11
replace custom tables with datatables.net #456
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
0d45b26 to
a84671b
Compare
1d7acc5 to
de73148
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR replaces custom table implementations with the datatables.net library, modernizing the table functionality across the application. The changes introduce comprehensive table features including sorting, filtering, searching, pagination, and responsive design while removing legacy custom JavaScript and CSS code.
Key changes include:
- Integration of datatables.net CDN resources for enhanced table functionality
- Removal of custom table handling code (tables.js, sort.js, filter.js and associated CSS files)
- Refactoring of AJAX endpoints that previously served expandable table data
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| resources/templates/header.php | Added datatables.net CDN includes and removed references to deleted CSS files |
| webroot/panel/groups.php | Converted custom table to DataTable with responsive features and removed AJAX expandable functionality |
| webroot/panel/pi.php | Removed mailto links from email columns for consistency with DataTable output |
| webroot/admin/user-mgmt.php | Replaced custom filterable/sortable table with DataTable implementation |
| webroot/admin/pi-mgmt.php | Converted both PI request and PI list tables to DataTable format with responsive design |
| webroot/js/tables.js | Removed legacy expandable table JavaScript functionality |
| webroot/js/sort.js | Removed custom sorting implementation |
| webroot/js/filter.js | Removed custom filtering implementation |
| webroot/css/tables.css | Removed custom table styling |
| webroot/css/filters.css | Removed custom filter styling |
| webroot/panel/ajax/get_group_members.php | Removed AJAX endpoint as group members are now loaded inline |
| webroot/admin/ajax/get_group_members.php | Removed AJAX endpoint as group members are now loaded inline |
| resources/lib/UnityLDAP.php | Added new method to fetch PI group attributes with member UID filter |
| tools/docker-dev/identity/bootstrap.ldif | Updated test user email address |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
6132809 to
9c25c69
Compare
e75bcce to
389868f
Compare
problem: see
Was not actually unused |
5f3ef13 to
ad3e7ea
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 15 out of 17 changed files in this pull request and generated 18 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
d61dd0d to
7398ebb
Compare
I've long been hacking with
tables.js,filter.jsandsort.js, and I don't wish to maintain them any longer. https://datatables.net/ is compatible with tables generated by PHP, is open source, is packed with features, looks good enough, and runs fast enough. This is a big improvement for mobile.groups.php
pi.php
user-mgmt.php
pi-mgmt.php
column visibility selector modal
Features
groups.phpthis is able to replace theexpandableajax functionality fromtables.jspi-mgmt.phpthis feature could not be used due to the complexity of theexpandablecontent, so the mobile experience is still not greatDownsides
datatables JS files are being loaded on all pages, even pages without tables
<script>elements as separate PHP includesgroups.phpnow loads all PI membership data at once instead of individually for each PI on clickthere is a slight delay before the tables are rendered, only noticable on the admin pages with lots of data
demo with production LDAP data (much bigger than dev environment):
datatables-user-mgmt-demo-blurred.mp4
datatables-pi-mgmt-demo-blurred.mp4
Issues Closed
sort.js#449sort.jsfilter.js: mark column as non-sortable, non-filterable #451Other Changes of Note
pi-mgmt.phppi-mgmt.phppi-mgmt.phpRequested Ondatetime inpi-mgmtso that datatables would automatically detect it and add proper sortingActionscolumn inpi.phpfrom the left side to the right sideFuture work