From 7d979fb19631642e3fa63409de2391ce786f8db5 Mon Sep 17 00:00:00 2001 From: Pradip Parkale Date: Mon, 11 Apr 2022 17:42:16 +0530 Subject: [PATCH] =?UTF-8?q?1)=20Fixed=20an=20issue=20where=20deleting=20a?= =?UTF-8?q?=20constraint=20from=20the=20collection=20properties=20node,=20?= =?UTF-8?q?throws=C2=A0an=20error.=20Fixes=20#7296=202)=20The=20code=20to?= =?UTF-8?q?=20refresh=20the=20Dashboard=20after=20deleting=20session=20act?= =?UTF-8?q?ivities=20has=20been=20improved.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/pgadmin/dashboard/static/js/Dashboard.jsx | 8 +++----- web/pgadmin/misc/properties/CollectionNodeProperties.jsx | 4 ++-- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/web/pgadmin/dashboard/static/js/Dashboard.jsx b/web/pgadmin/dashboard/static/js/Dashboard.jsx index 4c0d91874..4b7d779cc 100644 --- a/web/pgadmin/dashboard/static/js/Dashboard.jsx +++ b/web/pgadmin/dashboard/static/js/Dashboard.jsx @@ -128,7 +128,7 @@ export default function Dashboard({ const [msg, setMsg] = useState(''); const[infoMsg, setInfo] = useState(''); const [val, setVal] = useState(0); - const [refresh, setRefresh] = useState(); + const [refresh, setRefresh] = useState(false); const [schemaDict, setSchemaDict] = React.useState({}); if (!did) { @@ -235,6 +235,7 @@ export default function Dashboard({ if (res.data == gettext('Success')) { setInfo(txtSuccess); Notify.success(txtSuccess); + setRefresh(!refresh); } else { setInfo(txtError); Notify.error(txtError); @@ -769,9 +770,6 @@ export default function Dashboard({ if (message != '') { setMsg(message); } - return () => { - setRefresh(); - }; }, [nodeData, val, did, preferences, infoMsg, refresh, props.dbConnected]); const RefreshButton = () =>{ @@ -783,7 +781,7 @@ export default function Dashboard({ icon={} onClick={(e) => { e.preventDefault(); - setRefresh(true); + setRefresh(!refresh); }} color="default" aria-label="Refresh" diff --git a/web/pgadmin/misc/properties/CollectionNodeProperties.jsx b/web/pgadmin/misc/properties/CollectionNodeProperties.jsx index 9d340914d..5823fed4b 100644 --- a/web/pgadmin/misc/properties/CollectionNodeProperties.jsx +++ b/web/pgadmin/misc/properties/CollectionNodeProperties.jsx @@ -122,8 +122,8 @@ export function CollectionNodeView({ if (selNode && selNode.type && selNode.type == 'coll-constraints') { // In order to identify the constraint type, the type should be passed to the server selRows = selRowModels.map((row) => ({ - id: row.get('oid'), - _type: row.get('_type'), + id: row.original.oid, + _type: row.original._type, })); } else { selRows = selRowModels.map((row) => row.original.oid);