[pgadmin4][patch] [GreenPlum] Partitioned table icon is the same as non partitioned tables

2018-04-24 Thread Joao De Almeida Pereira
Hi Hackers,
Attached you can find 2 patches that correct the Redmine: #3308
 A
Patches:
0001 - In this patch we update the SQL to retrieve the is_partitioned flag
from the database
0002 - Extract and refactor the icon css class retrieval. It was scattered
around the code and we moved it into it's own small class

We also realize that the class was present in some places in the javascript
world. What it is strange is that we only override the icon with the
partition one after a successful truncation or successful reset of
statistics.
Why was this behavior added? Can we remove that?


Thanks
Victoria & Joao
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/table/sql/gpdb_5.0_plus/nodes.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/table/sql/gpdb_5.0_plus/nodes.sql
index 3e877bfc..8c1e5878 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/table/sql/gpdb_5.0_plus/nodes.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/table/sql/gpdb_5.0_plus/nodes.sql
@@ -1,6 +1,7 @@
 SELECT rel.oid, rel.relname AS name,
 (SELECT count(*) FROM pg_trigger WHERE tgrelid=rel.oid) AS triggercount,
-(SELECT count(*) FROM pg_trigger WHERE tgrelid=rel.oid AND tgenabled = 'O') AS has_enable_triggers
+(SELECT count(*) FROM pg_trigger WHERE tgrelid=rel.oid AND tgenabled = 'O') AS has_enable_triggers,
+(CASE WHEN (SELECT count(*) from pg_partition where parrelid = rel.oid) > 0 THEN true ELSE false END) AS is_partitioned
 FROM pg_class rel
 WHERE rel.relkind IN ('r','s','t') AND rel.relnamespace = {{ scid }}::oid
   AND rel.relname NOT IN (SELECT partitiontablename FROM pg_partitions)
-- 
2.17.0

diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/__init__.py
index d49ca20e..a4c229a1 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/__init__.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/__init__.py
@@ -303,21 +303,17 @@ class TableView(BaseTableView, DataTypeReader, VacuumSettings):
 if len(rset['rows']) == 0:
 return gone(gettext("Could not find the table."))
 
-if 'is_partitioned' in rset['rows'][0] and \
-rset['rows'][0]['is_partitioned']:
-icon = "icon-partition"
-else:
-icon = "icon-table"
+table_information = rset['rows'][0]
+icon = self.get_icon_css_class(table_information)
 
 res = self.blueprint.generate_browser_node(
-rset['rows'][0]['oid'],
+table_information['oid'],
 scid,
-rset['rows'][0]['name'],
+table_information['name'],
 icon=icon,
-tigger_count=rset['rows'][0]['triggercount'],
-has_enable_triggers=rset['rows'][0]['has_enable_triggers'],
-is_partitioned=rset['rows'][0]['is_partitioned'] if
-'is_partitioned' in rset['rows'][0] else False
+tigger_count=table_information['triggercount'],
+has_enable_triggers=table_information['has_enable_triggers'],
+is_partitioned=self.is_table_partitioned(table_information)
 )
 
 return make_json_response(
@@ -350,10 +346,7 @@ class TableView(BaseTableView, DataTypeReader, VacuumSettings):
 return internal_server_error(errormsg=rset)
 
 for row in rset['rows']:
-if 'is_partitioned' in row and row['is_partitioned']:
-icon = "icon-partition"
-else:
-icon = "icon-table"
+icon = self.get_icon_css_class(row)
 
 res.append(
 self.blueprint.generate_browser_node(
@@ -363,8 +356,7 @@ class TableView(BaseTableView, DataTypeReader, VacuumSettings):
 icon=icon,
 tigger_count=row['triggercount'],
 has_enable_triggers=row['has_enable_triggers'],
-is_partitioned=row['is_partitioned'] if
-'is_partitioned' in row else False,
+is_partitioned=self.is_table_partitioned(row),
 rows_cnt=0
 ))
 
@@ -968,13 +960,11 @@ class TableView(BaseTableView, DataTypeReader, VacuumSettings):
 
 try:
 partitions_sql = ''
-partitioned = False
-if 'is_partitioned' in data and data['is_partitioned']:
+if self.is_table_partitioned(data):
 data['relkind'] = 'p'
 # create partition scheme
 data['partition_scheme'] = self.get_partition_scheme(data)
 partitions_sql = self.get_partitions_sql(data)
-partitioned = True
 
 SQL = render_template(
 

Re: [pgadmin4][patch] Initial patch to decouple from ACI Tree

2018-04-24 Thread Joao De Almeida Pereira
Hi Hackers,

Can someone review and merge this patch?

Thanks
Joao

On Wed, Apr 18, 2018 at 10:23 AM Joao De Almeida Pereira <
jdealmeidapere...@pivotal.io> wrote:

> Hi Hackers,
> Any other comment about this patch?
>
> Thanks
> Joao
>
> On Tue, Apr 10, 2018 at 12:00 PM Joao De Almeida Pereira <
> jdealmeidapere...@pivotal.io> wrote:
>
>> Hello Khushboo
>>
>> On Mon, Apr 9, 2018 at 1:59 AM Khushboo Vashi <
>> khushboo.va...@enterprisedb.com> wrote:
>>
>>> Hi Joao,
>>>
>>> I have reviewed your patch and have some suggestions.
>>>
>>> On Sat, Apr 7, 2018 at 12:43 AM, Joao De Almeida Pereira <
>>> jdealmeidapere...@pivotal.io> wrote:
>>>
 Hello Murtuza/Dave,
 Yes now the extracted functions are spread into different files. The
 intent would be to make the files as small as possible, and also to group
 and name them in a way that would be easy to understand what each file is
 doing without the need of opening it.
 As a example:
 static/js/backup will contain all the backup related functionality
 inside of this folder we can see the file:

>>> menu_utils.js At this moment in time we decided to group all the
 functions that are related to the menu, but we can split that also if we
 believe it is easier to see.

>>> It's really very good to see the separated code for backup module. As we
>>> have done for backup, we would like do it for other PG utilities like
>>> restore, maintenance etc.
>>> Considering this, we should separate the code in a way that some of the
>>> common functionalities can be used for other modules  like menu (as you
>>> have mentioned above), dialogue factory etc.
>>> Also, I think these functionalities should be in their respective static
>>> folder instead of pgadmin/static.
>>>
>>
>> About the location of the files. The move of the files to
>> pgadmin/static/js was made on purpose in order to clearly separate
>> Javascript from python code.
>> The rational behind it was
>> - Create a clear separation between the backend and frontend
>> - Having Javascript code concentrated in a single place, hopefully, will
>> encourage to developers to look for a functionality, that is already
>> implemented in another modules, because they are right there. (When we
>> started this journey we realized that the 'nodes' have a big groups of code
>> that could be shared, but because the Javascript is spread everywhere it is
>> much harder to look for it)
>>
>>
>> There are some drawbacks of this separation:
>> - When creating a new module we will need to put the javascript in a
>> separate location from the backend code
>>
>>
>>>
>>>
 static/js/datagrid folder contains all the datagrid related
 functionality

>>> Same as backup module,  this should be in it's respective static/js
>>> folder.
>>>
 Inside of the folder we can see the files:
 get_panel_title.js is responsible for retrieving the name of the panel
 show_data.js is responsible for showing the datagrid
 show_query_tool.js is responsible for showing the query tool

 Does this structure make sense?
 Can you give an example of a comment that you think is missing and that
 could help?

 As a personal note, unless the algorithm is very obscure or very
 complicated, I believe that if the code needs comments it is a signal that
 something needs to change in terms of naming, structure of the part in
 question. This being said, I am open to add some comments that might help
 people.

>>> You are right, with the help of naming convention and structure of the
>>> code, any one can get the idea about the code. But it is very useful to
>>> understand the code
>>> very easily with the proper comments especially when there are multiple
>>> developers working on a single project.
>>>
>>> I found some of the places where it would be great to have comments.
>>>
>>> - treeMenu: new tree.Tree()  in a browser.js
>>> - tree.js  (especially Tree class)
>>>
>> About the comment point I need a more clear understanding on what kind of
>> comments you are looking for. Because when you read the function names you
>> understand the intent, what they are doing. The parameters also explain
>> what you need to pass into them.
>>
>> If what you are looking for in these comments is the reasoning being the
>> change itself, then that should be present in the commit message. Specially
>> because this is going to be a very big patch with a very big number of
>> changes.
>>
>>>
>>> Thanks
 Joao
 ​

 Thanks,
>>> Khushboo
>>>

 On Fri, Apr 6, 2018 at 4:48 AM Murtuza Zabuawala <
 murtuza.zabuaw...@enterprisedb.com> wrote:

> Hi Joao,
>
> Patch looks good and working as expected.
>
> I also agree with Dave, Can we please add some comments in each file
> which can help us to understand the flow, I'm saying because now the code
> is segregated in so many separate files it will be hard to keep track of
> the 

Re: [pgAdmin4][Patch] Feature #1447 SSH Tunnel

2018-04-24 Thread Joao De Almeida Pereira
Hi Akshay,

After looking through the patch we found some one letter variable names and
this is a regression on what we have been trying to accomplish in the last
year.

An objective that we have for pgAdmin source code is to increase the
testability of it and make it more readable. If we keep on adding one
letter variables and if we continue adding code to already convoluted
source files it is going to be very hard to achieve this objective.

Our recommendations for this change are:
- Name the variables with comprehensive names
- Extract functions where we can and try to wrap some tests around them
(ex: the javascript disabled functions)
- We really need to find a better pattern than templated Javascript to pass
information from the backend to the frontend
- When changing a piece of code, if we see code that is confusing or that
is hard to read, we should refactor instead of adding to the pattern.

Thanks
Victoria & Joao


On Tue, Apr 24, 2018 at 10:13 AM Akshay Joshi 
wrote:

> Hi Hackers
>
> As per suggestion by Dave, I have moved "Advanced" tab at the last for
> Server dialog. Attached is the modified patch.
>
> On Mon, Apr 23, 2018 at 7:32 PM, Anthony Emengo 
> wrote:
>
>> For what it is worth, I manually verified that the feature worked, as
>> well as looked through the code.
>>
>> I'd like to see end-to-end testing for regression sake, but it's hard to
>> so at this moment.
>>
>> - Anthony and Joao.
>>
>> On Mon, Apr 23, 2018 at 5:09 AM, Akshay Joshi <
>> akshay.jo...@enterprisedb.com> wrote:
>>
>>>
>>>
>>> On Mon, Apr 23, 2018 at 1:30 PM, Dave Page  wrote:
>>>
 Hi

 On Thu, Apr 19, 2018 at 6:56 PM, Anthony Emengo 
 wrote:

> Hey Akshay
>
> This patch passed our test pipelines.
>

 Did you test the feature and//or review the code and tests? Passing the
 tests is great, *if* the whole feature is covered (and the nature of this
 patch will make that quite difficult, maybe impossible to do without
 external infrastructure and config).

>>>
>>> Agreed, it's been difficult to write test case to test the complete
>>> feature.
>>>


>
> Anthony and Victoria
>
> On Thu, Apr 19, 2018 at 1:48 AM, Akshay Joshi <
> akshay.jo...@enterprisedb.com> wrote:
>
>> Hi Hackers
>>
>> I have implemented the SSH Tunnel support using
>> https://pypi.org/project/sshtunnel/ python package. Added "SSH
>> Tunnel" Tab in server dialog. This implementation supports user name
>> /password and private/public key combination with Passphrase to crate SSH
>> Tunnel. I have added regression test case to add server using SSH Tunnel
>> options.
>>
>> The given python package(https://pypi.org/project/sshtunnel/) support
>> Python version *2.7, 3.4+*.
>> It uses Paramiko (Python implementation of SSHv2 protocol) which
>> actually drops support for Python 2.6. So I have added
>> *SUPPORT_SSH_TUNNEL* parameter in config.py which checks the python
>> version and set the flag accordingly. In case of Python 2.6, 3.0, 3.1, 
>> 3.2
>> and 3.3 control on the "SSH Tunnel" tab of server dialog will be 
>> disabled.
>>
>> Please review it, and if looks good please commit the code.
>>
>> --
>> *Akshay Joshi*
>>
>> *Sr. Software Architect *
>>
>>
>>
>> *Phone: +91 20-3058-9517 <+91%2020%203058%209517>Mobile: +91
>> 976-788-8246 <+91%2097678%2088246>*
>>
>
>


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

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

>>>
>>>
>>>
>>> --
>>> *Akshay Joshi*
>>>
>>> *Sr. Software Architect *
>>>
>>>
>>>
>>> *Phone: +91 20-3058-9517 <+91%2020%203058%209517>Mobile: +91
>>> 976-788-8246 <+91%2097678%2088246>*
>>>
>>
>>
>
>
> --
> *Akshay Joshi*
>
> *Sr. Software Architect *
>
>
>
> *Phone: +91 20-3058-9517 <+91%2020%203058%209517>Mobile: +91 976-788-8246
> <+91%2097678%2088246>*
>


Re: [pgAdmin4][Patch] Feature #1447 SSH Tunnel

2018-04-24 Thread Akshay Joshi
Hi Hackers

As per suggestion by Dave, I have moved "Advanced" tab at the last for
Server dialog. Attached is the modified patch.

On Mon, Apr 23, 2018 at 7:32 PM, Anthony Emengo  wrote:

> For what it is worth, I manually verified that the feature worked, as well
> as looked through the code.
>
> I'd like to see end-to-end testing for regression sake, but it's hard to
> so at this moment.
>
> - Anthony and Joao.
>
> On Mon, Apr 23, 2018 at 5:09 AM, Akshay Joshi <
> akshay.jo...@enterprisedb.com> wrote:
>
>>
>>
>> On Mon, Apr 23, 2018 at 1:30 PM, Dave Page  wrote:
>>
>>> Hi
>>>
>>> On Thu, Apr 19, 2018 at 6:56 PM, Anthony Emengo 
>>> wrote:
>>>
 Hey Akshay

 This patch passed our test pipelines.

>>>
>>> Did you test the feature and//or review the code and tests? Passing the
>>> tests is great, *if* the whole feature is covered (and the nature of this
>>> patch will make that quite difficult, maybe impossible to do without
>>> external infrastructure and config).
>>>
>>
>> Agreed, it's been difficult to write test case to test the complete
>> feature.
>>
>>>
>>>

 Anthony and Victoria

 On Thu, Apr 19, 2018 at 1:48 AM, Akshay Joshi <
 akshay.jo...@enterprisedb.com> wrote:

> Hi Hackers
>
> I have implemented the SSH Tunnel support using
> https://pypi.org/project/sshtunnel/ python package. Added "SSH
> Tunnel" Tab in server dialog. This implementation supports user name
> /password and private/public key combination with Passphrase to crate SSH
> Tunnel. I have added regression test case to add server using SSH Tunnel
> options.
>
> The given python package(https://pypi.org/project/sshtunnel/) support
> Python version *2.7, 3.4+*.
> It uses Paramiko (Python implementation of SSHv2 protocol) which
> actually drops support for Python 2.6. So I have added
> *SUPPORT_SSH_TUNNEL* parameter in config.py which checks the python
> version and set the flag accordingly. In case of Python 2.6, 3.0, 3.1, 3.2
> and 3.3 control on the "SSH Tunnel" tab of server dialog will be disabled.
>
> Please review it, and if looks good please commit the code.
>
> --
> *Akshay Joshi*
>
> *Sr. Software Architect *
>
>
>
> *Phone: +91 20-3058-9517Mobile: +91 976-788-8246*
>


>>>
>>>
>>> --
>>> Dave Page
>>> Blog: http://pgsnake.blogspot.com
>>> Twitter: @pgsnake
>>>
>>> EnterpriseDB UK: http://www.enterprisedb.com
>>> The Enterprise PostgreSQL Company
>>>
>>
>>
>>
>> --
>> *Akshay Joshi*
>>
>> *Sr. Software Architect *
>>
>>
>>
>> *Phone: +91 20-3058-9517Mobile: +91 976-788-8246*
>>
>
>


-- 
*Akshay Joshi*

*Sr. Software Architect *



*Phone: +91 20-3058-9517Mobile: +91 976-788-8246*


SSH_Tunnel_v2.patch
Description: Binary data


Re: [PATCH] [RM# 3290] Close button missing for the message window from the backend server

2018-04-24 Thread Akshay Joshi
Thanks patch applied

On Tue, Apr 24, 2018 at 2:29 PM, Akshay Joshi  wrote:

>
>
> On Tue, Apr 24, 2018 at 1:47 PM, Dave Page  wrote:
>
>> Akshay, can you review/commit this please?
>>
>
>Sure.
>
>>
>> Thanks.
>>
>> On Mon, Apr 23, 2018 at 3:34 PM, Anthony Emengo 
>> wrote:
>>
>>> Just manually verified that this worked, and the patch successfully went
>>> through our pipelines.
>>>
>>> Thanks so much for fixing this issue!
>>>
>>> - Joao and Anthony
>>>
>>> On Mon, Apr 23, 2018 at 3:40 AM, Ashesh Vashi <
>>> ashesh.va...@enterprisedb.com> wrote:
>>>
 Hi Team,

 Please find the patch for fixing the RM #3290.
 The 'Close button' was missing in the message box, which shows the
 error in the backend server.

 This patch also fixes some of the missing keycode 'ESCAPE' on 'Cancel'
 buttons in different modules.

 Please review.

 --

 Thanks & Regards,

 Ashesh Vashi
 EnterpriseDB INDIA: Enterprise PostgreSQL Company
 


 *http://www.linkedin.com/in/asheshvashi*
 

>>>
>>>
>>
>>
>> --
>> Dave Page
>> Blog: http://pgsnake.blogspot.com
>> Twitter: @pgsnake
>>
>> EnterpriseDB UK: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>>
>
>
>
> --
> *Akshay Joshi*
>
> *Sr. Software Architect *
>
>
>
> *Phone: +91 20-3058-9517Mobile: +91 976-788-8246*
>



-- 
*Akshay Joshi*

*Sr. Software Architect *



*Phone: +91 20-3058-9517Mobile: +91 976-788-8246*


Re: [pgadmin4][patch] [GreenPlum] Display SQL of table with index #3306

2018-04-24 Thread Akshay Joshi
On Tue, Apr 24, 2018 at 1:19 PM, Dave Page  wrote:

> Akshay, can you review/commit this please? (and update the release notes)
>

   Sure.

>
> On Mon, Apr 23, 2018 at 2:49 PM, Joao De Almeida Pereira <
> jdealmeidapere...@pivotal.io> wrote:
>
>> Hi Hackers,
>> Attached you can find the patch that corrects the rm - 3306.
>> Also adds some tests around the behavior of the wrapping function of the
>> table controller.
>>
>> Thanks
>> Anthony & Joao
>>
>
>
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>



-- 
*Akshay Joshi*

*Sr. Software Architect *



*Phone: +91 20-3058-9517Mobile: +91 976-788-8246*


Re: [PATCH] [RM# 3290] Close button missing for the message window from the backend server

2018-04-24 Thread Akshay Joshi
On Tue, Apr 24, 2018 at 1:47 PM, Dave Page  wrote:

> Akshay, can you review/commit this please?
>

   Sure.

>
> Thanks.
>
> On Mon, Apr 23, 2018 at 3:34 PM, Anthony Emengo 
> wrote:
>
>> Just manually verified that this worked, and the patch successfully went
>> through our pipelines.
>>
>> Thanks so much for fixing this issue!
>>
>> - Joao and Anthony
>>
>> On Mon, Apr 23, 2018 at 3:40 AM, Ashesh Vashi <
>> ashesh.va...@enterprisedb.com> wrote:
>>
>>> Hi Team,
>>>
>>> Please find the patch for fixing the RM #3290.
>>> The 'Close button' was missing in the message box, which shows the error
>>> in the backend server.
>>>
>>> This patch also fixes some of the missing keycode 'ESCAPE' on 'Cancel'
>>> buttons in different modules.
>>>
>>> Please review.
>>>
>>> --
>>>
>>> Thanks & Regards,
>>>
>>> Ashesh Vashi
>>> EnterpriseDB INDIA: Enterprise PostgreSQL Company
>>> 
>>>
>>>
>>> *http://www.linkedin.com/in/asheshvashi*
>>> 
>>>
>>
>>
>
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>



-- 
*Akshay Joshi*

*Sr. Software Architect *



*Phone: +91 20-3058-9517Mobile: +91 976-788-8246*


Re: [pgadmin4][patch] [GreenPlum] Display SQL of table with index #3306

2018-04-24 Thread Dave Page
Akshay, can you review/commit this please? (and update the release notes)

On Mon, Apr 23, 2018 at 2:49 PM, Joao De Almeida Pereira <
jdealmeidapere...@pivotal.io> wrote:

> Hi Hackers,
> Attached you can find the patch that corrects the rm - 3306.
> Also adds some tests around the behavior of the wrapping function of the
> table controller.
>
> Thanks
> Anthony & Joao
>



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

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


Re: [pgAdmin4][RM#3155] Allow user to lock the Layout

2018-04-24 Thread Dave Page
Akshay, could you review/commit this please?

Please also update the release_notes_3_1.rst file when you commit
user-visible changes, to make it easier to build the release notes.

Thanks.

On Tue, Apr 24, 2018 at 8:45 AM, Murtuza Zabuawala <
murtuza.zabuaw...@enterprisedb.com> wrote:

> Hi Dave,
>
> Please find the updated patch, Now we are able to lock wcFrame and wcPanel
> both.
>
> --
> Regards,
> Murtuza Zabuawala
> EnterpriseDB: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
>
> On Thu, Apr 5, 2018 at 6:32 PM, Robert Eckhardt 
> wrote:
>
>>
>>
>> On Wed, Apr 4, 2018 at 11:31 PM, Khushboo Vashi <
>> khushboo.va...@enterprisedb.com> wrote:
>>
>>>
>>>
>>> On Wed, Apr 4, 2018 at 8:09 PM, Dave Page  wrote:
>>>


 On Wed, Apr 4, 2018 at 12:54 PM, Murtuza Zabuawala <
 murtuza.zabuaw...@enterprisedb.com> wrote:

> On Wed, Apr 4, 2018 at 5:00 PM, Dave Page  wrote:
>
>>
>>
>> On Wed, Apr 4, 2018 at 10:45 AM, Murtuza Zabuawala <
>> murtuza.zabuaw...@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.zabuaw...@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.zabuaw...@enterprisedb.com> wrote:
>>
>>> Hi,
>>>
>>> Thanks Joao for reviewing.
>>>
>>> PFA updated patch.
>>>
>>> On Tue, Apr 3, 2018 at 1:11 AM, Joao De Almeida Pereira <
>>> jdealmeidapere...@pivotal.io> wrote:
>>>
 Hello,

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

>
> ​Hello,
>
> Please find updated patch,
>
> Now layout will be locked after user updates its preferences, w
> e have used ​
> templated variable in the javascript file
> ​ because we do not have preference module or preference cache
> available when the page loads and panels gets rendered,
> ​I
> ​ 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
 one 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

>>> ​Fixed​
>>>
>>>


> @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) but
> I'm facing an issue while handling the Browser tree section, It 
> is a wcDocer
> frame 
> and not a wcDocker panel
> . Like
> wcDocker panel, wcDocker frame do not provide any API so that a 
> developer
> 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 the
>> browser tree as well, probably because it's a frame as you say.
>>
>
> ​That is expected behaviour ​because