refactor(cms): sortable tables via List.js#1169
Conversation
Replace custom sort with List.js 2.3.1 on js-sortable tables; editors use not-sortable on th. No default sort on load; sync aria-sort from List state. Co-authored-by: Cursor <cursoragent@cursor.com>
Review Summary by QodoRefactor CMS tables to use List.js for sorting
WalkthroughsDescription• Replace custom sort logic with List.js 2.3.1 library • Update table markup from is-sortable to js-sortable • Implement dynamic row data-* attributes for List.js • Sync aria-sort state from List.js button classes • Add fallback sort indicators via List.js asc/desc classes Diagramflowchart LR
A["Custom Sort Logic"] -->|"Replace with"| B["List.js 2.3.1"]
C["Table Markup<br/>is-sortable"] -->|"Update to"| D["js-sortable"]
E["Manual Sort<br/>on Click"] -->|"Delegate to"| F["List.js Events"]
F -->|"Sync aria-sort"| G["Accessibility State"]
B -->|"Generate"| H["Row data-* Attributes"]
File Changes1. taccsite_cms/templates/assets_core_delayed.html
|
Code Review by Qodo
1. sortableTable.js still exists
|
Use col-N keys for List.js valueNames; aria-sort indicators on th button. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
- Added CSS styles for sortable filters and improved layout for filter elements. - Updated JavaScript to support filtering functionality, including result count display and event handling for filter inputs. - Refactored `prepSortableTable` to wire up filters and result totals for better user experience. Co-authored-by: Cursor <cursoragent@cursor.com>
## Overview ES module to overcome Core-CMS WYSIWYG deleting `aria-*` attributes. ## Related - supports testing TACC/tup-ui#558 ## Changes - **adds** script ## Testing Test TACC/Core-CMS#1169 still works via TACC/tup-ui#558 using new module hack. ```diff <script type="module"> + import promoteDataAriaAttributes from 'https://cdn.jsdelivr.net/gh/TACC/Core-Styles@feat/promote-data-aria-attributes/src/lib/_utils/js/promote-data-aria-attributes.js'; import sortableTable from 'https://cdn.jsdelivr.net/gh/TACC/Core-CMS@58e0875e/taccsite_cms/static/site_cms/js/modules/sortableTable.js'; const scopeElement = document.getElementById('cms-content'); + promoteDataAriaAttributes(scopeElement); sortableTable({ scopeElement, buttonClass: 'btn btn-link', }); </script> ``` > [!TIP] > Still works! ## UI Skipped. --------- Co-authored-by: Cursor <cursoragent@cursor.com>
Move existing header children into the sort control instead of clearing innerHTML. Resolves PR #1169 review on CMS abbr/sr-only header content. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…o refactor/sortableTable
|
QODO Issues resolved. It doesn't know it yet. Improvements come (no |
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
Overview
Sortable CMS tables use List.js 2.3.1 instead of custom sort logic. Editors use
js-sortableon the table andnot-sortableon non-sort columns; row order stays as authored until a header is clicked.Related
Changes
sortableTable.jsfor List prep, rowdata-*, aria-sort syncsortableTable.cssforjs-sortableand.sortcontrolsTesting
sortableTableon#cms-content.o-fixed-header-table js-sortableandth.not-sortableon Description.aria-sort="none".data-attribute.none.<fieldset>with filter UI (seetmp/pr-1169.html).UI
It.s.alive.mov