From 8029d9e65e152a1fbbbc563181b93e7bbf21621f Mon Sep 17 00:00:00 2001 From: Rahul Shirsat Date: Mon, 14 Sep 2020 17:42:59 +0530 Subject: [PATCH] 1) Fixed internal server error when clicking on the open new query tool button from the View/Edit Data window. Fixes #5831 2) Fixed schema diff panel title issue on new tab. --- .../templates/schema_diff/index.html | 1 + .../tools/sqleditor/static/js/sqleditor.js | 19 +++++++++++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/web/pgadmin/tools/schema_diff/templates/schema_diff/index.html b/web/pgadmin/tools/schema_diff/templates/schema_diff/index.html index ef687b8e8..7fa7683d3 100644 --- a/web/pgadmin/tools/schema_diff/templates/schema_diff/index.html +++ b/web/pgadmin/tools/schema_diff/templates/schema_diff/index.html @@ -21,6 +21,7 @@ try { {% block css_link %} {% endblock %} +{% block title %}{{editor_title}}{% endblock %} {% block body %}
diff --git a/web/pgadmin/tools/sqleditor/static/js/sqleditor.js b/web/pgadmin/tools/sqleditor/static/js/sqleditor.js index ce02a53cb..3646a9750 100644 --- a/web/pgadmin/tools/sqleditor/static/js/sqleditor.js +++ b/web/pgadmin/tools/sqleditor/static/js/sqleditor.js @@ -4302,13 +4302,24 @@ define('tools.querytool', [ 'trans_id': transId, }); - url_endpoint += `?is_query_tool=${that.url_params.is_query_tool}` + url_endpoint += `?is_query_tool=${true}` +`&sgid=${that.url_params.sgid}` +`&sid=${that.url_params.sid}` - +`&server_type=${that.url_params.server_type}` - +`&did=${that.url_params.did}`; + +`&server_type=${that.url_params.server_type}`; - launchDataGrid(pgWindow.default.pgAdmin.DataGrid, transId, url_endpoint, that.url_params.title, '', alertify); + if(that.url_params.did) { + url_endpoint += `&did=${that.url_params.did}`; + } + + let panel_title = that.url_params.title; + if(that.url_params.is_query_tool == 'false') {//check whether query tool is hit from View/Edit + var split_title = that.url_params.title.split('/'); + if(split_title.length > 2) { + panel_title = split_title[split_title.length-2] + '/' + split_title[split_title.length-1]; + } + } + + launchDataGrid(pgWindow.default.pgAdmin.DataGrid, transId, url_endpoint, panel_title, '', alertify); }, /*