Ensure that the query tool context menu should work on the collection nodes. Fixes #5415

This commit is contained in:
Aditya Toshniwal
2020-04-20 18:50:20 +05:30
committed by Akshay Joshi
parent dc4571a3c8
commit 05abb9e430
2 changed files with 14 additions and 4 deletions

View File

@@ -72,3 +72,4 @@ Bug fixes
| `Issue #5401 <https://redmine.postgresql.org/issues/5401>`_ - Fixed search object issue when the object name contains special characters. | `Issue #5401 <https://redmine.postgresql.org/issues/5401>`_ - Fixed search object issue when the object name contains special characters.
| `Issue #5409 <https://redmine.postgresql.org/issues/5409>`_ - Fixed validation issue in Synonyms node. | `Issue #5409 <https://redmine.postgresql.org/issues/5409>`_ - Fixed validation issue in Synonyms node.
| `Issue #5410 <https://redmine.postgresql.org/issues/5410>`_ - Fixed an issue while removing the package body showing wrong modified SQL. | `Issue #5410 <https://redmine.postgresql.org/issues/5410>`_ - Fixed an issue while removing the package body showing wrong modified SQL.
| `Issue #5415 <https://redmine.postgresql.org/issues/5415>`_ - Ensure that the query tool context menu should work on the collection nodes.

View File

@@ -51,11 +51,10 @@ define([
}]); }]);
// show query tool only in context menu of supported nodes. // show query tool only in context menu of supported nodes.
if (pgAdmin.unsupported_nodes && _.indexOf(pgAdmin.unsupported_nodes, this.type) == -1) { if (pgAdmin.unsupported_nodes && _.indexOf(pgAdmin.unsupported_nodes, this.type) == -1) {
if ((this.type == 'database' && this.allowConn) || this.type != 'database') { if ((this.type == 'database' && this.allowConn) || this.type != 'database') {
pgAdmin.Browser.add_menus([{ 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', applies: ['context'], callback: 'show_query_tool',
priority: 998, label: gettext('Query Tool...'), priority: 998, label: gettext('Query Tool...'),
icon: 'pg-font-icon icon-query-tool', icon: 'pg-font-icon icon-query-tool',
@@ -63,7 +62,7 @@ define([
// show search objects same as query tool // show search objects same as query tool
pgAdmin.Browser.add_menus([{ 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', applies: ['context'], callback: 'show_search_objects',
priority: 997, label: gettext('Search Objects...'), priority: 997, label: gettext('Search Objects...'),
icon: 'fa fa-search', icon: 'fa fa-search',
@@ -452,6 +451,16 @@ define([
collectionPickFunction 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; return pgBrowser.Collection;