Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ho1Yt-0007qR-Gv for pgadmin-hackers@arkaria.postgresql.org; Thu, 18 Jul 2019 08:14:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ho1Ys-0005dj-Az for pgadmin-hackers@arkaria.postgresql.org; Thu, 18 Jul 2019 08:14:46 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ho1Yq-0005V6-Dc for pgadmin-hackers@lists.postgresql.org; Thu, 18 Jul 2019 08:14:46 +0000 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ho1Ym-0003iJ-Se for pgadmin-hackers@postgresql.org; Thu, 18 Jul 2019 08:14:43 +0000 Received: by mail-wm1-x342.google.com with SMTP id l2so24660755wmg.0 for ; Thu, 18 Jul 2019 01:14:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pgadmin.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ejleow+7ZYsbpFaNh2vbrTw1LXSTfx5kCa9ZHuVbu4Q=; b=NPXaj0CPNlPs2rUZjAHU52nPT11M+bVeJinHlxEdhIWZiI8N6OllFZ3Opx6L/nV8Qr ep+R4ck4Ozy11LiF2KEIYrBJG2B8DyBScqbJtlPk8Dp6Ispsdd1NVCTo6L5sKK1RhxDT CQ4gGaIOs1YQEJdRa5IsPpk9yn4HE/MmNsiBIBMJvucdIw6+cwn/kex9AELR2iKOyA8i TPOT1o1W4WBEg1N8Fn9lIU9XYgyRs+S84FtJVsTM6CsW2DseSNcqqcLQHmvd52+0mTlG wCGHezZ/8hva+9bJYaJ2AIymHzRKQbgOJ1VLuUz/7hgcbEi2exIaqQ8CXwSwPOt/lYbY gn5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ejleow+7ZYsbpFaNh2vbrTw1LXSTfx5kCa9ZHuVbu4Q=; b=XCvkNnspAay+Ii1nqzR2rCB3hT5FV1hLze4QjZiYH4nrCXKG+dnXFEgl9zYN7q3Mr1 lRZezxA4DfgrVo0moa9k+oiw3Ry7WgR510AvYRLiIZAMizn9nW+HlzGKso5JirGYdQzJ sB8c/ykCtou3iIySse8KbRQ6PFKq4xeudGnDCCbNLpgE2T1pJkkD2fBkr9R7Zn9oXWiQ 9tEEy9kx9Tp9Y+ftFj9xlCuqJZzgH4wMs84winMiQ0quGRwhCNChe7MzAiYak9rGI6ri nkz/gpgf75iv2vtMAcHv+FpNCTvgQMffN3/Q1EKoZJ7WpoN7G/+MVbHVzZ8HWqsMugxA Mlsg== X-Gm-Message-State: APjAAAUn4rcB3fbIFtfMVIYwaZukF2B/gLalRqPv1tSgdMvFyaZCE5TT uFoMfPsjDB1zt1SU1tLHkf9zVF1cJF7pPT61M932tQ== X-Google-Smtp-Source: APXvYqzznuqXcl2yEAVBTxAJTEtuuiCFeAMkvAunoUf40zfAeaa8x2UBqSMI4Sz2z81JxUwvMzIhSZVTUCqzOwx2+s8= X-Received: by 2002:a1c:f018:: with SMTP id a24mr39780848wmb.66.1563437678072; Thu, 18 Jul 2019 01:14:38 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Dave Page Date: Thu, 18 Jul 2019 09:14:26 +0100 Message-ID: Subject: Re: Bug in Database Nodes in the Tree To: Yosry Muhammad Cc: Khushboo Vashi , pgadmin-hackers Content-Type: multipart/alternative; boundary="0000000000006e2b05058df033cd" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --0000000000006e2b05058df033cd Content-Type: text/plain; charset="UTF-8" Hi On Thu, Jul 18, 2019 at 6:40 AM Yosry Muhammad wrote: > Hi, > > On Thu, Jul 18, 2019, 7:27 AM Khushboo Vashi < > khushboo.vashi@enterprisedb.com> wrote: > >> Hi Yosry, >> >> On Wed, Jul 17, 2019 at 10:49 PM Yosry Muhammad >> wrote: >> >>> Hi Khushboo, >>> >>> There's a minor bug that I noticed a while back that when you right >>> click a disconnected database (to drop it for example) it automatically >>> connects to the database and expands the node. This behaviour is a little >>> annoying to users (me too), I am trying to fix it. >>> >>> This behavior is by design as we have considered some of the pgAdmin >> III behavior. One behavior we can change is that on the selection of the >> database node, we can just connect it and not expand it and when we expand >> the database node (by arrow icon or double click), we can connect and >> expand both. >> >> We need Dave's approval to change this. >> > > I think this makes more sense. > pgAdmin 3 automatically connects databases on select but not servers. I'd be fine with only connecting databases and servers on expand, and not on select. That should not affect auto-expand and treeview state restore at all, but will mean you can right-click a database or server without it connecting. FYI, I've found this behaviour annoying too. I can't imagine it would require hacking aciTree to make that happen - we'd basically just move the connect function call from the onSelect handler (or whatever it's called) to onExpand wouldn't we? > > >> I looked around the code in the browser module (node.js, database.js, >>> menu.js) and I couldn't find a way to modify this behaviour. Is this >>> handled internally by jQuery? Is modifying this behaviour feasible? >>> >>> >> I think the problem is that the right click event triggers the left event >>> click too. Am I correct? >>> >>> Basically, the browser tree is generated through the aciTree library, so >> when required, the public APIs (provided by aciTree) of the events are >> being called. >> In this case, on the selection of the database node, the selected event >> is used in the database.js file. >> >> Thanks for the clarification. > -- Dave Page Blog: http://pgsnake.blogspot.com Twitter: @pgsnake EnterpriseDB UK: http://www.enterprisedb.com The Enterprise PostgreSQL Company --0000000000006e2b05058df033cd Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi

On Thu, Jul 18, 2019 at 6:40 AM Yosry Muhammad <= yosrym93@gmail.com> wrote:
=
<= div>Hi,

On Thu, Jul 18, 2019, 7:27 AM Khushboo Vashi <khushboo.vashi@enterprisedb= .com> wrote:
Hi Yosry,

On Wed, Jul 17, 2019 at 10:4= 9 PM Yosry Muhammad <yosrym93@gmail.com> wrote:
Hi Khushboo,
There's a minor bug that I n= oticed a while back that when you right click a disconnected database (to d= rop it for example) it automatically connects to the database and expands t= he node. This behaviour is a little annoying to users (me too), I am trying= to fix it.

This b= ehavior is by design as we have considered some of the pgAdmin III=C2=A0beh= avior. One behavior we can change is that on the selection of the database = node, we can just connect it and not expand it and when we expand the datab= ase node (by arrow icon or double click), we can connect and expand both.

We need Dave's approval to change this.

I think this makes more sense.

pgAdmin 3 automatically connects databases on select but not servers.= I'd be fine with only connecting databases and servers on expand, and = not on select. That should not affect auto-expand and treeview state restor= e at all, but will mean you can right-click a database or server without it= connecting. FYI, I've found this behaviour annoying too.
I can't imagine it would require hacking aciTree to make th= at happen - we'd basically just move the connect function call from the= onSelect handler (or whatever it's called) to onExpand wouldn't we= ?
=C2=A0
<= div dir=3D"auto">


I looked around the code in the browser module (node.js, databas= e.js, menu.js) and I couldn't find a way to modify this behaviour. Is t= his handled internally by jQuery? Is modifying this behaviour feasible?
=C2=A0
I think the problem is that the right click event triggers t= he left event click too. Am I correct?

Basically, the browser tree is generated through the a= ciTree library, so when required, the public APIs (provided by aciTree) of = the events are being called.
In this case, on the selection of th= e database node, the selected event is used in the database.js file.
<= div>
Thanks for the clarification.=C2=A0


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

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL = Company
--0000000000006e2b05058df033cd--