diff --git a/docs/en_US/images/object_menu.png b/docs/en_US/images/object_menu.png index cf7d51888..3406e830e 100644 Binary files a/docs/en_US/images/object_menu.png and b/docs/en_US/images/object_menu.png differ diff --git a/docs/en_US/menu_bar.rst b/docs/en_US/menu_bar.rst index 69a1f8b7c..5400fa817 100644 --- a/docs/en_US/menu_bar.rst +++ b/docs/en_US/menu_bar.rst @@ -57,7 +57,7 @@ following options (in alphabetical order): +-----------------------------+--------------------------------------------------------------------------------------------------------------------------+ | *Delete/Drop* | Click to delete the currently selected object from the server. | +-----------------------------+--------------------------------------------------------------------------------------------------------------------------+ -| *Disconnect Server...* | Click to refresh the currently selected object. | +| *Disconnect Server...* | Click to disconnect the currently selected server. | +-----------------------------+--------------------------------------------------------------------------------------------------------------------------+ | *Drop Cascade* | Click to delete the currently selected object and all dependent objects from the server. | +-----------------------------+--------------------------------------------------------------------------------------------------------------------------+ @@ -65,6 +65,8 @@ following options (in alphabetical order): +-----------------------------+--------------------------------------------------------------------------------------------------------------------------+ | *Refresh...* | Click to refresh the currently selected object. | +-----------------------------+--------------------------------------------------------------------------------------------------------------------------+ +| *Remove Server* | Click to remove the currently selected server. | ++-----------------------------+--------------------------------------------------------------------------------------------------------------------------+ | *Scripts* | Click to open the :ref:`Query tool ` to edit or view the selected script from the flyout menu. | +-----------------------------+--------------------------------------------------------------------------------------------------------------------------+ | *Trigger(s)* | Click to *Disable* or *Enable* trigger(s) for the currently selected table. Options are displayed on the flyout menu. | diff --git a/docs/en_US/release_notes_4_15.rst b/docs/en_US/release_notes_4_15.rst index 9384e5709..7407abc92 100644 --- a/docs/en_US/release_notes_4_15.rst +++ b/docs/en_US/release_notes_4_15.rst @@ -21,7 +21,9 @@ Bug fixes ********* | `Issue #3130 `_ - Ensure create new object dialog should be opened when alt+shift+n key is pressed on the collection node. +| `Issue #3279 `_ - Fixed issue where Drop and Disconnect connection menu points are too close to each other. | `Issue #3789 `_ - Ensure context menus never get hidden below the menu bar. +| `Issue #3859 `_ - Rename the context menu from 'Drop Server' to 'Remove Server'. | `Issue #3913 `_ - Ensure the correct "running at" agent is shown when a pgAgent job is executing. | `Issue #3915 `_ - Fix an issue in the Query Tool where shortcut keys could be ignored following a query error. | `Issue #3999 `_ - Fix the toggle case shortcut key combination. diff --git a/web/pgadmin/browser/static/js/node.js b/web/pgadmin/browser/static/js/node.js index c6f15c443..0f95b1b2d 100644 --- a/web/pgadmin/browser/static/js/node.js +++ b/web/pgadmin/browser/static/js/node.js @@ -28,6 +28,10 @@ define('pgadmin.browser.node', [ F1: 112, }; + const REMOVE_SERVER_PRIORITY = 5; + const REMOVE_SERVER_LABEL = 'Remove Server'; + const SERVER = 'server'; + // It has already been defined. // Avoid running this script again. if (pgBrowser.Node) @@ -142,8 +146,8 @@ define('pgadmin.browser.node', [ module: self, applies: ['object', 'context'], callback: 'delete_obj', - priority: 2, - label: gettext('Delete/Drop'), + priority: self.get_menu_item_priority(self.type, 2), + label: self.change_menu_label(self.type, gettext('Delete/Drop')), data: { 'url': 'drop', }, @@ -755,15 +759,31 @@ define('pgadmin.browser.node', [ return; } } else { - msg = gettext('Are you sure you want to drop %s "%s"?', obj.label.toLowerCase(), d.label); - title = gettext('DROP %s?', obj.label); + var remove_drop_text; + if(obj.type === SERVER) { + remove_drop_text = 'Remove'; + } + else { + remove_drop_text = 'DROP'; + } + + msg = gettext('Are you sure you want to %s %s "%s"?', remove_drop_text.toLowerCase(), obj.label.toLowerCase(), d.label); + title = gettext('%s %s?', remove_drop_text, obj.label); if (!(_.isFunction(obj.canDrop) ? obj.canDrop.apply(obj, [d, i]) : obj.canDrop)) { - Alertify.error( - gettext('The %s "%s" cannot be dropped.', obj.label, d.label), - 10 - ); + if(obj.type === SERVER) { + Alertify.error( + gettext('The %s "%s" cannot be removed.', obj.label, d.label), + 10 + ); + } + else { + Alertify.error( + gettext('The %s "%s" cannot be dropped.', obj.label, d.label), + 10 + ); + } return; } } @@ -792,8 +812,14 @@ define('pgadmin.browser.node', [ console.warn(e.stack || e); } } - pgBrowser.report_error( - gettext('Error dropping %s: "%s"', obj.label, objName), msg); + if(obj.type === SERVER) { + pgBrowser.report_error( + gettext('Error removing %s: "%s"', obj.label, objName), msg); + } + else { + pgBrowser.report_error( + gettext('Error dropping %s: "%s"', obj.label, objName), msg); + } }); }, null).show(); @@ -1757,6 +1783,18 @@ define('pgadmin.browser.node', [ return this.parent_type; } }, + get_menu_item_priority: function(type, default_priority) { //downgrade Remove Server priority in menus only for Servers + if(type && type === SERVER) { + return REMOVE_SERVER_PRIORITY; + } + return default_priority; + }, + change_menu_label: function(type, default_label) { //change Delete/Drop menu option to Remove Server + if(type && type === SERVER) { + return gettext(REMOVE_SERVER_LABEL); + } + return default_label; + }, }); return pgAdmin.Browser.Node;