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 1hplHW-0000p3-Pt for pgadmin-hackers@arkaria.postgresql.org; Tue, 23 Jul 2019 03:16:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hplHV-0001TQ-IA for pgadmin-hackers@arkaria.postgresql.org; Tue, 23 Jul 2019 03:16:01 +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 1hplHV-0001TJ-9s for pgadmin-hackers@lists.postgresql.org; Tue, 23 Jul 2019 03:16:01 +0000 Received: from mail-ot1-x341.google.com ([2607:f8b0:4864:20::341]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hplHS-0007m4-2L for pgadmin-hackers@postgresql.org; Tue, 23 Jul 2019 03:16:00 +0000 Received: by mail-ot1-x341.google.com with SMTP id j19so4096301otq.2 for ; Mon, 22 Jul 2019 20:15:57 -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=zs4ovvEtNY9VIWQTaa1UjmwnkD5p4kIwecs5KZcndTc=; b=ZrVOamtbiIoUe/F4uUY4ZA9vPbnpwGmUJwVokMooAKqvzp71fXwWVNWfjQ6MxwPqQF lhG9QKPupSX9CAzZw3XoaA24XBTDA1k1BV+lojxf0CWKsWYJCkggaRwJs0ROO8sO3XR3 1oIK1K4vtDkVbOSfiOsmlKOPAn2u7DSlOZySgdh4ts5wM/IjIPHLW3IW43jOsR6yRD86 0A3uLV8fTg47sDFInKULE+YxAV+k3TsEpH51oDwpmXo/zwLT2FoGflF8VhOYfmGXsPAA 9d24xd6Fhi0OlPfWrfXNnroBjkK447/lW8tXSmBWRKN/zXSQBtI87WBc0l1KsKhFdMBO Zuqw== 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=zs4ovvEtNY9VIWQTaa1UjmwnkD5p4kIwecs5KZcndTc=; b=XuyrgUWBQ5li4Q2Lpgy9Vqqc0/RVtT001gNvDestN8YfU5L5bp/9zCDhQsURAAcVWC nzIZAI5ooqJESorgjRlYdSM2RqGba26cKenUzOGKU1B07UiFLyANi7KrhQ7WUlZ0Qnqc lqPck7b5sgY7TrXjHYnDxm01aBxlYvFAIS+tn6ooM+n4j/J2LbYOVp3UxqMlLb4ccr2D hanIkqK1ACVM1ghLYrwZwtSs7WBch7JHyZJggvpbnAQxlFXdgl0dIV+kVhgZxSeO5tTy fr1ByDZcZoKTWCxaNVpidbCpPZ4BvjQDesgjtKMvxMbV9xSOxklxbe7wKUuquspkIWiE 9dMg== X-Gm-Message-State: APjAAAUUsbUKsRl11BtW6wppwuMcsn/Qp3vA/l+8+wjw4s1Q3NJ64fB0 S5zzxMlHqRQKbhxoKmls4FufIz6yXunCuWJpIpmAMg== X-Google-Smtp-Source: APXvYqx5Cu07KBNtiAqeeSavhKMb++tBny+GaGXJ5ZCFWuQFRo7/dqK2FRjpmPFFz3JRWcQ4jV588FmjhHX+0tD2B74= X-Received: by 2002:a9d:5787:: with SMTP id q7mr14317802oth.75.1563851754934; Mon, 22 Jul 2019 20:15:54 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Khushboo Vashi Date: Tue, 23 Jul 2019 08:45:45 +0530 Message-ID: Subject: Re: Bug in Database Nodes in the Tree To: Yosry Muhammad Cc: Dave Page , pgadmin-hackers Content-Type: multipart/alternative; boundary="00000000000055b28e058e509cd9" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --00000000000055b28e058e509cd9 Content-Type: text/plain; charset="UTF-8" On Tue, Jul 23, 2019 at 2:17 AM Yosry Muhammad wrote: > Hi, > > I tried just removing the lines responsible for connecting to the database > on selecting a database node and it seem to work fine. Specifically the > lines 254-257 in database.js (callbacks.selected function). > > Are there any specific scenarios I need to test to make sure everything is > okay? Anywhere else in the code where I need to make changes? > > I think all the right side panels (i.e. Properties, SQL, etc...) will be affected. > I also checked the tree state restore and it seems to work fine. > > Thanks. > > > On Fri, Jul 19, 2019 at 7:01 AM Khushboo Vashi < > khushboo.vashi@enterprisedb.com> wrote: > >> >> >> 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 >>> >> > > -- > *Yosry Muhammad Yosry* > > Computer Engineering student, > The Faculty of Engineering, > Cairo University (2021). > Class representative of CMP 2021. > https://www.linkedin.com/in/yosrym93/ > --00000000000055b28e058e509cd9 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Tue, Jul 23, 2019 at 2:17 AM Yosry= Muhammad <yosrym93@gmail.com&= gt; wrote:
Hi,

I tried just removing the lin= es responsible for connecting to the database on selecting a database node = and it seem to work fine. Specifically the lines 254-257 in database.js (ca= llbacks.selected function).

Are there any specific= scenarios I need to test to make sure everything is okay? Anywhere else in= the code where I need to make changes?

I think all the right side panels (i.e. Properties, SQL, etc...) will be = affected.=C2=A0
I also checked the tree state restore and it s= eems to work fine.

Thanks.


On Fri, Jul 19, 2019 at 7:01 AM Khushboo Vashi <khushboo.vashi@enterprisedb.c= om> wrote:


On Thu, Jul 18, 2019 at 1:44 PM Dav= e Page <dpage@pga= dmin.org> wrote:
Hi

On Thu, Jul 18, 2019 at 6:40 AM Yosry Muham= mad <yosrym93@gm= ail.com> wrote:
Hi,

On Thu, Jul 18, 2019, 7:27 AM Khushboo Vashi= <k= hushboo.vashi@enterprisedb.com> wrote:
Hi Yosry,
On= Wed, Jul 17, 2019 at 10:49 PM Yosry Muhammad <yosrym93@gmail.com>= ; wrote:
Hi Khushboo,

There&= #39;s a minor bug that I noticed a while back that when you right click a d= isconnected database (to drop it for example) it automatically connects to = the database and expands the node. This behaviour is a little annoying to u= sers (me too), I am trying to fix it.

This behavior is by design as we have considered some o= f the pgAdmin III=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 an= d when we expand the database node (by arrow icon or double click), we can = connect and expand both.

We need Dave's approv= al to change this.

I think this makes more sense.
<= /blockquote>

pgAdmin 3 automatically connects databases = on select but not servers. I'd be fine with only connecting databases a= nd 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 dat= abase or server without it connecting. FYI, I've found this behaviour a= nnoying too.

This change = will definitely affect the auto-expand and tree-view state restore, but tha= t can be handled by some code changes.
<= div>I can't imagine it would require hacking aciTree to make that happe= n - we'd basically just move the connect function call from the onSelec= t handler (or whatever it's called) to onExpand wouldn't we?
<= /div>
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, data= base.js, menu.js) and I couldn't find a way to modify this behaviour. I= s this handled internally by jQuery? Is modifying this behaviour feasible?<= /div>
=C2=A0
=
I think the problem is that the right click event trigger= s the left event click too. Am I correct?

=
Basically, the browser tree is generated through th= e 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.=C2=A0


--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitt= er: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise Postg= reSQL Company


--
Yosry Muhammad Yosry

Compute= r Engineering student,
The Faculty of = Engineering,
Cairo University (2021).
Class representative of CMP 2021.
--00000000000055b28e058e509cd9--