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 1hoL17-0001bz-NW for pgadmin-hackers@arkaria.postgresql.org; Fri, 19 Jul 2019 05:01:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hoL16-0000Jo-Gp for pgadmin-hackers@arkaria.postgresql.org; Fri, 19 Jul 2019 05:01:12 +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 1hoL16-00009N-4O for pgadmin-hackers@lists.postgresql.org; Fri, 19 Jul 2019 05:01:12 +0000 Received: from mail-ot1-x32f.google.com ([2607:f8b0:4864:20::32f]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hoL11-0006WJ-U3 for pgadmin-hackers@postgresql.org; Fri, 19 Jul 2019 05:01:11 +0000 Received: by mail-ot1-x32f.google.com with SMTP id r21so25446544otq.6 for ; Thu, 18 Jul 2019 22:01:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=bqPdSwNkRKG+IkH4XRwGqMPsWA5qw4q2vp5lG+Qr4/Q=; b=iFnSeVJbZoPRdqSGKigpInE2rMjWHM1JFp9bQfWCArPxBDDbUHQZhOIoagjU1M61cC TZZ6INmuAoHCNfc67B1meIqLN4XX9MsxpTtePYdZIJsL7b07HYWn0ce1B/hT+oLRhVAz gP1/f7l0Lg0Q4y/Qkd14Alb+7UYMxncVxIP+xzlKgX9aZF2ka/D9AFnDYun2UtHg4glT +o/3mOeXOwwreSLvgenMoh50How/PNfUUFwtXr+XLQHrOdbs2p9eN5kEHbO51ccuW3UV aCqUvF40c/NDJzas9aRg7lyp5GlvF4tCvgN4GcSaVemPmQK15yHe266jstaSSP9Mkyin 7Fsg== 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=bqPdSwNkRKG+IkH4XRwGqMPsWA5qw4q2vp5lG+Qr4/Q=; b=ok83HW8ceeou9t4ZqgtQSBTnNB3l/iz7lPfbESWqom6T64k5jCcpBFQOYrpplVbP/3 SjTTGQO/0flIK3Ydk0INguvm9SIb8JlD0Jo11kb/dVMEgI6ShyGJ0HlwZMM4s/k5lHzt yxGfDprVDkhbhVEIWGpODCQTqpdA6/hv5EWFfsLyAwd5F2jEge148iy+MiQDe9QK2asC iBTxkTN2faei6q4eBD/+FL0mepABepFjPk5VJuXD54boWsBXnV6aSPukDVH1ehjUNhy3 2Zm8Ux4VRphfzXqZZ9bRe5cjdrWd+lL4dgImIjaX48Sec4x99NrCGJwoKamOLXJKZAW5 KPVw== X-Gm-Message-State: APjAAAWSy4EY4QRQBIGjRpSSUq+EoaN3vn9FsN8nBRaOUnMWaK83tR/i xkMp0eyGKxtDaqT1YBm/DMq2SJP/4INqqFOH2MfxsQ== X-Google-Smtp-Source: APXvYqzZS6C+PzvPGmtulyqB2hcLrkTK4Mx2ge4LSsJVGxLCmRETuGp6K65SVHbOAKWv2Rk18CgZtfo9YoI9RmJ0NUg= X-Received: by 2002:a9d:6b11:: with SMTP id g17mr11422405otp.347.1563512464823; Thu, 18 Jul 2019 22:01:04 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Khushboo Vashi Date: Fri, 19 Jul 2019 10:30:55 +0530 Message-ID: Subject: Re: Bug in Database Nodes in the Tree To: Dave Page Cc: Yosry Muhammad , pgadmin-hackers Content-Type: multipart/alternative; boundary="000000000000119c64058e019d38" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --000000000000119c64058e019d38 Content-Type: text/plain; charset="UTF-8" On Thu, Jul 18, 2019 at 1:44 PM Dave Page wrote: > 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. > > This change will definitely affect the auto-expand and tree-view state restore, but that can be handled by some code changes. > 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? > Right, as we have implemented both expand and select calls, we just need to remove the select handler. > > >> >> >>> 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 > --000000000000119c64058e019d38 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Thu, Jul 18, 2019 at 1:44 PM Dave = Page <dpage@pgadmin.org> wro= te:
Hi

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

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

On Wed, Jul 17, 2019= at 10:49 PM Yosry Muhammad <yosrym93@gmail.com> wrote:
Hi Kh= ushboo,

There's a minor bu= g that I noticed a while back that when you right click a disconnected data= base (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.

<= div>This behavior is by design as we have considered some of the pgAdmin II= I=C2=A0behavior. 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 expa= nd both.

We need Dave's approval to change thi= s.

I think this makes more sense.

pgAdmin 3 automatically connects databases on select but no= t servers. I'd be fine with only connecting databases and servers on ex= pand, and not on select. That should not affect auto-expand and treeview st= ate 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.

This change will definitely = affect the auto-expand and tree-view state restore, but that can be handled= by some code changes.
I can't = imagine it would require hacking aciTree to make that happen - we'd bas= ically just move the connect function call from the onSelect handler (or wh= atever it's called) to onExpand wouldn't we?
Right, as we have implemented both expand and select calls, we= just need to remove the select handler.=C2=A0
=C2=A0


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 i= nternally by jQuery? Is modifying this behaviour feasible?
=C2=A0
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 librar= y, so when required, the public APIs (provided by aciTree) of the events ar= e being called.
In this case, on the selection of the database no= de, the selected event is used in the database.js file.

Thanks f= or the clarification.=C2=A0


--
Dave Page
Blog: http://pgsnake.blogs= pot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
= The Enterprise PostgreSQL Company
--000000000000119c64058e019d38--