feat(fleet): standard DataTable with in-table filters, sorting, pagination#42
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
Adds one shared, config-driven
<DataTable>(built on@tanstack/react-table) and adopts it across all eight Fleet Manager list surfaces. Every table gets the standard control set — sortable column headers, per-column filtering, and pagination — following the canonical shadcn/TanStack DataTable pattern on the app's existing shadcn tokens. Table state (sorting, column filters, pagination) is held in local React state, with no URL/query coupling.Closes #41.
Controls
Surfaces migrated
Certificates, Enrollment, Audit, Nodes, Root, Profiles, Protocols, and the nested node cert inventory. Each page's hand-rolled table and ad-hoc filter controls are replaced by column definitions plus
<DataTable>, preserving every cell renderer and action (Renew, Enable/Disable, the Revoke dialog, enrollment approve).Notes
This shipped after live review. The first cut placed filters in a toolbar above the table and synced all control state to the URL query; per feedback both were dropped in favor of the standard in-table controls backed by local state. The faceted-filter toolbar component and the URL-state hook were removed. If shareable or deep-linkable table state is wanted later, it can be reintroduced deliberately as an opt-in.
Testing
npm test(101 tests),npm run build,eslint,prettier, andtask licenseall clean. Sorting, filtering, and pagination were verified in a real browser.Follow-ups (non-blocking)
emptyMessageprop to distinguish a genuinely-empty table from a filtered-empty one (both currently show "No matching rows.").