diff --git a/dashboard/src/components/BootsTable/BootsTable.tsx b/dashboard/src/components/BootsTable/BootsTable.tsx index ffd0d4c3f..d60b5d312 100644 --- a/dashboard/src/components/BootsTable/BootsTable.tsx +++ b/dashboard/src/components/BootsTable/BootsTable.tsx @@ -143,7 +143,9 @@ export function BootsTable({ updatePathFilter, currentPathFilter, }: IBootsTable): JSX.Element { - const [sorting, setSorting] = useState([]); + const [sorting, setSorting] = useState([ + { id: 'path', desc: false }, + ]); const { pagination, paginationUpdater } = usePaginationState(tableKey); const [globalFilter, setGlobalFilter] = useState( currentPathFilter, @@ -183,6 +185,7 @@ export function BootsTable({ const table = useReactTable({ data: testsData, columns, + enableSortingRemoval: false, onSortingChange: setSorting, getCoreRowModel: getCoreRowModel(), getPaginationRowModel: getPaginationRowModel(), diff --git a/dashboard/src/components/BuildsTable/BuildsTable.tsx b/dashboard/src/components/BuildsTable/BuildsTable.tsx index f9426b0eb..6e9725d11 100644 --- a/dashboard/src/components/BuildsTable/BuildsTable.tsx +++ b/dashboard/src/components/BuildsTable/BuildsTable.tsx @@ -59,7 +59,9 @@ export function BuildsTable({ onClickFilter, getRowLink, }: IBuildsTable): JSX.Element { - const [sorting, setSorting] = useState([]); + const [sorting, setSorting] = useState([ + { id: 'config', desc: false }, + ]); const { pagination, paginationUpdater } = usePaginationState(tableKey); const intl = useIntl(); @@ -87,6 +89,7 @@ export function BuildsTable({ const table = useReactTable({ data: rawData, columns, + enableSortingRemoval: false, onSortingChange: setSorting, getCoreRowModel: getCoreRowModel(), getPaginationRowModel: getPaginationRowModel(), diff --git a/dashboard/src/components/Table/TableHeader.tsx b/dashboard/src/components/Table/TableHeader.tsx index 359486e99..ffe3d8913 100644 --- a/dashboard/src/components/Table/TableHeader.tsx +++ b/dashboard/src/components/Table/TableHeader.tsx @@ -6,7 +6,7 @@ import { ArrowDown, ArrowUp, ArrowUpDown } from 'lucide-react'; import { z } from 'zod'; -import { useCallback, type JSX } from 'react'; +import type { JSX } from 'react'; import type { MessagesKey } from '@/locales/messages'; @@ -39,24 +39,12 @@ export const TableHeader = ({ intlKey, tooltipId, }: ITableHeader): JSX.Element => { - const headerSort = useCallback(() => { - if (sortable) { - if (column.getIsSorted() === 'asc') { - column.toggleSorting(true); - } else if (column.getIsSorted() === 'desc') { - column.clearSorting(); - } else { - column.toggleSorting(false); - } - } - }, [column, sortable]); - return (