From a0c85431dcf3387a3bec69c67d78b84aba28872d Mon Sep 17 00:00:00 2001 From: Pradip Parkale Date: Fri, 29 Apr 2022 10:26:24 +0530 Subject: [PATCH] Ensure that the Dashboard column sort order should be remembered when the refresh button is clicked. Fixes #7339 --- docs/en_US/release_notes_6_9.rst | 1 + web/pgadmin/misc/properties/CollectionNodeProperties.jsx | 5 +++++ web/pgadmin/static/js/components/PgTable.jsx | 4 +++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/en_US/release_notes_6_9.rst b/docs/en_US/release_notes_6_9.rst index 6bf206b66..1a54431ea 100644 --- a/docs/en_US/release_notes_6_9.rst +++ b/docs/en_US/release_notes_6_9.rst @@ -45,3 +45,4 @@ Bug fixes | `Issue #7308 `_ - Ensure that sorting should be preserved on refresh for Server Activity. | `Issue #7322 `_ - Fixed an issue while creating a new database throwing an error that failed to retrieve data. | `Issue #7333 `_ - Fixed an issue where the drag and drop table in ERD throws an error. + | `Issue #7339 `_ - Ensure that the Dashboard column sort order should be remembered when the refresh button is clicked. diff --git a/web/pgadmin/misc/properties/CollectionNodeProperties.jsx b/web/pgadmin/misc/properties/CollectionNodeProperties.jsx index 25703eb6d..9ac2a5b5f 100644 --- a/web/pgadmin/misc/properties/CollectionNodeProperties.jsx +++ b/web/pgadmin/misc/properties/CollectionNodeProperties.jsx @@ -90,6 +90,11 @@ export function CollectionNodeView({ const [reload, setReload] = React.useState(false); const [loaderText, setLoaderText] = React.useState(''); + //Reload the collection node on refresh or change in children count + React.useEffect(() => { + setReload(!reload); + }, [item?._children]); + const [pgTableColumns, setPgTableColumns] = React.useState([ { Header: 'properties', diff --git a/web/pgadmin/static/js/components/PgTable.jsx b/web/pgadmin/static/js/components/PgTable.jsx index c2d23e0df..78e8590b1 100644 --- a/web/pgadmin/static/js/components/PgTable.jsx +++ b/web/pgadmin/static/js/components/PgTable.jsx @@ -229,8 +229,10 @@ export default function PgTable({ columns, data, isSelectRow, caveTable=true, .. const rowHeights = React.useRef({}); // Reset Search value on tab changes. + React.useEffect(()=>{ - setSearchVal(''); + setSearchVal(prevState => (prevState)); + setGlobalFilter(searchVal || undefined); rowHeights.current = {}; tableRef.current?.resetAfterIndex(0); }, [data]);