From 4925c6ce509781c59f8abc1f3cf58fb65baae9d6 Mon Sep 17 00:00:00 2001 From: Nikhil Mohite Date: Thu, 20 Oct 2022 16:26:10 +0530 Subject: [PATCH] Ensure the Generate ERD option is hidden if the connection to the database is not allowed. #5149 --- .../server_groups/servers/databases/static/js/database.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/web/pgadmin/browser/server_groups/servers/databases/static/js/database.js b/web/pgadmin/browser/server_groups/servers/databases/static/js/database.js index 34418bb2f..d525cffc7 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/static/js/database.js +++ b/web/pgadmin/browser/server_groups/servers/databases/static/js/database.js @@ -99,6 +99,9 @@ define('pgadmin.node.database', [ name: 'generate_erd', node: 'database', module: this, applies: ['object', 'context'], callback: 'generate_erd', category: 'erd', priority: 5, label: gettext('Generate ERD'), + enable: (node) => { + return node.allowConn; + } }]); _.bindAll(this, 'connection_lost');