From d5101b75689e7d868356e59f6e0e09e0dbe75a99 Mon Sep 17 00:00:00 2001 From: Akshay Joshi Date: Thu, 30 Jan 2025 17:59:18 +0530 Subject: [PATCH] 1) Disable PSQL Workspace in Server mode. 2) Fixed an issue where empty binary path throwing an error instead of proper error message. --- web/pgadmin/browser/server_groups/servers/types.py | 2 +- web/pgadmin/misc/workspaces/static/js/AdHocConnection.jsx | 2 +- web/pgadmin/misc/workspaces/static/js/WorkspaceToolbar.jsx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/web/pgadmin/browser/server_groups/servers/types.py b/web/pgadmin/browser/server_groups/servers/types.py index a3932a93b..a831582b9 100644 --- a/web/pgadmin/browser/server_groups/servers/types.py +++ b/web/pgadmin/browser/server_groups/servers/types.py @@ -203,7 +203,7 @@ class ServerType(): bin_path['binaryPath'].strip() != '': return bin_path['binaryPath'] - if bin_path['isDefault']: + if bin_path['isDefault'] and bin_path['binaryPath'] != '': default_path = bin_path['binaryPath'] return default_path diff --git a/web/pgadmin/misc/workspaces/static/js/AdHocConnection.jsx b/web/pgadmin/misc/workspaces/static/js/AdHocConnection.jsx index c9bda1242..f03dba975 100644 --- a/web/pgadmin/misc/workspaces/static/js/AdHocConnection.jsx +++ b/web/pgadmin/misc/workspaces/static/js/AdHocConnection.jsx @@ -465,7 +465,7 @@ export default function AdHocConnection({mode}) { }); if (mode == WORKSPACES.QUERY_TOOL) { openQueryTool(respData, formData); - } else if (mode == WORKSPACES.PSQL_TOOL) { + } else if (mode == WORKSPACES.PSQL_TOOL && pgAdmin['enable_psql']) { openPSQLTool(respData, formData); } } catch (error) { diff --git a/web/pgadmin/misc/workspaces/static/js/WorkspaceToolbar.jsx b/web/pgadmin/misc/workspaces/static/js/WorkspaceToolbar.jsx index ea3aba02d..76022262c 100644 --- a/web/pgadmin/misc/workspaces/static/js/WorkspaceToolbar.jsx +++ b/web/pgadmin/misc/workspaces/static/js/WorkspaceToolbar.jsx @@ -125,7 +125,7 @@ export default function WorkspaceToolbar() { } value={WORKSPACES.DEFAULT} title={gettext('Default Workspace')} tooltipPlacement="right" /> } value={WORKSPACES.QUERY_TOOL} title={gettext('Query Tool Workspace')} tooltipPlacement="right" /> - } value={WORKSPACES.PSQL_TOOL} title={gettext('PSQL Tool Workspace')} tooltipPlacement="right" /> + {pgAdmin['enable_psql'] && } value={WORKSPACES.PSQL_TOOL} title={gettext('PSQL Tool Workspace')} tooltipPlacement="right" />} } value={WORKSPACES.SCHEMA_DIFF_TOOL} title={gettext('Schema Diff Workspace')} tooltipPlacement="right" /> } menuItem={menus['settings']} title={gettext('Preferences')} tooltipPlacement="right" />