From fd8af4034abda6b8cc8aaeff5a1c1a1d0d7e463a Mon Sep 17 00:00:00 2001 From: Pravesh Sharma Date: Fri, 29 Dec 2023 15:40:36 +0530 Subject: [PATCH] Fixed an issue where user is not able to cancel or terminate active queries from dashboard. #7078 --- web/pgadmin/dashboard/static/js/Dashboard.jsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/web/pgadmin/dashboard/static/js/Dashboard.jsx b/web/pgadmin/dashboard/static/js/Dashboard.jsx index 53956261f..190664817 100644 --- a/web/pgadmin/dashboard/static/js/Dashboard.jsx +++ b/web/pgadmin/dashboard/static/js/Dashboard.jsx @@ -695,6 +695,8 @@ function Dashboard({ ? treeNodeInfo.server.user.can_signal_backend : false; + let maintenanceActiveSessions = dashData.filter((data) => data.state === 'active'&& + maintenance_database === data.datname); if ( treeNodeInfo.server && treeNodeInfo.server.user && @@ -727,7 +729,8 @@ function Dashboard({ // If it is the last active connection on maintenance db then error out } else if ( maintenance_database == row.original.datname && - row.original.state == 'active' + row.original.state == 'active' && + maintenanceActiveSessions.length === 1 ) { if (is_cancel_session) { txtMessage = gettext(