diff --git a/web/pgadmin/static/js/keyboard_shortcuts.js b/web/pgadmin/static/js/keyboard_shortcuts.js index c021d1830..f02851720 100644 --- a/web/pgadmin/static/js/keyboard_shortcuts.js +++ b/web/pgadmin/static/js/keyboard_shortcuts.js @@ -199,6 +199,7 @@ function keyboardShortcutsQueryTool( let commitKeys = sqlEditorController.preferences.commit_transaction; let rollbackKeys = sqlEditorController.preferences.rollback_transaction; let saveDataKeys = sqlEditorController.preferences.save_data; + let queryToolKeys = sqlEditorController.preferences.show_query_tool; if (this.validateShortcutKeys(executeKeys, event)) { this._stopEventPropagation(event); @@ -230,6 +231,9 @@ function keyboardShortcutsQueryTool( } else if (this.validateShortcutKeys(saveDataKeys, event)) { this._stopEventPropagation(event); queryToolActions.saveDataChanges(sqlEditorController); + } else if (this.validateShortcutKeys(queryToolKeys, event)) { + this._stopEventPropagation(event); + queryToolActions.openQueryTool(sqlEditorController); } else if (( (this.isMac() && event.metaKey) || (!this.isMac() && event.ctrlKey) diff --git a/web/pgadmin/static/js/sqleditor/query_tool_actions.js b/web/pgadmin/static/js/sqleditor/query_tool_actions.js index a97582e6a..98297cf18 100644 --- a/web/pgadmin/static/js/sqleditor/query_tool_actions.js +++ b/web/pgadmin/static/js/sqleditor/query_tool_actions.js @@ -161,6 +161,14 @@ let queryToolActions = { sqlEditorController.close_on_save = false; sqlEditorController.save_data(); }, + + openQueryTool: function (sqlEditorController) { + sqlEditorController.gridView.handler.trigger( + 'pgadmin-sqleditor:button:show_query_tool', + sqlEditorController.gridView, + sqlEditorController.gridView.handler + ); + }, }; module.exports = queryToolActions; diff --git a/web/pgadmin/static/js/sqleditor/query_tool_preferences.js b/web/pgadmin/static/js/sqleditor/query_tool_preferences.js index 5a3d15582..ba4e7c882 100644 --- a/web/pgadmin/static/js/sqleditor/query_tool_preferences.js +++ b/web/pgadmin/static/js/sqleditor/query_tool_preferences.js @@ -136,6 +136,12 @@ function updateUIPreferences(sqlEditor) { .attr('aria-label', shortcut_title(gettext('Rollback'),preferences.rollback_transaction)); + $el.find('#btn-show-query-tool') + .attr('title', + shortcut_title(gettext('Query tool'),preferences.show_query_tool)) + .attr('aria-label', + shortcut_title(gettext('Query tool'),preferences.show_query_tool)); + /* Set explain options on query editor */ if (preferences.explain_verbose){ $el.find('.explain-verbose').removeClass('visibility-hidden'); diff --git a/web/pgadmin/tools/datagrid/static/js/show_query_tool.js b/web/pgadmin/tools/datagrid/static/js/show_query_tool.js index 782bf78e3..3e7205f3f 100644 --- a/web/pgadmin/tools/datagrid/static/js/show_query_tool.js +++ b/web/pgadmin/tools/datagrid/static/js/show_query_tool.js @@ -65,7 +65,15 @@ export function showQueryTool(datagrid, pgBrowser, alertify, url, aciTreeIdentif const gridUrl = generateUrl(transId, queryToolTitle, parentData); - datagrid.launch_grid(transId, gridUrl, true, queryToolTitle, sURL); + let retVal = datagrid.launch_grid(transId, gridUrl, true, queryToolTitle, sURL); + if(!retVal) { + alertify.alert( + gettext('Query tool launch error'), + gettext( + 'Please allow the pop-ups for this site to perform the desired action. If the main window of pgAdmin is closed then close this window and open a new pgAdmin session.' + ) + ); + } } export function generateScript(parentData, datagrid) { diff --git a/web/pgadmin/tools/datagrid/templates/datagrid/index.html b/web/pgadmin/tools/datagrid/templates/datagrid/index.html index ae240cd5c..e81a42a47 100644 --- a/web/pgadmin/tools/datagrid/templates/datagrid/index.html +++ b/web/pgadmin/tools/datagrid/templates/datagrid/index.html @@ -17,7 +17,6 @@