diff --git a/docs/en_US/release_notes_4_21.rst b/docs/en_US/release_notes_4_21.rst index 1e055980c..c3ecb7127 100644 --- a/docs/en_US/release_notes_4_21.rst +++ b/docs/en_US/release_notes_4_21.rst @@ -71,4 +71,5 @@ Bug fixes | `Issue #5400 `_ - Fixed internal server error when the database server is logged in with non-super user. | `Issue #5401 `_ - Fixed search object issue when the object name contains special characters. | `Issue #5409 `_ - Fixed validation issue in Synonyms node. -| `Issue #5410 `_ - Fixed an issue while removing the package body showing wrong modified SQL. \ No newline at end of file +| `Issue #5410 `_ - Fixed an issue while removing the package body showing wrong modified SQL. +| `Issue #5415 `_ - Ensure that the query tool context menu should work on the collection nodes. \ No newline at end of file diff --git a/web/pgadmin/browser/static/js/collection.js b/web/pgadmin/browser/static/js/collection.js index 7a2785f20..b3bf7fa62 100644 --- a/web/pgadmin/browser/static/js/collection.js +++ b/web/pgadmin/browser/static/js/collection.js @@ -51,11 +51,10 @@ define([ }]); // show query tool only in context menu of supported nodes. - if (pgAdmin.unsupported_nodes && _.indexOf(pgAdmin.unsupported_nodes, this.type) == -1) { if ((this.type == 'database' && this.allowConn) || this.type != 'database') { pgAdmin.Browser.add_menus([{ - name: 'show_query_tool', node: this.type, module: pgAdmin.DataGrid, + name: 'show_query_tool', node: this.type, module: this, applies: ['context'], callback: 'show_query_tool', priority: 998, label: gettext('Query Tool...'), icon: 'pg-font-icon icon-query-tool', @@ -63,7 +62,7 @@ define([ // show search objects same as query tool pgAdmin.Browser.add_menus([{ - name: 'search_objects', node: this.type, module: pgAdmin.SearchObjects, + name: 'search_objects', node: this.type, module: this, applies: ['context'], callback: 'show_search_objects', priority: 997, label: gettext('Search Objects...'), icon: 'fa fa-search', @@ -452,6 +451,16 @@ define([ collectionPickFunction ); }, + show_query_tool: function() { + if(pgAdmin.DataGrid) { + pgAdmin.DataGrid.show_query_tool('', pgAdmin.Browser.tree.selected()); + } + }, + show_search_objects: function() { + if(pgAdmin.SearchObjects) { + pgAdmin.SearchObjects.show_search_objects('', pgAdmin.Browser.tree.selected()); + } + }, }); return pgBrowser.Collection;