public inbox for [email protected]  
help / color / mirror / Atom feed
From: Rahul Shirsat <[email protected]>
To: [email protected]
Subject: [pgAdmin][RM3279] the Drop and Disconnect connection menupoints are too close for each others
Date: Tue, 5 Nov 2019 14:47:58 +0530
Message-ID: <CAKtn9dMAsevQCxKd7aQPej1D5mKruhTYAQcs+kLT8n2kRM+mfw@mail.gmail.com> (raw)

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.


Attachments:

  [application/octet-stream] RM3279_3859.patch (1.1K, 3-RM3279_3859.patch)
  download | inline diff:
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;


view thread (3+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected]
  Subject: Re: [pgAdmin][RM3279] the Drop and Disconnect connection menupoints are too close for each others
  In-Reply-To: <CAKtn9dMAsevQCxKd7aQPej1D5mKruhTYAQcs+kLT8n2kRM+mfw@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox