public inbox for [email protected]  
help / color / mirror / Atom feed
From: Pradip Parkale <[email protected]>
To: pgadmin-hackers <[email protected]>
Subject: [pgAdmin][RM5861]:Remove server' option is not available through context click
Date: Wed, 23 Sep 2020 17:30:22 +0530
Message-ID: <CAJ9T6SvvpdQXiGGqaidAZ6mKzZZSKvNpiEPhH7-t3cefwMxF3g@mail.gmail.com> (raw)

Hi Hackers,

Please find the attached patch following the issue.

   1. The 'Remove server' option is not available.
   2. 'Shared server owner' property is visible in a desktop mode which
   shouldn't.


-- 
Thanks & Regards,
Pradip Parkale
Software Engineer | EnterpriseDB Corporation


Attachments:

  [application/octet-stream] RM5861.patch (1.7K, 3-RM5861.patch)
  download | inline diff:
diff --git a/web/pgadmin/browser/server_groups/servers/static/js/server.js b/web/pgadmin/browser/server_groups/servers/static/js/server.js
index 8a4be22b4..be737da4e 100644
--- a/web/pgadmin/browser/server_groups/servers/static/js/server.js
+++ b/web/pgadmin/browser/server_groups/servers/static/js/server.js
@@ -58,7 +58,7 @@ define('pgadmin.node.server', [
       label: gettext('Server'),
       canDrop: function(node){
         var serverOwner = node.user_id;
-        if (serverOwner != current_user.id)
+        if (serverOwner != current_user.id && !_.isUndefined(serverOwner))
           return false;
         return true;
       },
@@ -763,6 +763,14 @@ define('pgadmin.node.server', [
         },
         {
           id: 'server_owner', label: gettext('Shared Server Owner'), type: 'text', mode: ['properties'],
+          visible:function(model){
+            var serverOwner = model.attributes.user_id;
+            if (model.attributes.shared && serverOwner != current_user.id && pgAdmin.server_mode == 'True'){
+              return true;
+            }
+            return false;
+
+          },
         },
         {
           id: 'server_type', label: gettext('Server type'), type: 'options',
@@ -1239,7 +1247,7 @@ define('pgadmin.node.server', [
           // Let's not change the status of the tree node now.
           if (!_wasConnected) {
             tree.setInode(_item);
-            if (data.shared && pgAdmin.server_mode == 'True'){
+            if (_data.shared && pgAdmin.server_mode == 'True'){
               tree.addIcon(_item, {icon: 'icon-shared-server-not-connected'});
             }else{
               tree.addIcon(_item, {icon: 'icon-server-not-connected'});


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][RM5861]:Remove server' option is not available through context click
  In-Reply-To: <CAJ9T6SvvpdQXiGGqaidAZ6mKzZZSKvNpiEPhH7-t3cefwMxF3g@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