[pgAdmin][RM3279] the Drop and Disconnect connection menupoints are too close for each others
Rahul Shirsat <[email protected]>
| Newsgroups | gmane.comp.db.postgresql.pgadmin.devel |
|---|---|
| Message-ID | <CAKtn9dMAsevQCxKd7aQPej1D5mKruhTYAQcs+kLT8n2kRM+mfw@mail.gmail.com> |
Hi Hackers, Attached is the patch to move "Delete/Drop" menu option away from "Disconnect Servers" for server node. Additionally, I have renamed the "Delete/Drop" menu option to "Remove Server" for server node against issue RM3859. -- *Rahul Shirsat* Software Engineer | EnterpriseDB Corporation | Pune.
RM3279_3859.patch
(application/octet-stream, 1.1 KB)
diff --git a/web/pgadmin/browser/static/js/node.js b/web/pgadmin/browser/static/js/node.js
index 292d60c0d..3588bf9d3 100644
--- a/web/pgadmin/browser/static/js/node.js
+++ b/web/pgadmin/browser/static/js/node.js
@@ -142,8 +142,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',
},
@@ -1742,6 +1742,18 @@ define('pgadmin.browser.node', [
return this.parent_type;
}
},
+ get_menu_item_priority: function(type, default_priority) {
+ if(type && type === 'server') {
+ return 997;
+ }
+ return default_priority;
+ },
+ change_menu_label: function(type, default_label) {
+ if(type && type === 'server') {
+ return gettext('Remove Server');
+ }
+ return default_label;
+ },
});
return pgAdmin.Browser.Node;