[pgAdmin4][RM#3129] handle encoding issue in File manager

2018-03-01 Thread Murtuza Zabuawala
Hi,

PFA patch to fix the issue where user was not able to open the file with
non utf-8 encoding.


--
Regards,
Murtuza Zabuawala
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
diff --git a/web/pgadmin/tools/sqleditor/__init__.py 
b/web/pgadmin/tools/sqleditor/__init__.py
index 8c17c97..0f3c909 100644
--- a/web/pgadmin/tools/sqleditor/__init__.py
+++ b/web/pgadmin/tools/sqleditor/__init__.py
@@ -38,6 +38,8 @@ from pgadmin.utils.exception import ConnectionLost
 from pgadmin.utils.sqlautocomplete.autocomplete import SQLAutoComplete
 from pgadmin.tools.sqleditor.utils.query_tool_preferences import \
 RegisterQueryToolPreferences
+from pgadmin.tools.sqleditor.utils.query_tool_fs_utils import \
+read_file_generator
 
 MODULE_NAME = 'sqleditor'
 
@@ -1360,16 +1362,7 @@ def load_file():
 errormsg=gettext("File type not supported")
 )
 
-def gen():
-with codecs.open(file_path, 'r', encoding=enc) as fileObj:
-while True:
-# 4MB chunk (4 * 1024 * 1024 Bytes)
-data = fileObj.read(4194304)
-if not data:
-break
-yield data
-
-return Response(gen(), mimetype='text/plain')
+return Response(read_file_generator(file_path, enc), mimetype='text/plain')
 
 
 @blueprint.route('/save_file/', methods=["PUT", "POST"], endpoint='save_file')
diff --git a/web/pgadmin/tools/sqleditor/utils/query_tool_fs_utils.py 
b/web/pgadmin/tools/sqleditor/utils/query_tool_fs_utils.py
new file mode 100644
index 000..7ed96e0
--- /dev/null
+++ b/web/pgadmin/tools/sqleditor/utils/query_tool_fs_utils.py
@@ -0,0 +1,53 @@
+##
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2018, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+##
+
+import codecs
+
+def read_file_generator(file, enc):
+"""
+This will read the content of the file selected by user
+
+Returns:
+Content of file
+"""
+try:
+with codecs.open(file, 'r', encoding=enc) as fileObj:
+while True:
+# 4MB chunk (4 * 1024 * 1024 Bytes)
+data = fileObj.read(4194304)
+if not data:
+break
+yield data
+except UnicodeDecodeError:
+# This is the closest equivalent Python 3 offers to the permissive
+# Python 2 text handling model. The latin-1 encoding in Python
+# implements ISO_8859-1:1987 which maps all possible byte values
+# to the first 256 Unicode code points, and thus ensures decoding
+# errors will never occur regardless of the configured error and
+# handles most of the Windows encodings
+# handler.
+# Ref: https://goo.gl/vDhggS
+with codecs.open(file, 'r', encoding='latin-1') as fileObj:
+while True:
+# 4MB chunk (4 * 1024 * 1024 Bytes)
+data = fileObj.read(4194304)
+if not data:
+break
+yield data
+except Exception:
+# As a last resort we will use the provided encoding and then
+# ignore the decoding errors
+with codecs.open(file, 'r', encoding=enc, errors='ignore') as fileObj:
+while True:
+# 4MB chunk (4 * 1024 * 1024 Bytes)
+data = fileObj.read(4194304)
+if not data:
+break
+yield data
+
diff --git 
a/web/pgadmin/tools/sqleditor/utils/tests/test_file_other_encoding.sql 
b/web/pgadmin/tools/sqleditor/utils/tests/test_file_other_encoding.sql
new file mode 100644
index 000..6e3bf3f
--- /dev/null
+++ b/web/pgadmin/tools/sqleditor/utils/tests/test_file_other_encoding.sql
@@ -0,0 +1,2 @@
+/*Copyright � 2017/*
+SELECT 1;
\ No newline at end of file
diff --git 
a/web/pgadmin/tools/sqleditor/utils/tests/test_file_utf8_encoding.sql 
b/web/pgadmin/tools/sqleditor/utils/tests/test_file_utf8_encoding.sql
new file mode 100644
index 000..7358741
--- /dev/null
+++ b/web/pgadmin/tools/sqleditor/utils/tests/test_file_utf8_encoding.sql
@@ -0,0 +1,2 @@
+/*Copyright © 2017/*
+SELECT 1;
\ No newline at end of file
diff --git 
a/web/pgadmin/tools/sqleditor/utils/tests/test_query_tool_fs_utils.py 
b/web/pgadmin/tools/sqleditor/utils/tests/test_query_tool_fs_utils.py
new file mode 100644
index 000..d4e8dc4
--- /dev/null
+++ b/web/pgadmin/tools/sqleditor/utils/tests/test_query_tool_fs_utils.py
@@ -0,0 +1,39 @@
+##
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2018, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+##
+imp

Re: [pgAdmin4][RM#3073] Allow user to schedule without End date from UI

2018-03-01 Thread Dave Page
On Wed, Feb 28, 2018 at 3:10 PM, Joao De Almeida Pereira <
jdealmeidapere...@pivotal.io> wrote:

> Hello Murtuza,
> I do not have the pgAgent installed so it was a little it hard to test
> this.
>

FWIW, you don't need to install pgAgent to test this - you can just load
the SQL file I sent into your maintenance database, and that should enable
all the pgAgent features in pgAdmin. Obviously jobs won't get run, but
you'll be able to create them and edit them.


> After looking into the code I think we are missing some testing coverage
> around the pga_job Javascript part so that we can catch these problems.
> Even some code extraction can be done around the pg_jobset change
>

+1


>
> Nevertheless I passed the patch through our CI and it is all green
>
> Thanks
> Joao
>
> On Wed, Feb 28, 2018 at 5:36 AM Murtuza Zabuawala  enterprisedb.com> wrote:
>
>> Hi Dave,
>>
>> I have found the issue, it was in Backform control itself :)
>> Issue: We were passing today's date value as minDate option in pgAgent
>> schedule schema while rendering the control, So when server was sending
>> previous datetime value it was not displaying it causing sync problem.
>>
>> --
>> Regards,
>> Murtuza Zabuawala
>> EnterpriseDB: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>>
>>
>> On Tue, Feb 27, 2018 at 8:39 PM, Murtuza Zabuawala > enterprisedb.com> wrote:
>>
>>> ​Thanks Dave, I'll look into it.
>>> ​
>>>
>>>
>>> On Tue, Feb 27, 2018 at 8:37 PM, Dave Page  wrote:
>>>
 Hi

 On Tue, Feb 27, 2018 at 12:03 PM, Murtuza Zabuawala >>> enterprisedb.com> wrote:

> I'm not able to re-produce the issue, Could you hard refresh and try
> again?
>

 I still see it.


>
> If possible could you please provide exact steps?
>

 Attached is a dump of my test pgagent schema.

 1) Load the schema dump into the maintenance database
 2) Connect pgAdmin
 3) Browse to pgAgent Jobs
 4) Right-click Properties, and select the Schedules tab
 5) Open the subnode for sched1


>
> --
> Regards,
> Murtuza Zabuawala
> EnterpriseDB: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
>
> On Tue, Feb 27, 2018 at 5:30 PM, Dave Page  wrote:
>
>> Sorry - here it is.
>>
>> On Tue, Feb 27, 2018 at 11:59 AM, Murtuza Zabuawala <
>> murtuza.zabuaw...@enterprisedb.com> wrote:
>>
>>> Hi Dave,
>>>
>>> Could you please send screenshot?
>>>
>>> --
>>> Regards,
>>> Murtuza Zabuawala
>>> EnterpriseDB: http://www.enterprisedb.com
>>> The Enterprise PostgreSQL Company
>>>
>>>
>>> On Tue, Feb 27, 2018 at 5:24 PM, Dave Page 
>>> wrote:
>>>
 Hi

 Still not quite right - see the attached screenshot which is the
 result of simply viewing the properties of an existing job. Note that 
 the
 start time is shown in the grid but not the subnode control.

 Thanks.

 On Tue, Feb 27, 2018 at 8:26 AM, Murtuza Zabuawala <
 murtuza.zabuaw...@enterprisedb.com> wrote:

> Hi Dave,
>
> As validation related patch was committed with RM#3148 [ Sorry
> about that I forgot to checkout :) ]
> PFA patch to fix the issues you mentioned, I have also removed
> extra error message from sub node collection control and made it 
> optional
> via flag.
>
>
>
> --
> Regards,
> Murtuza Zabuawala
> EnterpriseDB: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
>
> On Mon, Feb 26, 2018 at 10:14 PM, Dave Page 
> wrote:
>
>> Hi
>>
>> On Mon, Feb 26, 2018 at 2:46 PM, Murtuza Zabuawala <
>> murtuza.zabuaw...@enterprisedb.com> wrote:
>>
>>> Hi,
>>>
>>> PFA patch to fix the issue where user was not able to create
>>> pgAgent job from UI without entering End date in schedule section.
>>>
>>
>>  Whilst this does resolve the validation issue, there are still a
>> couple of other related problems, as can be seen in the attached
>> screenshots:
>>
>> - The Start date/time in the subnode control doesn't seem to be
>> properly synchronised with the value in the grid.
>>
>> - If you leave the End date/time blank (but maybe click into it
>> first), the grid will show "Invalid date".
>>
>> It's possible there are other oddities as well - please check
>> carefully for anything else.
>>
>> Thanks.
>>
>> --
>> Dave Page
>> Blog: http://pgsnake.blogspot.com
>> Twitter: @pgsnake
>>
>> EnterpriseDB UK: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company

[pgAdmin4][Patch]: PEP-8 fixes in the foreign data wrapper module

2018-03-01 Thread Khushboo Vashi
Hi,

Please find the attached patch to fix the PEP-8 issues in the foreign data
wrapper module.

Thanks,
Khushboo
diff --git a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/__init__.py
index d5a4cc2..401034a 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/__init__.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/__init__.py
@@ -33,19 +33,21 @@ class ForeignDataWrapperModule(CollectionNodeModule):
 """
 class ForeignDataWrapperModule(CollectionNodeModule)
 
-A module class for foreign data wrapper node derived from CollectionNodeModule.
+A module class for foreign data wrapper node derived
+from CollectionNodeModule.
 
 Methods:
 ---
 * __init__(*args, **kwargs)
-  - Method is used to initialize the Foreign data wrapper module and it's base module.
+  - Method is used to initialize the Foreign data wrapper
+module and it's base module.
 
 * get_nodes(gid, sid, did)
   - Method is used to generate the browser collection node.
 
 * script_load()
-  - Load the module script for foreign data wrapper, when any of the database node is
-initialized.
+  - Load the module script for foreign data wrapper,
+when any of the database node is initialized.
 """
 
 NODE_TYPE = 'foreign_data_wrapper'
@@ -53,7 +55,8 @@ class ForeignDataWrapperModule(CollectionNodeModule):
 
 def __init__(self, *args, **kwargs):
 """
-Method is used to initialize the Foreign data wrapper module and it's base module.
+Method is used to initialize the Foreign data wrapper module
+and it's base module.
 
 Args:
 *args:
@@ -80,7 +83,8 @@ class ForeignDataWrapperModule(CollectionNodeModule):
 @property
 def script_load(self):
 """
-Load the module script for foreign data wrapper, when any of the database node is initialized.
+Load the module script for foreign data wrapper,
+when any of the database node is initialized.
 
 Returns: node type of the databse module.
 """
@@ -89,8 +93,8 @@ class ForeignDataWrapperModule(CollectionNodeModule):
 @property
 def module_use_template_javascript(self):
 """
-Returns whether Jinja2 template is used for generating the javascript
-module.
+Returns whether Jinja2 template is used for
+generating the javascript module.
 """
 return False
 
@@ -102,14 +106,16 @@ class ForeignDataWrapperView(PGChildNodeView):
 """
 class ForeignDataWrapperView(PGChildNodeView)
 
-A view class for foreign data wrapper node derived from PGChildNodeView. This class is
-responsible for all the stuff related to view like updating foreign data wrapper
+A view class for foreign data wrapper node derived
+from PGChildNodeView. This class is responsible for all the
+stuff related to view like updating foreign data wrapper
 node, showing properties, showing sql in sql pane.
 
 Methods:
 ---
 * __init__(**kwargs)
-  - Method is used to initialize the ForeignDataWrapperView and it's base view.
+  - Method is used to initialize the ForeignDataWrapperView
+and it's base view.
 
 * check_precondition()
   - This function will behave as a decorator which will checks
@@ -117,14 +123,16 @@ class ForeignDataWrapperView(PGChildNodeView):
 manager,conn & template_path properties to self
 
 * list(gid, sid, did)
-  - This function is used to list all the foreign data wrapper nodes within that collection.
+  - This function is used to list all the foreign data wrapper nodes
+within that collection.
 
 * nodes(gid, sid, did)
-  - This function will used to create all the child node within that collection.
-Here it will create all the foreign data wrapper node.
+  - This function will used to create all the child node within that
+collection. Here it will create all the foreign data wrapper node.
 
 * properties(gid, sid, did, fid)
-  - This function will show the properties of the selected foreign data wrapper node
+  - This function will show the properties of the selected
+foreign data wrapper node
 
 * create(gid, sid, did)
   - This function will create the new foreign data wrapper node
@@ -133,28 +141,35 @@ class ForeignDataWrapperView(PGChildNodeView):
   - This function will delete the selected foreign data wrapper node
 
 * update(gid, sid, did, fid)
-  - This function will update the data for the selected foreign data wrapper node
+  - This function will update the data for the selected
+foreign data wrapper node
 
 * msql(gid, sid, did, fid)
-  - This function is used to r

Re: [pgAdmin4][Patch]: RM #3135 - [Web based] Syntax error displayed when user try to insert data on table where primray key is in captial letters and table contains OIDS

2018-03-01 Thread Joao De Almeida Pereira
Hello Kushboo,

Can we add some Unit test to ensure this does not happen again?

Thanks
Joao

On Thu, Mar 1, 2018 at 2:28 AM Khushboo Vashi <
khushboo.va...@enterprisedb.com> wrote:

> Hi,
>
> Please find the attached patch to fix RM # 3135 - [Web based] Syntax error
> displayed when user try to insert data on table where primray key is in
> captial letters and table contains OIDS
>
> Thanks,
> Khushboo
>


Re: [pgAdmin4][Patch]: PEP-8 fixes in the foreign data wrapper module

2018-03-01 Thread Joao De Almeida Pereira
Hello Khushboo,
I applied this patch and here is the result:

 2018-03-01 09:41:00 ⌚ |ruby-2.4.1| pgadmin-dev in ~/workspace/pgadmin4/web
± |pep-8-fdw {2} U:13 ✗| → git st
On branch pep-8-fdw
Changes not staged for commit:
  (use "git add ..." to update what will be committed)
  (use "git checkout -- ..." to discard changes in working directory)

modified:
 
pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/__init__.py
modified:
 
pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/__init__.py
modified:
 
pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/tests/test_foreign_servers_add.py
modified:
 
pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/tests/test_foreign_servers_delete.py
modified:
 
pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/tests/test_foreign_servers_get.py
modified:
 
pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/tests/test_foreign_servers_put.py
modified:
 
pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/tests/utils.py
modified:
 
pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mapping/__init__.py
modified:
 
pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mapping/tests/test_user_mapping_add.py
modified:
 
pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mapping/tests/test_user_mapping_delete.py
modified:
 
pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mapping/tests/test_user_mapping_get.py
modified:
 
pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mapping/tests/test_user_mapping_put.py
modified:
 
pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mapping/tests/utils.py

no changes added to commit (use "git add" and/or "git commit -a")

 2018-03-01 09:41:03 ⌚ |ruby-2.4.1| pgadmin-dev in ~/workspace/pgadmin4/web
± |pep-8-fdw {2} U:13 ✗| → pycodestyle --config=.pycodestyle
pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/
pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/__init__.py:644:
[E123] closing bracket does not match indentation of opening bracket's line
pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/__init__.py:651:
[E123] closing bracket does not match indentation of opening bracket's line
pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/__init__.py:593:
[E123] closing bracket does not match indentation of opening bracket's line
pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/__init__.py:662:
[E123] closing bracket does not match indentation of opening bracket's line
pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/__init__.py:669:
[E123] closing bracket does not match indentation of opening bracket's line
pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mapping/__init__.py:622:
[E123] closing bracket does not match indentation of opening bracket's line
pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mapping/__init__.py:685:
[E123] closing bracket does not match indentation of opening bracket's line
pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mapping/__init__.py:692:
[E123] closing bracket does not match indentation of opening bracket's line
pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mapping/tests/test_user_mapping_add.py:72:
[E126] continuation line over-indented for hanging indent
pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mapping/tests/test_user_mapping_add.py:84:
[E121] continuation line under-indented for hanging indent
pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mapping/tests/test_user_mapping_get.py:74:
[E126] continuation line over-indented for hanging indent
pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/tests/test_foreign_servers_put.py:69:
[E126] continuation line over-indented for hanging indent
pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/tests/test_foreign_servers_put.py:71:
[E121] continuation line under-indented for hanging indent
pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/tests/test_fdw_delete.py:25:
[E126] continuation line over-indented for hanging indent
pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/tests/test_fdw_delete.py:28:
[E121] continuation line under-indented for hanging indent
pgadmin/br

Re: pgAdmin 4 commit: Ensure we pick up the messages from the current query

2018-03-01 Thread Joao De Almeida Pereira
Hello Khushboo,
The patch runs successfully in our CI with all tests passing.

I see the test that you created, and I do not understand why we need to
create tests that do HTTP requests in order to check something that is
executed against the database. What I was talking about in my previous
email was having tests that tested the function by itself.


(Copied from: https://jfiaffe.files.wordpress.com/2014/09/tests-pyramid.png)

This is the Testing Pyramid, there are a bunch of different drawings of it
and ways to explain it, but in broad stokes what is means is that we should
have the majority of tests around a Unit (that are some disagreements in
the community of what a Unit is) and a very small amount of Manual testing.
What Unit usually means is piece of code, it can be a function, it can be a
class or it can even be a module, but is something self contained. In
pgAdmin's case the majority of our tests go around the Integration Layer
because we are using HTTP requests in order to executing queries in the
database, so basically we are doing tests end to end in the backend, and
the cost time.

I do not want to held this patch back because of this, and I say this
because I have minimal confidence with the tests that you created, that
they would catch the majority of the problems, and hope that the majority
of the code is exercised by it.

Nevertheless I would like to challenge all the Hackers to think about
testing in a different way. The tests in our code are used to give us
confidence that the work we did is working as expected, this also makes it
much easier to refactor out bad patterns or very complicated ones into
something simple. A signal that our code is more complicated then it should
is when we need to test some behavior and we end up with a Stubbing Hell or
we need to test it End 2 End because it is to hard to isolate the part we
want to test. In the other hand we should not test all functions and every
class, because we might be coupling our tests to much to the implementation
and that will have the contrary effect, and we will not be able to refactor
and simply our code.
Like everything in life there need to be a balance.

Thanks
Joao

On Thu, Mar 1, 2018 at 12:56 AM Khushboo Vashi <
khushboo.va...@enterprisedb.com> wrote:

> Hi Joao,
>
> Thanks for reviewing.
>
> On Wed, Feb 28, 2018 at 8:55 PM, Joao De Almeida Pereira <
> jdealmeidapere...@pivotal.io> wrote:
>
>> Hello Khushboo,
>> After reviewing the patch I have the gut feeling that we do not have
>> enough test coverage on this issue, specially due to the intricate while
>> loop and conditions around the polling.
>> I think that this deserve Unit tests around it, When I say Unit Test I am
>> not talking about executing queries against the database, but do some
>> stubbing of the database so that we can control the flow that we want.
>>
> You are right. It needs more unit testing. I have checked below scenarios:
> 1. Returns 2 notices with data output
> 2. Returns 1000 notices with data output
> 3. No notices with data output
>
> By running above, I have checked, each time returned notices are accurate,
> no old notices are getting appended, it does not affect with the amount of
> messages (few, none or more).  Also, with the updated patch, I have made
> sure that all these queries run with the single transaction id (same
> connection).
>
> So, please let me know if you think I can add more things to this.
>
>>
>>
> It is a temptation to try to always do a Feature Test to test what we want
>> because it is "easier" to write and ultimately it is what users see, but
>> while 1 Feature Test runs we can run 200 Unit Tests that give us much more
>> confidence that the code is doing what we expect it to do.
>>
>> Right, so added regression tests instead of feature tests.
>
> This being said, I run the tests on the CI Pipeline and all tests pass.
>> Running pycodestyle fails due to some line sizes on the
>> psycopg2/__init__py. I believe that it is not what you changed, but since
>> you were changing the file it can be fixed it is just:
>>
>> pgadmin/utils/driver/psycopg2/__init__.py:1276: [E501] line too long (81
>> > 79 characters)
>> pgadmin/utils/driver/psycopg2/__init__.py:1277: [E501] line too long (91
>> > 79 characters)
>> pgadmin/utils/driver/psycopg2/__init__.py:1282: [E501] line too long (81
>> > 79 characters)
>> pgadmin/utils/driver/psycopg2/__init__.py:1283: [E501] line too long (91
>> > 79 characters)
>> 4   E501 line too long (81 > 79 characters)
>>
>> Fixed. Thanks for pointing out.
>
>>
>> Thanks
>> Joao
>>
>>
>> On Wed, Feb 28, 2018 at 6:49 AM Khushboo Vashi <
>> khushboo.va...@enterprisedb.com> wrote:
>>
>>> On Mon, Feb 26, 2018 at 10:02 PM, Dave Page  wrote:
>>>
 Argh, I ran some tests, but didn't spot any lost messages in the tests
 I ran. I'll revert the patch.

 Khushboo;

 Please look at the following:

 - Fix the patch so it doesn't drop messages.

>>> Fixed.
>>> By default, the no

Re: [pgAdmin4][RM#3129] handle encoding issue in File manager

2018-03-01 Thread Joao De Almeida Pereira
Hello Murtuza,

The code looks pretty good, love the fact that you extracted it so that our
file size stop growing and get more manageable. All tests pass on our CI.

The only issue I found was linting:

pycodestyle --config=.pycodestyle pgadmin/tools/sqleditor/
pgadmin/tools/sqleditor/utils/query_tool_fs_utils.py:12: [E302] expected 2
blank lines, found 1
pgadmin/tools/sqleditor/utils/query_tool_fs_utils.py:53: [W391] blank line
at end of file
pgadmin/tools/sqleditor/utils/tests/test_query_tool_fs_utils.py:27: [E121]
continuation line under-indented for hanging indent
pgadmin/tools/sqleditor/utils/tests/test_query_tool_fs_utils.py:29: [E122]
continuation line missing indentation or outdented
1   E121 continuation line under-indented for hanging indent
1   E122 continuation line missing indentation or outdented
1   E302 expected 2 blank lines, found 1
1   W391 blank line at end of file
4

When this is fixed I think we are good to go

Thanks
Joao

On Thu, Mar 1, 2018 at 3:01 AM Murtuza Zabuawala <
murtuza.zabuaw...@enterprisedb.com> wrote:

> Hi,
>
> PFA patch to fix the issue where user was not able to open the file with
> non utf-8 encoding.
>
>
> --
> Regards,
> Murtuza Zabuawala
> EnterpriseDB: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
>


Bug #3083 fix

2018-03-01 Thread Neethu Mariya Joy
Hi,
I am Neethu Mariya Joy, an undergraduate pursuing BE in Computer Science at
BITS Pilani.

I've attempted to fix https://redmine.postgresql.org/issues/3083. Since the
textarea resize feature is the default HTML feature, I have not changed it.
Instead, I've added draggable borders to the wrapper which expands the
textarea inside it.

I'm attaching my patch as bug3083.diff below as per the contribution
guidelines.

Hope this helps. Thank you for your consideration!

Sincerely,
Neethu Mariya Joy
GitHub  | Linkedin

diff --git a/web/pgadmin/static/js/slickgrid/editors.js 
b/web/pgadmin/static/js/slickgrid/editors.js
index 7652bf3..d369928 100644
--- a/web/pgadmin/static/js/slickgrid/editors.js
+++ b/web/pgadmin/static/js/slickgrid/editors.js
@@ -123,6 +123,53 @@
 return position;
   }
 
+  function resizeContentOnDrag($wrapper, $input){
+// right border, bottom border and right bottom corner of the wrapper are 
draggable
+$wrapper.append('\
+  \
+  ');
+
+$wrapper.find('.drag-border').on('drag', (event)=>{
+  event.preventDefault();
+  var mouseX = event.clientX;
+  var mouseY = event.clientY;
+
+  // mouseX == 0 && mouseY == 0 mouse up / end of drag
+  if(mouseX == 0 && mouseY == 0)return;
+  
+  // default spacing between $input and cursor
+  var paddingBottom = 30;
+  var paddingRight = 10;
+  var dir = event.target.getAttribute('data');
+  
+  // size of $input is changed according to cursor position
+  switch(dir){
+  case 'right':
+changeWidth($input, mouseX, paddingRight);
+break;
+  case 'bottom':
+changeHeight($input, mouseY, paddingBottom);
+break;
+  case 'both':
+changeHeight($input, mouseY, paddingBottom);
+changeWidth($input, mouseX, paddingRight);
+  }  
+});
+  }
+
+  function changeWidth($input, mouseX, padding){
+var rect = $input[0].getBoundingClientRect();
+var newWidth = rect.width + mouseX - rect.right - padding;
+$input.css('width', newWidth.toString() + 'px');
+  }
+
+  function changeHeight($input, mouseY, padding){
+var rect = $input[0].getBoundingClientRect();
+var newHeight = rect.height + mouseY - rect.bottom - padding;
+$input.css('height', newHeight.toString() + 'px');
+  }
+
+
   // Text data type editor
   function pgTextEditor(args) {
 var $input, $wrapper, $buttons;
@@ -140,6 +187,7 @@
   $buttons.find('button:last').on('click', this.cancel);
   $input.bind('keydown', this.handleKeyDown);
 
+  resizeContentOnDrag($wrapper, $input);
   scope.position(args.position);
   $input.focus().select();
 };
@@ -297,6 +345,7 @@
   $buttons.find('button:last').on('click', this.cancel);
   $input.bind('keydown', this.handleKeyDown);
 
+  resizeContentOnDrag($wrapper, $input);
   scope.position(args.position);
   $input.focus().select();
 };
@@ -419,6 +468,7 @@
   $buttons.find('button:first').on('click', this.cancel);
   $input.bind('keydown', this.handleKeyDown);
 
+  resizeContentOnDrag($wrapper, $input);
   scope.position(args.position);
   $input.focus().select();
 };
@@ -518,6 +568,7 @@
   $buttons.find('button:first').on('click', this.cancel);
   $input.bind('keydown', this.handleKeyDown);
 
+  resizeContentOnDrag($wrapper, $input);
   scope.position(args.position);
   $input.focus().select();
 };
diff --git a/web/pgadmin/tools/sqleditor/static/css/sqleditor.css 
b/web/pgadmin/tools/sqleditor/static/css/sqleditor.css
index 1e29c3f..288e57f 100644
--- a/web/pgadmin/tools/sqleditor/static/css/sqleditor.css
+++ b/web/pgadmin/tools/sqleditor/static/css/sqleditor.css
@@ -505,6 +505,38 @@ input.editor-checkbox:focus {
   -moz-border-radius:10px;
   border-radius:10px;
 }
+
+.drag-border{
+  background: transparent;
+  position: absolute;
+}
+
+.drag-border[data=right]{
+  cursor: ew-resize;  
+  top: 0;
+  right: -10px;
+  bottom: 0;
+  width: 20px;
+}
+
+.drag-border[data=bottom]{
+  cursor: ns-resize;
+  position: absolute;
+  left: 0;
+  right: 0;
+  bottom: -10px;
+  height: 20px; 
+}
+
+.drag-border[data=both]{
+  cursor: move;
+  position: absolute;
+  bottom: -10px;
+  right: -10px;
+  width: 20px;
+  height: 20px;
+}
+
 .pg_textarea {
   backround:#fff;
   width:250px;


Dark theme for pg admin 4

2018-03-01 Thread Daniel VanDenBosch
Hello,
I and my team are in and out of PG Admin a lot.
The white background can be straining on our eyes.
Wondering if there is a dark theme in the works???

Thanks,


Dan


Bug #2309 fix

2018-03-01 Thread Neethu Mariya Joy
Hi,
I am Neethu Mariya Joy, an undergraduate pursuing BE in Computer Science at
BITS Pilani.

I've attempted to fix https://redmine.postgresql.org/issues/2309.
Codemirrors catches all the keyboard and mouse events when 'readOnly'
option is set to 'noCursor' and does not allow copying.
So, I've set 'readOnly' option to true. In order to hide the cursor, I've
added a class 'hide-cursor-workaround' and applied css styles to hide the
cursor.

I'm attaching my patch as bug2309.diff below as per the contribution
guidelines.

Hope this helps. Thank you for your consideration!

Sincerely,
Neethu Mariya Joy
GitHub  | Linkedin

diff --git a/web/pgadmin/tools/sqleditor/static/css/sqleditor.css 
b/web/pgadmin/tools/sqleditor/static/css/sqleditor.css
index 1e29c3f..69381e5 100644
--- a/web/pgadmin/tools/sqleditor/static/css/sqleditor.css
+++ b/web/pgadmin/tools/sqleditor/static/css/sqleditor.css
@@ -601,4 +601,9 @@ input.editor-checkbox:focus {
 .ajs-body .warn-footer {
   font-size: 13px;
   line-height: 3em;
+}
+
+/* workaround for codemirrors 'readOnly' option which is set to true instead 
of 'noCursor' */
+.hide-cursor-workaround .CodeMirror-cursors{
+  display: none;
 }
\ No newline at end of file
diff --git a/web/pgadmin/tools/sqleditor/static/js/sqleditor.js 
b/web/pgadmin/tools/sqleditor/static/js/sqleditor.js
index 349c9a0..91dbe3a 100644
--- a/web/pgadmin/tools/sqleditor/static/js/sqleditor.js
+++ b/web/pgadmin/tools/sqleditor/static/js/sqleditor.js
@@ -2016,12 +2016,12 @@ define('tools.querytool', [
   }
 }
 else {
-  // Disable codemirror by setting cursor to nocursor and background 
to dark.
+  // Disable codemirror by setting readOnly option to true, background 
to dark, and cursor, hidden.
   self.init_events();
-  self.gridView.query_tool_obj.setOption('readOnly', 'nocursor');
+  self.gridView.query_tool_obj.setOption('readOnly', true);
   var cm = self.gridView.query_tool_obj.getWrapperElement();
   if (cm) {
-cm.className += ' bg-gray-1 opacity-5';
+cm.className += ' bg-gray-1 opacity-5 hide-cursor-workaround';
   }
   self.disable_tool_buttons(true);
   self.execute_data_query();


Re: [pgAdmin4][RM#3129] handle encoding issue in File manager

2018-03-01 Thread Murtuza Zabuawala
Thanks Joao for reviewing.

Attaching updated patch fixing PEP8 issues.

--
Regards,
Murtuza Zabuawala
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


On Thu, Mar 1, 2018 at 8:56 PM, Joao De Almeida Pereira <
jdealmeidapere...@pivotal.io> wrote:

> Hello Murtuza,
>
> The code looks pretty good, love the fact that you extracted it so that
> our file size stop growing and get more manageable. All tests pass on our
> CI.
>
> The only issue I found was linting:
>
> pycodestyle --config=.pycodestyle pgadmin/tools/sqleditor/
> pgadmin/tools/sqleditor/utils/query_tool_fs_utils.py:12: [E302] expected
> 2 blank lines, found 1
> pgadmin/tools/sqleditor/utils/query_tool_fs_utils.py:53: [W391] blank
> line at end of file
> pgadmin/tools/sqleditor/utils/tests/test_query_tool_fs_utils.py:27:
> [E121] continuation line under-indented for hanging indent
> pgadmin/tools/sqleditor/utils/tests/test_query_tool_fs_utils.py:29:
> [E122] continuation line missing indentation or outdented
> 1   E121 continuation line under-indented for hanging indent
> 1   E122 continuation line missing indentation or outdented
> 1   E302 expected 2 blank lines, found 1
> 1   W391 blank line at end of file
> 4
>
> When this is fixed I think we are good to go
>
> Thanks
> Joao
>
> On Thu, Mar 1, 2018 at 3:01 AM Murtuza Zabuawala  enterprisedb.com> wrote:
>
>> Hi,
>>
>> PFA patch to fix the issue where user was not able to open the file with
>> non utf-8 encoding.
>>
>>
>> --
>> Regards,
>> Murtuza Zabuawala
>> EnterpriseDB: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>>
>>
diff --git a/web/pgadmin/tools/sqleditor/__init__.py 
b/web/pgadmin/tools/sqleditor/__init__.py
index 8c17c97..0f3c909 100644
--- a/web/pgadmin/tools/sqleditor/__init__.py
+++ b/web/pgadmin/tools/sqleditor/__init__.py
@@ -38,6 +38,8 @@ from pgadmin.utils.exception import ConnectionLost
 from pgadmin.utils.sqlautocomplete.autocomplete import SQLAutoComplete
 from pgadmin.tools.sqleditor.utils.query_tool_preferences import \
 RegisterQueryToolPreferences
+from pgadmin.tools.sqleditor.utils.query_tool_fs_utils import \
+read_file_generator
 
 MODULE_NAME = 'sqleditor'
 
@@ -1360,16 +1362,7 @@ def load_file():
 errormsg=gettext("File type not supported")
 )
 
-def gen():
-with codecs.open(file_path, 'r', encoding=enc) as fileObj:
-while True:
-# 4MB chunk (4 * 1024 * 1024 Bytes)
-data = fileObj.read(4194304)
-if not data:
-break
-yield data
-
-return Response(gen(), mimetype='text/plain')
+return Response(read_file_generator(file_path, enc), mimetype='text/plain')
 
 
 @blueprint.route('/save_file/', methods=["PUT", "POST"], endpoint='save_file')
diff --git a/web/pgadmin/tools/sqleditor/utils/query_tool_fs_utils.py 
b/web/pgadmin/tools/sqleditor/utils/query_tool_fs_utils.py
new file mode 100644
index 000..ad1df0f
--- /dev/null
+++ b/web/pgadmin/tools/sqleditor/utils/query_tool_fs_utils.py
@@ -0,0 +1,53 @@
+##
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2013 - 2018, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+##
+
+import codecs
+
+
+def read_file_generator(file, enc):
+"""
+This will read the content of the file selected by user
+
+Returns:
+Content of file
+"""
+try:
+with codecs.open(file, 'r', encoding=enc) as fileObj:
+while True:
+# 4MB chunk (4 * 1024 * 1024 Bytes)
+data = fileObj.read(4194304)
+if not data:
+break
+yield data
+except UnicodeDecodeError:
+# This is the closest equivalent Python 3 offers to the permissive
+# Python 2 text handling model. The latin-1 encoding in Python
+# implements ISO_8859-1:1987 which maps all possible byte values
+# to the first 256 Unicode code points, and thus ensures decoding
+# errors will never occur regardless of the configured error and
+# handles most of the Windows encodings
+# handler.
+# Ref: https://goo.gl/vDhggS
+with codecs.open(file, 'r', encoding='latin-1') as fileObj:
+while True:
+# 4MB chunk (4 * 1024 * 1024 Bytes)
+data = fileObj.read(4194304)
+if not data:
+break
+yield data
+except Exception:
+# As a last resort we will use the provided encoding and then
+# ignore the decoding errors
+with codecs.open(file, 'r', encoding=enc, errors='ignore') as fileObj:
+while True:
+# 4MB chunk (4 * 1024 * 1024 Bytes)
+data = fileObj.read(4194304)
+

Re: Dark theme for pg admin 4

2018-03-01 Thread Murtuza Zabuawala
I'm afraid, pgAdmin4 theme is not customisable at a moment, So there is no
theme support.

--
Regards,
Murtuza Zabuawala
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


On Wed, Feb 28, 2018 at 2:48 AM, Daniel VanDenBosch <
dvandenbo...@stoneplasticsmfg.com> wrote:

> Hello,
>
> I and my team are in and out of PG Admin a lot.
>
> The white background can be straining on our eyes.
>
> Wondering if there is a dark theme in the works???
>
>
>
> Thanks,
>
>
>
>
>
> Dan
>


Re: Feature #3061

2018-03-01 Thread Neethu Mariya Joy
Hi,

Thanks for the reply. I had a look at the commit and tried out the first
part.

I have a few doubts.
a. Now that we are adding options for each individual graph, should we
remove the previous show graphs option or keep it as an override when it is
false?
b. Do widgets include tables or just the graphs?

Sincerely,
Neethu

On Thu, Mar 1, 2018 at 10:39 AM, Murtuza Zabuawala <
murtuza.zabuaw...@enterprisedb.com> wrote:

> Hello,
>
> First of all I'm assuming that you have some degree of knowledge about
> Python, HTML, JS & Git.
>
> We have had added similar feature recently.
> Check: https://redmine.postgresql.org/issues/2951 for more details.
> Code location of Dashboard module in git repository:
> ../pgadmin4/web/pgadmin/dashboard
>
> There are 3 requirments in the ticket,
> 1) disable/enable some widgets (widget - Server Sessions | Transactions
> per second | Tuples in etc)
> We have done this for all the graphs in one shot, now user can
> enable/disable all the graphs via preferences dialog.
> You can refer the commit
> 
> as a reference if you want to add this functionality for each
> individual graphs.
>
> 2) add custom/user specify widgets
> - First of all, You need to provide an option to Create new dashboard
> dialog, Update existing dashboard dialog option and also to delete those
> existing custom dashboards on dashboard page.
> - You have to create a separate table in sqlite3 database to store the
> data for that user defined dashboards like Dashboard name, SQL etc.
> - You also have to provide option to use to choose what type of graph user
> wants (Line chart, Pie chart, Table etc)
> - Size & location of the graph/table.
>
> 3) add user role with access only to dashboard
> This needs further discussion with community members if we really need
> this or not.
>
> You can refer README for more information regarding how to run pgAdmin4.
>
> Let us know if you need any help.
>
>
> --
> Regards,
> Murtuza Zabuawala
> EnterpriseDB: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
>
> On Wed, Feb 28, 2018 at 6:29 PM, Neethu Mariya Joy <
> neethumariya...@gmail.com> wrote:
>
>> Hi,
>>
>> I am Neethu Mariya Joy, an undergraduate sophomore pursuing BE(Hons) in
>> Computer Engineering from BITS Pilani, India.
>>
>> I would like to work on the feature #3061, "Dashboard Customisation".
>> Kindly provide suggestions for the same.
>>
>> Sincerely,
>> Neethu Mariya Joy
>> GitHub  | Linkedin
>> 
>>
>
>


Re: Bug #2309 fix

2018-03-01 Thread Joao De Almeida Pereira
Hello Neethu,

We run the patch though our test pipeline and all tests are green.
Everything looks good with this patch

Thanks
Joao
On Thu, Mar 1, 2018 at 10:37 AM Neethu Mariya Joy 
wrote:

> Hi,
> I am Neethu Mariya Joy, an undergraduate pursuing BE in Computer Science
> at BITS Pilani.
>
> I've attempted to fix https://redmine.postgresql.org/issues/2309.
> Codemirrors catches all the keyboard and mouse events when 'readOnly'
> option is set to 'noCursor' and does not allow copying.
> So, I've set 'readOnly' option to true. In order to hide the cursor, I've
> added a class 'hide-cursor-workaround' and applied css styles to hide the
> cursor.
>
> I'm attaching my patch as bug2309.diff below as per the contribution
> guidelines.
>
> Hope this helps. Thank you for your consideration!
>
> Sincerely,
> Neethu Mariya Joy
> GitHub  | Linkedin
> 
>
>
>


Re: [pgAdmin4][RM#3129] handle encoding issue in File manager

2018-03-01 Thread Joao De Almeida Pereira
Hello Joao,
The pipeline is green and I believe the change is good to be merged.

Thanks
Joao

On Thu, Mar 1, 2018 at 10:56 AM Murtuza Zabuawala <
murtuza.zabuaw...@enterprisedb.com> wrote:

> Thanks Joao for reviewing.
>
> Attaching updated patch fixing PEP8 issues.
>
> --
> Regards,
> Murtuza Zabuawala
> EnterpriseDB: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
>
> On Thu, Mar 1, 2018 at 8:56 PM, Joao De Almeida Pereira <
> jdealmeidapere...@pivotal.io> wrote:
>
>> Hello Murtuza,
>>
>> The code looks pretty good, love the fact that you extracted it so that
>> our file size stop growing and get more manageable. All tests pass on our
>> CI.
>>
>> The only issue I found was linting:
>>
>> pycodestyle --config=.pycodestyle pgadmin/tools/sqleditor/
>> pgadmin/tools/sqleditor/utils/query_tool_fs_utils.py:12: [E302] expected
>> 2 blank lines, found 1
>> pgadmin/tools/sqleditor/utils/query_tool_fs_utils.py:53: [W391] blank
>> line at end of file
>> pgadmin/tools/sqleditor/utils/tests/test_query_tool_fs_utils.py:27:
>> [E121] continuation line under-indented for hanging indent
>> pgadmin/tools/sqleditor/utils/tests/test_query_tool_fs_utils.py:29:
>> [E122] continuation line missing indentation or outdented
>> 1   E121 continuation line under-indented for hanging indent
>> 1   E122 continuation line missing indentation or outdented
>> 1   E302 expected 2 blank lines, found 1
>> 1   W391 blank line at end of file
>> 4
>>
>> When this is fixed I think we are good to go
>>
>> Thanks
>> Joao
>>
>> On Thu, Mar 1, 2018 at 3:01 AM Murtuza Zabuawala <
>> murtuza.zabuaw...@enterprisedb.com> wrote:
>>
>>> Hi,
>>>
>>> PFA patch to fix the issue where user was not able to open the file with
>>> non utf-8 encoding.
>>>
>>>
>>> --
>>> Regards,
>>> Murtuza Zabuawala
>>> EnterpriseDB: http://www.enterprisedb.com
>>> The Enterprise PostgreSQL Company
>>>
>>>
>


Re: Bug #3083 fix

2018-03-01 Thread Joao De Almeida Pereira
Hello Neethu,
We passed the patch through our CI pipeline and all tests pass.
The code looks good, but we are trying to decouple files as much  as we can
so that we do not end up with files with over 1000 lines, that are hard to
read and to maintain. Also we are trying to create Unit Tests to have more
coverage in our Javascript code.

Can you split the new implementation code into it's own file and create
some tests to ensure the behavior will not be broken in the future?iYou
have some examples
on: pgadmin/browser/server_groups/servers/databases/external_tables/*

Thanks
Joao

On Thu, Mar 1, 2018 at 10:37 AM Neethu Mariya Joy 
wrote:

> Hi,
> I am Neethu Mariya Joy, an undergraduate pursuing BE in Computer Science
> at BITS Pilani.
>
> I've attempted to fix https://redmine.postgresql.org/issues/3083. Since
> the textarea resize feature is the default HTML feature, I have not changed
> it. Instead, I've added draggable borders to the wrapper which expands the
> textarea inside it.
>
> I'm attaching my patch as bug3083.diff below as per the contribution
> guidelines.
>
> Hope this helps. Thank you for your consideration!
>
> Sincerely,
> Neethu Mariya Joy
> GitHub  | Linkedin
> 
>
>
>


Re: Feature #3061

2018-03-01 Thread Murtuza Zabuawala
Hello,

On Fri, Mar 2, 2018 at 3:33 AM, Neethu Mariya Joy  wrote:

> Hi,
>
> Thanks for the reply. I had a look at the commit and tried out the first
> part.
>
> I have a few doubts.
> a. Now that we are adding options for each individual graph, should we
> remove the previous show graphs option or keep it as an override when it is
> false?
>

​I think we should keep that what if user wants to disable all the graphs
on dashboards including the user defined custom graphs​, User has go and
disable each every graphs, if we provide a single option to turn off all
the graphs then it will be more user friendly.

b. Do widgets include tables or just the graphs?
>

​Yes, It may include Table as you can see in "Server Activity" section but
in custom table we will only display it in terms of plain HTML table and we
won't use Backgrid.​


>
> Sincerely,
> Neethu
>
> On Thu, Mar 1, 2018 at 10:39 AM, Murtuza Zabuawala  enterprisedb.com> wrote:
>
>> Hello,
>>
>> First of all I'm assuming that you have some degree of knowledge about
>> Python, HTML, JS & Git.
>>
>> We have had added similar feature recently.
>> Check: https://redmine.postgresql.org/issues/2951 for more details.
>> Code location of Dashboard module in git repository:
>> ../pgadmin4/web/pgadmin/dashboard
>>
>> There are 3 requirments in the ticket,
>> 1) disable/enable some widgets (widget - Server Sessions | Transactions
>> per second | Tuples in etc)
>> We have done this for all the graphs in one shot, now user can
>> enable/disable all the graphs via preferences dialog.
>> You can refer the commit
>> 
>> as a reference if you want to add this functionality for each
>> individual graphs.
>>
>> 2) add custom/user specify widgets
>> - First of all, You need to provide an option to Create new dashboard
>> dialog, Update existing dashboard dialog option and also to delete those
>> existing custom dashboards on dashboard page.
>> - You have to create a separate table in sqlite3 database to store the
>> data for that user defined dashboards like Dashboard name, SQL etc.
>> - You also have to provide option to use to choose what type of graph
>> user wants (Line chart, Pie chart, Table etc)
>> - Size & location of the graph/table.
>>
>> 3) add user role with access only to dashboard
>> This needs further discussion with community members if we really need
>> this or not.
>>
>> You can refer README for more information regarding how to run pgAdmin4.
>>
>> Let us know if you need any help.
>>
>>
>> --
>> Regards,
>> Murtuza Zabuawala
>> EnterpriseDB: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>>
>>
>> On Wed, Feb 28, 2018 at 6:29 PM, Neethu Mariya Joy <
>> neethumariya...@gmail.com> wrote:
>>
>>> Hi,
>>>
>>> I am Neethu Mariya Joy, an undergraduate sophomore pursuing BE(Hons) in
>>> Computer Engineering from BITS Pilani, India.
>>>
>>> I would like to work on the feature #3061, "Dashboard Customisation".
>>> Kindly provide suggestions for the same.
>>>
>>> Sincerely,
>>> Neethu Mariya Joy
>>> GitHub  | Linkedin
>>> 
>>>
>>
>>
>


Re: [pgAdmin4][Patch]: PEP-8 fixes in the foreign data wrapper module

2018-03-01 Thread Khushboo Vashi
Hi Joao,

On Thu, Mar 1, 2018 at 8:13 PM, Joao De Almeida Pereira <
jdealmeidapere...@pivotal.io> wrote:

> Hello Khushboo,
> I applied this patch and here is the result:
>
>  2018-03-01 09:41:00 ⌚ |ruby-2.4.1| pgadmin-dev in ~/workspace/pgadmin4/web
> ± |pep-8-fdw {2} U:13 ✗| → git st
> On branch pep-8-fdw
> Changes not staged for commit:
>   (use "git add ..." to update what will be committed)
>   (use "git checkout -- ..." to discard changes in working directory)
>
> modified:   pgadmin/browser/server_groups/servers/databases/
> foreign_data_wrappers/__init__.py
> modified:   pgadmin/browser/server_groups/servers/databases/
> foreign_data_wrappers/foreign_servers/__init__.py
> modified:   pgadmin/browser/server_groups/servers/databases/
> foreign_data_wrappers/foreign_servers/tests/test_foreign_servers_add.py
> modified:   pgadmin/browser/server_groups/servers/databases/
> foreign_data_wrappers/foreign_servers/tests/test_foreign_servers_delete.py
> modified:   pgadmin/browser/server_groups/servers/databases/
> foreign_data_wrappers/foreign_servers/tests/test_foreign_servers_get.py
> modified:   pgadmin/browser/server_groups/servers/databases/
> foreign_data_wrappers/foreign_servers/tests/test_foreign_servers_put.py
> modified:   pgadmin/browser/server_groups/servers/databases/
> foreign_data_wrappers/foreign_servers/tests/utils.py
> modified:   pgadmin/browser/server_groups/servers/databases/
> foreign_data_wrappers/foreign_servers/user_mapping/__init__.py
> modified:   pgadmin/browser/server_groups/servers/databases/
> foreign_data_wrappers/foreign_servers/user_mapping/tests/
> test_user_mapping_add.py
> modified:   pgadmin/browser/server_groups/servers/databases/
> foreign_data_wrappers/foreign_servers/user_mapping/tests/
> test_user_mapping_delete.py
> modified:   pgadmin/browser/server_groups/servers/databases/
> foreign_data_wrappers/foreign_servers/user_mapping/tests/
> test_user_mapping_get.py
> modified:   pgadmin/browser/server_groups/servers/databases/
> foreign_data_wrappers/foreign_servers/user_mapping/tests/
> test_user_mapping_put.py
> modified:   pgadmin/browser/server_groups/servers/databases/
> foreign_data_wrappers/foreign_servers/user_mapping/tests/utils.py
>
> no changes added to commit (use "git add" and/or "git commit -a")
>
>  2018-03-01 09:41:03 ⌚ |ruby-2.4.1| pgadmin-dev in ~/workspace/pgadmin4/web
> ± |pep-8-fdw {2} U:13 ✗| → pycodestyle --config=.pycodestyle
> pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/
> pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/__init__.py:644:
> [E123] closing bracket does not match indentation of opening bracket's line
> pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/__init__.py:651:
> [E123] closing bracket does not match indentation of opening bracket's line
> pgadmin/browser/server_groups/servers/databases/foreign_
> data_wrappers/foreign_servers/__init__.py:593: [E123] closing bracket
> does not match indentation of opening bracket's line
> pgadmin/browser/server_groups/servers/databases/foreign_
> data_wrappers/foreign_servers/__init__.py:662: [E123] closing bracket
> does not match indentation of opening bracket's line
> pgadmin/browser/server_groups/servers/databases/foreign_
> data_wrappers/foreign_servers/__init__.py:669: [E123] closing bracket
> does not match indentation of opening bracket's line
> pgadmin/browser/server_groups/servers/databases/foreign_
> data_wrappers/foreign_servers/user_mapping/__init__.py:622: [E123]
> closing bracket does not match indentation of opening bracket's line
> pgadmin/browser/server_groups/servers/databases/foreign_
> data_wrappers/foreign_servers/user_mapping/__init__.py:685: [E123]
> closing bracket does not match indentation of opening bracket's line
> pgadmin/browser/server_groups/servers/databases/foreign_
> data_wrappers/foreign_servers/user_mapping/__init__.py:692: [E123]
> closing bracket does not match indentation of opening bracket's line
> pgadmin/browser/server_groups/servers/databases/foreign_
> data_wrappers/foreign_servers/user_mapping/tests/test_user_mapping_add.py:72:
> [E126] continuation line over-indented for hanging indent
> pgadmin/browser/server_groups/servers/databases/foreign_
> data_wrappers/foreign_servers/user_mapping/tests/test_user_mapping_add.py:84:
> [E121] continuation line under-indented for hanging indent
> pgadmin/browser/server_groups/servers/databases/foreign_
> data_wrappers/foreign_servers/user_mapping/tests/test_user_mapping_get.py:74:
> [E126] continuation line over-indented for hanging indent
> pgadmin/browser/server_groups/servers/databases/foreign_
> data_wrappers/foreign_servers/tests/test_foreign_servers_put.py:69:
> [E126] continuation line over-indented for hanging indent
> pgadmin/browser/server_groups/servers/databases/foreign_
> data_wrappers/foreign_servers/tests/test_foreign_servers_put.py:71:
> [E121] continuation line under-indented for hanging indent
> pgadmin/browser/server_grou