public inbox for [email protected]  
help / color / mirror / Atom feed
[pgAdmin4][RM3575] Right click does not work on database node if server name changed
2+ messages / 2 participants
[nested] [flat]

* [pgAdmin4][RM3575] Right click does not work on database node if server name changed
@ 2019-01-09 10:46  Aditya Toshniwal <[email protected]>
  0 siblings, 1 reply; 2+ messages in thread

From: Aditya Toshniwal @ 2019-01-09 10:46 UTC (permalink / raw)
  To: pgadmin-hackers

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;
     }
 


^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: [pgAdmin4][RM3575] Right click does not work on database node if server name changed
@ 2019-01-10 06:23  Dave Page <[email protected]>
  parent: Aditya Toshniwal <[email protected]>
  0 siblings, 0 replies; 2+ messages in thread

From: Dave Page @ 2019-01-10 06:23 UTC (permalink / raw)
  To: Aditya Toshniwal <[email protected]>; +Cc: pgadmin-hackers

Thanks - patch applied.

On Wed, Jan 9, 2019 at 4:16 PM Aditya Toshniwal
<[email protected]> wrote:
>
> 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"



-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company





^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2019-01-10 06:23 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-01-09 10:46 [pgAdmin4][RM3575] Right click does not work on database node if server name changed Aditya Toshniwal <[email protected]>
2019-01-10 06:23 ` Dave Page <[email protected]>

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