feat/tables default ordering#2019
Conversation
* Make the hardware table start sorted by platform and keep that column active via enableSortingRemoval. * Use TanStack's toggle handler in TableHeader so sorting options are respected, and drop redundant page-level sorts. Closes kernelci#2004 Signed-off-by: Alan Peixinho <alan.peixinho@profusion.mobi>
ca3cc0f to
cbf026b
Compare
mentonin
left a comment
There was a problem hiding this comment.
This PR looks great. I wonder if you can add the changes to our other sortable tables as well?
Builds/Boots/Tests/Tests(grouped) tables under /tree/mainline/<tree_name>/<git_branch>/<git_commit_hash>, /hardware/<platform_id>, /build/<build_id>, /issue/<issue_id>, are the ones I can recall
| treeTableRows: T[], | ||
| ): T[] => { | ||
| return treeTableRows.sort((a, b) => { | ||
| return [...treeTableRows].sort((a, b) => { |
There was a problem hiding this comment.
Why do you have to spread it if it is already an array (as per treeTableRows: T[] on old line 89)?
There was a problem hiding this comment.
Might have been overzealous here. It was mostly because javascript sort in done inplace, and I wanted to avoid side effects here.
| const data = useMemo(() => { | ||
| return treeTableRows; | ||
| }, [treeTableRows]); |
Yeah, I considered changing all tables available. Do you consider a good approach to just sort all of them by their some column (by default) as well? |
I would think so |
What it is
ascordesc.enableSortingRemoval) are respected everywhere.How to test
Hardware
Trees
Closes #2004