public inbox for [email protected]  
help / color / mirror / Atom feed
From: Aditya Toshniwal <[email protected]>
To: pgadmin-hackers <[email protected]>
Subject: [pgAdmin4][RM3575] Right click does not work on database node if server name changed
Date: Wed, 9 Jan 2019 16:16:03 +0530
Message-ID: <CAM9w-_mBN5ZYxTZ2wcWuJ6RLvsffG+iha9Zb8bRJok=-cuNZ7w@mail.gmail.com> (raw)

Hi Hackers,

Attached is the patch to fix the issue where changing the name (or any
visible property on tree) of the server node breaks the context menu on the
database nodes.

The user information of the server is updated on successful connection.
Here, the data is updated on the aciTreeNode(domNode). But, in the context
menu the user data is referred from TreeNode object (a wrapper to
aciTreeNode). After checking the code (and a lot of debugging) it was found
that aciTreeNode and TreeNode point to two different data(I don't know
why). Every time you change one, it should be synced to other, which is not
done everywhere.
Changes are done to point both aciTreeNode and TreeNode data to the same
data object.

Kindly review.
-- 
Thanks and Regards,
Aditya Toshniwal
Software Engineer | EnterpriseDB Software Solutions | Pune
"Don't Complain about Heat, Plant a tree"


Attachments:

  [application/octet-stream] RM3575.patch (431B, 3-RM3575.patch)
  download | inline diff:
diff --git a/web/pgadmin/static/js/tree/tree.js b/web/pgadmin/static/js/tree/tree.js
index ed2f63d9..782f4d59 100644
--- a/web/pgadmin/static/js/tree/tree.js
+++ b/web/pgadmin/static/js/tree/tree.js
@@ -135,7 +135,7 @@ export class Tree {
     }
     const oldNode = this.findNode(oldNodePath);
     if (oldNode !== null) {
-      oldNode.data = Object.assign({}, data);
+      oldNode.data = data;
       return oldNode;
     }
 


view thread (2+ 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: [pgAdmin4][RM3575] Right click does not work on database node if server name changed
  In-Reply-To: <CAM9w-_mBN5ZYxTZ2wcWuJ6RLvsffG+iha9Zb8bRJok=-cuNZ7w@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