From dd185e8e7ad837f60e67d55a6e5f7e3debbeadc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20W=C3=B3jcik?= Date: Mon, 13 Apr 2026 15:18:26 +0200 Subject: [PATCH 1/2] add missing sorting functions --- web/src/pages/EdgesPage/EdgesTable.tsx | 4 ++++ web/src/pages/LocationsPage/components/GatewaysTable.tsx | 5 +++++ web/src/pages/LocationsPage/components/LocationsTable.tsx | 1 + web/src/pages/NetworkDevicesPage/NetworkDevicesTable.tsx | 3 +++ web/src/pages/RulesPage/RulesTable.tsx | 4 ++++ .../ProfileApiTokensTable/ProfileApiTokensTable.tsx | 1 + .../tabs/ProfileAuthKeysTab/ProfileAuthKeysTable.tsx | 1 + .../components/ProfileDevicesTable/ProfileDevicesTable.tsx | 1 + 8 files changed, 20 insertions(+) diff --git a/web/src/pages/EdgesPage/EdgesTable.tsx b/web/src/pages/EdgesPage/EdgesTable.tsx index ff2ca2c5d8..c4b27e978a 100644 --- a/web/src/pages/EdgesPage/EdgesTable.tsx +++ b/web/src/pages/EdgesPage/EdgesTable.tsx @@ -28,6 +28,7 @@ import { isPresent } from '../../shared/defguard-ui/utils/isPresent'; import { openModal } from '../../shared/hooks/modalControls/modalsSubjects'; import { ModalName } from '../../shared/hooks/modalControls/modalTypes'; import { getEdgesQueryOptions, getLicenseInfoQueryOptions } from '../../shared/query'; +import { tableSortingFns } from '../../shared/utils/dateSortingFn'; import { displayDate } from '../../shared/utils/displayDate'; import { canUseEnterpriseFeature, licenseActionCheck } from '../../shared/utils/license'; @@ -168,6 +169,8 @@ export const EdgesTable = () => { minSize: 175, header: m.edges_col_last_modified(), enableSorting: true, + // @ts-expect-error + sortingFn: 'dateIso', cell: (info) => ( {displayDate(info.getValue())} @@ -269,6 +272,7 @@ export const EdgesTable = () => { }, ], }, + sortingFns: tableSortingFns, columns, data: transformedData, enableRowSelection: false, diff --git a/web/src/pages/LocationsPage/components/GatewaysTable.tsx b/web/src/pages/LocationsPage/components/GatewaysTable.tsx index 77f32c28d8..f675839efb 100644 --- a/web/src/pages/LocationsPage/components/GatewaysTable.tsx +++ b/web/src/pages/LocationsPage/components/GatewaysTable.tsx @@ -23,6 +23,7 @@ import { Snackbar } from '../../../shared/defguard-ui/providers/snackbar/snackba import { openModal } from '../../../shared/hooks/modalControls/modalsSubjects'; import { ModalName } from '../../../shared/hooks/modalControls/modalTypes'; import { getGatewaysQueryOptions } from '../../../shared/query'; +import { tableSortingFns } from '../../../shared/utils/dateSortingFn'; import { displayDate } from '../../../shared/utils/displayDate'; type RowData = GatewayInfo; @@ -155,6 +156,8 @@ export const GatewaysTable = () => { minSize: 175, header: m.edges_col_last_modified(), enableSorting: true, + // @ts-expect-error + sortingFn: 'dateIso', cell: (info) => ( {displayDate(info.getValue())} @@ -177,6 +180,7 @@ export const GatewaysTable = () => { header: m.gateway_col_used_in_location(), size: 220, minSize: 200, + sortingFn: 'text', meta: { flex: true, }, @@ -263,6 +267,7 @@ export const GatewaysTable = () => { }, ], }, + sortingFns: tableSortingFns, columns, data: transformedData, enableRowSelection: false, diff --git a/web/src/pages/LocationsPage/components/LocationsTable.tsx b/web/src/pages/LocationsPage/components/LocationsTable.tsx index 29b1d6db88..55ef965bf0 100644 --- a/web/src/pages/LocationsPage/components/LocationsTable.tsx +++ b/web/src/pages/LocationsPage/components/LocationsTable.tsx @@ -140,6 +140,7 @@ export const LocationsTable = () => { columnHelper.accessor('location_mfa_mode', { header: m.location_col_mfa(), minSize: 100, + sortingFn: 'text', cell: (info) => { switch (info.getValue()) { case 'disabled': diff --git a/web/src/pages/NetworkDevicesPage/NetworkDevicesTable.tsx b/web/src/pages/NetworkDevicesPage/NetworkDevicesTable.tsx index 271a62b475..1a84666cd9 100644 --- a/web/src/pages/NetworkDevicesPage/NetworkDevicesTable.tsx +++ b/web/src/pages/NetworkDevicesPage/NetworkDevicesTable.tsx @@ -124,6 +124,7 @@ export const NetworkDevicesTable = ({ networkDevices }: Props) => { header: m.form_label_location(), size: 225, minSize: 175, + sortingFn: 'text', cell: (info) => ( {info.getValue()} @@ -143,6 +144,7 @@ export const NetworkDevicesTable = ({ networkDevices }: Props) => { header: m.form_label_description(), size: 300, minSize: 250, + sortingFn: 'text', cell: (info) => ( {info.getValue()} @@ -153,6 +155,7 @@ export const NetworkDevicesTable = ({ networkDevices }: Props) => { header: m.network_devices_col_added_by(), size: 140, minSize: 100, + sortingFn: 'text', cell: (info) => ( {info.getValue()} diff --git a/web/src/pages/RulesPage/RulesTable.tsx b/web/src/pages/RulesPage/RulesTable.tsx index 45bca8b239..cab9f7c9cc 100644 --- a/web/src/pages/RulesPage/RulesTable.tsx +++ b/web/src/pages/RulesPage/RulesTable.tsx @@ -41,6 +41,7 @@ import { TableTop } from '../../shared/defguard-ui/components/table/TableTop/Tab import { Snackbar } from '../../shared/defguard-ui/providers/snackbar/snackbar'; import { displayDate } from '../../shared/utils/displayDate'; import { canUseBusinessFeature, licenseActionCheck } from '../../shared/utils/license'; +import { tableSortingFns } from '../../shared/utils/dateSortingFn'; type RowData = AclRule; @@ -245,6 +246,8 @@ export const RulesTable = ({ minSize: 175, header: m.edges_col_last_modified(), enableSorting: true, + // @ts-expect-error + sortingFn: 'dateIso', cell: (info) => ( {displayDate(info.getValue())} @@ -396,6 +399,7 @@ export const RulesTable = ({ }, ], }, + sortingFns: tableSortingFns, columns, data: visibleRules, enableRowSelection: false, diff --git a/web/src/pages/user-profile/UserProfilePage/tabs/ProfileApiTokensTab/components/ProfileApiTokensTable/ProfileApiTokensTable.tsx b/web/src/pages/user-profile/UserProfilePage/tabs/ProfileApiTokensTab/components/ProfileApiTokensTable/ProfileApiTokensTable.tsx index 69b59169aa..a70c896a89 100644 --- a/web/src/pages/user-profile/UserProfilePage/tabs/ProfileApiTokensTab/components/ProfileApiTokensTable/ProfileApiTokensTable.tsx +++ b/web/src/pages/user-profile/UserProfilePage/tabs/ProfileApiTokensTab/components/ProfileApiTokensTable/ProfileApiTokensTable.tsx @@ -31,6 +31,7 @@ export const ProfileApiTokensTable = () => { () => [ columnHelper.accessor('name', { enableSorting: true, + sortingFn: 'text', header: m.profile_api_tokens_col_name(), minSize: 300, meta: { diff --git a/web/src/pages/user-profile/UserProfilePage/tabs/ProfileAuthKeysTab/ProfileAuthKeysTable.tsx b/web/src/pages/user-profile/UserProfilePage/tabs/ProfileAuthKeysTab/ProfileAuthKeysTable.tsx index 82d50b6064..7e251b50dc 100644 --- a/web/src/pages/user-profile/UserProfilePage/tabs/ProfileAuthKeysTab/ProfileAuthKeysTable.tsx +++ b/web/src/pages/user-profile/UserProfilePage/tabs/ProfileAuthKeysTab/ProfileAuthKeysTable.tsx @@ -89,6 +89,7 @@ export const ProfileAuthKeysTable = () => { columnHelper.accessor('name', { header: m.profile_auth_keys_table_col_name(), enableSorting: true, + sortingFn: 'text', minSize: 200, size: 200, meta: { diff --git a/web/src/pages/user-profile/UserProfilePage/tabs/ProfileDevicesTab/components/ProfileDevicesTable/ProfileDevicesTable.tsx b/web/src/pages/user-profile/UserProfilePage/tabs/ProfileDevicesTab/components/ProfileDevicesTable/ProfileDevicesTable.tsx index f1414b552c..dd8e9c8ea0 100644 --- a/web/src/pages/user-profile/UserProfilePage/tabs/ProfileDevicesTab/components/ProfileDevicesTable/ProfileDevicesTable.tsx +++ b/web/src/pages/user-profile/UserProfilePage/tabs/ProfileDevicesTab/components/ProfileDevicesTable/ProfileDevicesTable.tsx @@ -197,6 +197,7 @@ const DevicesTable = ({ rowData }: { rowData: RowData[] }) => { size: 300, minSize: 300, enableSorting: true, + sortingFn: 'text', meta: { flex: true, }, From 20b1bc42b6daf726f413f7544577878d0c42076c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20W=C3=B3jcik?= Date: Mon, 13 Apr 2026 15:33:56 +0200 Subject: [PATCH 2/2] formatting --- web/src/pages/RulesPage/RulesTable.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/src/pages/RulesPage/RulesTable.tsx b/web/src/pages/RulesPage/RulesTable.tsx index cab9f7c9cc..7866c4c2df 100644 --- a/web/src/pages/RulesPage/RulesTable.tsx +++ b/web/src/pages/RulesPage/RulesTable.tsx @@ -39,9 +39,9 @@ import { TableCell } from '../../shared/defguard-ui/components/table/TableCell/T import { TableEditCell } from '../../shared/defguard-ui/components/table/TableEditCell/TableEditCell'; import { TableTop } from '../../shared/defguard-ui/components/table/TableTop/TableTop'; import { Snackbar } from '../../shared/defguard-ui/providers/snackbar/snackbar'; +import { tableSortingFns } from '../../shared/utils/dateSortingFn'; import { displayDate } from '../../shared/utils/displayDate'; import { canUseBusinessFeature, licenseActionCheck } from '../../shared/utils/license'; -import { tableSortingFns } from '../../shared/utils/dateSortingFn'; type RowData = AclRule;