Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f3h03-0002Tn-N6 for pgadmin-hackers@arkaria.postgresql.org; Wed, 04 Apr 2018 11:54: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 1f3h02-0004AJ-A1 for pgadmin-hackers@arkaria.postgresql.org; Wed, 04 Apr 2018 11:54: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_SHA384:256) (Exim 4.89) (envelope-from ) id 1f3h02-0004A4-3O for pgadmin-hackers@lists.postgresql.org; Wed, 04 Apr 2018 11:54:46 +0000 Received: from mail-oi0-x22f.google.com ([2607:f8b0:4003:c06::22f]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1f3gzx-00042s-PG for pgadmin-hackers@postgresql.org; Wed, 04 Apr 2018 11:54:45 +0000 Received: by mail-oi0-x22f.google.com with SMTP id f63-v6so7104268oic.4 for ; Wed, 04 Apr 2018 04:54:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=oFZkLyq8Y5osG9uo39jJMLhUwNr9ZwndPK+eW/p8OLw=; b=w0ABMXJ7zmQ6UmO8TuottoLS/QD7rClwFBQu5DXHz7OAcM3sTHqSfDUolArRkRf1n3 BbKRca1K1oRrwZZk60SislEEUQ+5iVJ7dcWkuPSO/oLRcyAW6TiANbSzXPXJGFvh9mA0 YFhLGzHZKDGBJMBny86yOGARAnFT//UGCUlyiCQmzxaudSmC7GPMgnrLOHXvqa9RO/jo IHXWS5V2rzfAQ4b81QWJ68PoOYH0x7XbdE9zBZfljddDWylGhBuXfS3fdpEf51xo/AFb Dumsc0dv32+5BWJ7TDAxrg2NFV3a2yBWmxYgZL5syodjWvwGYksVBfmH/FlTYCBsbrf2 pmEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=oFZkLyq8Y5osG9uo39jJMLhUwNr9ZwndPK+eW/p8OLw=; b=Y+SMKAcANdJTc6pCqaIxNEIQLmyvyMak+yKzwX67PcMVbypooIPPR7F3PVGp5Nnv6H ozYaVO6AlNpfJ2tjAZKK+ma4w6ELp2M+G0KdZEql3Zxa2NqsO9zjpjNdTz43OaScEbzD AtWTVuBze15KUeq5T3d3+F3EfcoS+Ec2B8M3edj5Xx499sKP2Tl2S9AJiBb2MAy5EBsm TXlUoO+GwB/zjQa/hWHuVubpNWSEuey3KXjY8UTmxJrcTMiaSQZg2Mv/jeZXRlLYae7y IWZDZ6mRgMHrgNRRYOvl4k3Z7NTI9cp8N6J9aTWxP7GQ1fxqBWeqWUWcmN7aFCA/YBA3 0YMg== X-Gm-Message-State: ALQs6tBJEiyj59XPcArcWQxUzC67GvDxPqW6V0X431Ly32Y++lka5HwP ETYf2Ay8KpfPc3CtYS7luEYHG6OPUsiVEPEbKHEjsQ== X-Google-Smtp-Source: AIpwx48G3BQ6Hddftu8OoaOpVAP6Zi4WGD/rEbc+VzhvwT5h1oWBBxGQCn1Lt1Y6drYGihhijSAsSm5U7HiqRGmqw64= X-Received: by 2002:aca:ce43:: with SMTP id e64-v6mr10298232oig.342.1522842878861; Wed, 04 Apr 2018 04:54:38 -0700 (PDT) MIME-Version: 1.0 Received: by 10.138.6.138 with HTTP; Wed, 4 Apr 2018 04:54:18 -0700 (PDT) In-Reply-To: References: From: Murtuza Zabuawala Date: Wed, 4 Apr 2018 17:24:18 +0530 Message-ID: Subject: Re: [pgAdmin4][RM#3155] Allow user to lock the Layout To: Dave Page Cc: Joao De Almeida Pereira , pgadmin-hackers Content-Type: multipart/alternative; boundary="000000000000d81cda0569047c15" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --000000000000d81cda0569047c15 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Apr 4, 2018 at 5:00 PM, Dave Page wrote: > > > On Wed, Apr 4, 2018 at 10:45 AM, Murtuza Zabuawala < > murtuza.zabuawala@enterprisedb.com> wrote: > >> On Wed, Apr 4, 2018 at 2:47 PM, Dave Page wrote: >> >>> >>> >>> On Wed, Apr 4, 2018 at 7:20 AM, Murtuza Zabuawala < >>> murtuza.zabuawala@enterprisedb.com> wrote: >>> >>>> Hi Dave, >>>> >>>> On Tue, Apr 3, 2018 at 9:03 PM, Dave Page wrote: >>>> >>>>> Hi >>>>> >>>>> On Tue, Apr 3, 2018 at 12:56 PM, Murtuza Zabuawala < >>>>> murtuza.zabuawala@enterprisedb.com> wrote: >>>>> >>>>>> Hi, >>>>>> >>>>>> Thanks Joao for reviewing. >>>>>> >>>>>> PFA updated patch. >>>>>> >>>>>> On Tue, Apr 3, 2018 at 1:11 AM, Joao De Almeida Pereira < >>>>>> jdealmeidapereira@pivotal.io> wrote: >>>>>> >>>>>>> Hello, >>>>>>> >>>>>>> On Mon, Apr 2, 2018 at 10:07 AM Murtuza Zabuawala < >>>>>>> murtuza.zabuawala@enterprisedb.com> wrote: >>>>>>> >>>>>>>> >>>>>>>> =E2=80=8BHello, >>>>>>>> >>>>>>>> Please find updated patch, >>>>>>>> >>>>>>>> Now layout will be locked after user updates its preferences, w >>>>>>>> e have used =E2=80=8B >>>>>>>> templated variable in the javascript file >>>>>>>> =E2=80=8B because we do not have preference module or preference c= ache >>>>>>>> available when the page loads and panels gets rendered, >>>>>>>> =E2=80=8BI >>>>>>>> =E2=80=8B also >>>>>>>> made changes in JS tests as per Joao's review comments. >>>>>>>> >>>>>>> Looks like everything is working when we change the lock. >>>>>>> As a personal preferences I would prefer to see this in at least 2 >>>>>>> commits, one that is related to the preference issue and another on= e that >>>>>>> is related to this story. >>>>>>> >>>>>>> >>>>>>> All the tests are working, but he linter is failing: >>>>>>> >>>>>>> /tmp/build/4a5630c2/pivotal-rm-3155/web /tmp/build/4a5630c2 >>>>>>> >>>>>>> ./pgadmin/misc/__init__.py:78: [E303] too many blank lines (2) >>>>>>> >>>>>>> 1 E303 too many blank lines (2) >>>>>>> >>>>>>> >>>>>>> 1 >>>>>>> >>>>>> =E2=80=8BFixed=E2=80=8B >>>>>> >>>>>> >>>>>>> >>>>>>> >>>>>>>> @Dave/Pivotal team, >>>>>>>> The given patch is working fine for all the Tabs/Panels (all the >>>>>>>> panels from main window as well as from Query tool and Debugger) b= ut I'm >>>>>>>> facing an issue while handling the Browser tree section, It is a w= cDocer >>>>>>>> frame and not >>>>>>>> a wcDocker panel >>>>>>>> . Like >>>>>>>> wcDocker panel, wcDocker frame do not provide any API so that a de= veloper >>>>>>>> can prevent drag-drop functionality on it. >>>>>>>> >>>>>>> >>>>> It's not working fine for me. For example, if I put the SQL Panel on >>>>> it's own below the properties/stats panels (so it looks like pgAdmin = 3 used >>>>> to by default), and then lock the layout, I can un-dock the SQL panel= into >>>>> a dialogue, but then cannot re-dock it. I can do weird things with th= e >>>>> browser tree as well, probably because it's a frame as you say. >>>>> >>>> >>>> =E2=80=8BThat is expected behaviour =E2=80=8Bbecause once you drag the= panel out of the >>>> group of Panels then it becomes individual Frame, That is what the aut= hor >>>> of the wcDocker replied on my question, >>>> *"A panel must either be initialized as movable or non-movable from th= e >>>> beginning and never changed because it generates a different arrangeme= nt of >>>> elements depending. This feature should only ever be used within the >>>> onCreate method of the panel. I should probably have been more clear a= bout >>>> this limitation in the documentation."* >>>> >>>> >>> So does it become a panel again if a second panel is added to the new >>> tab group? >>> >> =E2=80=8BNo, it stays Frame.=E2=80=8B >> >> As far as I understand Panel needs a Frame to render itself if it is not >> attached to the main docker instance.=E2=80=8B >> >>> >>> There must be some way we can lock a tab that's not part of a group. >>> >> At a moment there is no way of =E2=80=8B >> locking frames out of the box :( >> =E2=80=8B >> > > Hmm, so the question becomes: do we include the lock feature, but rename > it to "Lock Tabs" or something similar, or leave it out altogether? It > clearly doesn't do everything we want right now. > =E2=80=8BI would say lets include the feature by adding warning note that t= his feature works with default layout only, And I don't think most user will try to drag drop Browser panel =E2=80=8B anyway, meanwhile I'll check what changes are required in main source code to make the Frame lock. > > -- > Dave Page > Blog: http://pgsnake.blogspot.com > Twitter: @pgsnake > > EnterpriseDB UK: http://www.enterprisedb.com > The Enterprise PostgreSQL Company > --000000000000d81cda0569047c15 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Wed, Apr 4, 2018 at 5:00 PM, Dave Page <dpage@pgadmin.org&g= t; = wrote:


On Wed, Apr 4, 2018 at 10:45 AM, Murtu= za Zabuawala <murtuza.zabuawala@enterprisedb.com= > wrote:
=
On Wed, Apr 4, 2018 at 2:47 PM, Dave Pa= ge <dpag= e@pgadmin.org> wrote:

On Wed, Apr 4, 2= 018 at 7:20 AM, Murtuza Zabuawala <murtuza.zabuawala@ente= rprisedb.com> wrote:
<= div dir=3D"ltr">
Hi Dave,

On Tue, Apr 3, 2018 at 9:03 PM, Dave P= age <dpage@pgadmin.org> wrote:
Hi

On T= ue, Apr 3, 2018 at 12:56 PM, Murtuza Zabuawala <murtuza.z= abuawala@enterprisedb.com> wrote:
Hi,

Thanks Joao for reviewing.
<= div style=3D"font-family:verdana,sans-serif;color:rgb(68,68,68)">
=
PFA updat= ed patch.

On Tue, Apr 3, 2018 at 1:11 AM, Joao D= e Almeida Pereira <jdealmeidapereira@pivotal.io> = wrote:
Hello,

On Mon, Apr 2, = 2018 at 10:07 AM Murtuza Zabuawala <murtuza.zabuawala@enterprisedb.com= > wrote:
=

=E2=80=8BHello,

Please= find updated patch,=C2=A0
<= font face=3D"verdana, sans-serif" color=3D"#444444">

Now layo= ut will be locked after user updates its preferences, w
=
e have used =E2=80=8B
templated variable in the java= script file
=E2=80=8B because we do= not have preference module or preference cache available when the page loa= ds and panels gets rendered,=C2=A0
=E2=80=8BI
=E2=80=8B also=C2=A0=
made changes in JS tests as per Joao's review comments.
Looks like everything is working when we change the lock.
A= s a personal preferences I would prefer to see this in at least 2 commits, = one that is related to the preference issue and another one that is related= to this story.


All the tests are w= orking, but he linter is failing:
/tmp/build/4a5630c2/pivotal-rm-3155/web /tmp/buil= d/4a5630c2
./p= gadmin/misc/__init__.py:78: [E303] too many blank lines (2)
= 1 E303 too many blank lines (2)=C2=A0
= 1=C2=A0
=E2=80=8BFixed=E2=80=8B
=C2=A0

=

@Dave/Pivotal team,
The given patch is working fine = for all the Tabs/Panels (all the panels from main window as well as from Qu= ery tool and Debugger) but I'm facing an issue while handling the Brows= er tree section, It is a wcDocer frame and not a wcDocker p= anel.=C2=A0Like wcDocker panel, wcDocker frame do not provide any API s= o that a developer can prevent drag-drop functionality on it.

<= div>It's not working fine for me. For example, if I put the SQL Panel o= n it's own below the properties/stats panels (so it looks like pgAdmin = 3 used to by default), and then lock the layout, I can un-dock the SQL pane= l into a dialogue, but then cannot re-dock it. I can do weird things with t= he browser tree as well, probably because it's a frame as you say.
=C2=A0
=E2=80=8BThat is expect= ed behaviour =E2=80=8Bbecause once you drag the panel out of the group of P= anels then it becomes individual Frame, That is what the author of the wcDo= cker replied on my question,=C2=A0
= "A panel must either be initialized as movable or non-movable from the= beginning and never changed because it generates a different arrangement o= f elements depending. This feature should only ever be used within the onCr= eate method of the panel. I should probably have been more clear about this= limitation in the documentation."

=

So does it become a panel again if a= second panel is added to the new tab group?
=E2=80=8BNo, it stays Frame.=E2=80=8B
=C2= =A0
As far as I understand Panel needs a Frame to render it= self if it is not attached to the main docker instance.=E2=80=8B

There must be some wa= y we can lock a tab that's not part of a group.
=
At a moment there is no way of =E2=80=8B
locking frames out of the box :(
=E2=80=8B

Hm= m, so the question becomes: do we include the lock feature, but rename it t= o "Lock Tabs" or something similar, or leave it out altogether? I= t clearly doesn't do everything we want right now.=C2=A0
=E2=80=8BI would s= ay lets include the feature by adding warning note that this feature works = with default layout only, And I don't think most user will try to drag = drop Browser panel =E2=80=8B
anyway, mea= nwhile I'll check what changes are required in main source code to make= the Frame lock.

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

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

--000000000000d81cda0569047c15--