From 31a91409a0dd339786e485a4fdb072a3315e9564 Mon Sep 17 00:00:00 2001 From: Aditya Toshniwal Date: Wed, 19 Jun 2024 18:27:43 +0530 Subject: [PATCH] Fixed incorrect sorting of size in statistics tab. #7542 --- docs/en_US/release_notes_8_9.rst | 1 + web/pgadmin/misc/statistics/static/js/Statistics.jsx | 1 + web/pgadmin/static/js/components/PgReactTableStyled.jsx | 7 ++++--- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/en_US/release_notes_8_9.rst b/docs/en_US/release_notes_8_9.rst index 5d6ab1012..2ad031c87 100644 --- a/docs/en_US/release_notes_8_9.rst +++ b/docs/en_US/release_notes_8_9.rst @@ -40,6 +40,7 @@ Bug fixes | `Issue #7516 `_ - Ensure preferences can be loaded using preferences.json. | `Issue #7528 `_ - Fixed an issue where backslash breaks syntax highlighting. | `Issue #7536 `_ - Search Objects dialog should focus on search input on open. + | `Issue #7542 `_ - Fixed incorrect sorting of size in statistics tab. | `Issue #7555 `_ - Fixed an issue where query tool shortcuts for find/replace are not working. | `Issue #7556 `_ - Fixed migration failure while using external database. | `Issue #7593 `_ - Fixed an issue where query tool auto-complete stops working after connection change. \ No newline at end of file diff --git a/web/pgadmin/misc/statistics/static/js/Statistics.jsx b/web/pgadmin/misc/statistics/static/js/Statistics.jsx index 998aea49b..8e1356f60 100644 --- a/web/pgadmin/misc/statistics/static/js/Statistics.jsx +++ b/web/pgadmin/misc/statistics/static/js/Statistics.jsx @@ -45,6 +45,7 @@ function getColumn(data, singleLineStatistics, prettifyFields=[]) { enableSorting: true, enableResizing: true, enableFilters: true, + sortingFn: 'alphanumeric', }); }); } diff --git a/web/pgadmin/static/js/components/PgReactTableStyled.jsx b/web/pgadmin/static/js/components/PgReactTableStyled.jsx index b627eb024..0cd89710c 100644 --- a/web/pgadmin/static/js/components/PgReactTableStyled.jsx +++ b/web/pgadmin/static/js/components/PgReactTableStyled.jsx @@ -242,11 +242,12 @@ export function PgReactTableHeader({table}) { flex: `var(--header-${header?.id.replace(/\W/g, '_')}-size) 0 auto`, width: `calc(var(--header-${header?.id.replace(/\W/g, '_')}-size)*1px)`, ...(header.column.columnDef.maxSize ? { maxWidth: `${header.column.columnDef.maxSize}px` } : {}), - cursor: header.column.getCanSort() ? 'pointer' : 'initial', }} - onClick={header.column.getCanSort() ? header.column.getToggleSortingHandler() : undefined} > -
+
{flexRender(header.column.columnDef.header, header.getContext())} {header.column.getCanSort() && header.column.getIsSorted() &&