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

2018-02-27 Thread Murtuza Zabuawala
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  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
>
diff --git 
a/web/pgadmin/browser/server_groups/servers/pgagent/schedules/static/js/pga_schedule.js
 
b/web/pgadmin/browser/server_groups/servers/pgagent/schedules/static/js/pga_schedule.js
index a88f9d0..1cfa38c 100644
--- 
a/web/pgadmin/browser/server_groups/servers/pgagent/schedules/static/js/pga_schedule.js
+++ 
b/web/pgadmin/browser/server_groups/servers/pgagent/schedules/static/js/pga_schedule.js
@@ -279,7 +279,7 @@ define('pgadmin.node.pga_schedule', [
   control: 'datetimepicker', cell: DatetimeCell,
   disabled: function() { return false; }, displayInUTC: false,
   displayFormat: '-MM-DD HH:mm:ss Z', options: {
-format: '-MM-DD HH:mm:ss Z', useCurrent: false,
+format: '-MM-DD HH:mm:ss Z',
 minDate: moment().add(0, 'm'),
   }, cellHeaderClasses: 'width_percent_25',
   modelFormat: '-MM-DD HH:mm:ss Z',
@@ -458,6 +458,9 @@ define('pgadmin.node.pga_schedule', [
   if (_.isUndefined(val) || _.isNull(val) ||
 String(val).replace(/^\s+|\s+$/g, '') == '') {
 msg = gettext('Please enter the start time.');
+if (val == '') {
+  this.set('jscstart', undefined);
+}
 this.errorModel.set('jscstart', msg);
 errMsg = errMsg || msg;
   } else {
@@ -471,6 +474,9 @@ define('pgadmin.node.pga_schedule', [
 // the user
 if (_.isUndefined(val) || _.isNull(val) ||
   String(val).replace(/^\s+|\s+$/g, '') == '') {
+  if (val == '') {
+this.set('jscend', undefined);
+  }
   return;
 }
 
diff --git 
a/web/pgadmin/browser/server_groups/servers/pgagent/static/js/pga_job.js 
b/web/pgadmin/browser/server_groups/servers/pgagent/static/js/pga_job.js
index 1a1cfb1..72fd1be 100644
--- a/web/pgadmin/browser/server_groups/servers/pgagent/static/js/pga_job.js
+++ b/web/pgadmin/browser/server_groups/servers/pgagent/static/js/pga_job.js
@@ -133,6 +133,7 @@ define('pgadmin.node.pga_job', [
   type: 'collection', mode: ['edit', 'create'],
   model: pgBrowser.Nodes['pga_jobstep'].model, canEdit: true,
   control: 'sub-node-collection', canAdd: true, canDelete: true,
+  showError: false,
   columns: [
 'jstname', 'jstenabled', 'jstkind', 'jstconntype', 'jstonerror',
   ],
@@ -141,6 +142,7 @@ define('pgadmin.node.pga_job', [
   type: 'collection', mode: ['edit', 'create'],
   control: 'sub-node-collection', canAdd: true, canDelete: true,
   canEdit: true, model: pgBrowser.Nodes['pga_schedule'].model,
+  showError: false,
   columns: ['jscname', 'jscenabled', 'jscstart', 'jscend'],
 }],
 validate: function() {
diff --git 
a/web/pgadmin/browser/server_groups/servers/pgagent/steps/static/js/pga_jobstep.js
 
b/web/pgadmin/browser/server_groups/servers/pgagent/steps/static/js/pga_jobstep.js
index 0dd3f60..971c2d6 100644
--- 
a/web/pgadmin/browser/server_groups/servers/pgagent/steps/static/js/pga_jobstep.js
+++ 
b/web/pgadmin/browser/server_groups/servers/pgagent/steps/static/js/pga_jobstep.js
@@ -300,6 +300,17 @@ define('pgadmin.node.pga_jobstep', [
 this.errorModel.unset('jstcode');
   }
 
+  val = this.get('jstonerror');
+  if (
+!_.isUndefined(val) && !_.isNull(val) &&
+  String(val).replace(/^\s+|\s+$/g, '') == ''
+  ) {
+msg = gettext('Please select valid on error option .');
+this.errorModel.set('jstonerror', msg);
+  } else {
+this.errorModel.uns

pgAdmin 4 commit: Case sensitive paths are confusing git...

2018-02-27 Thread Dave Page
Case sensitive paths are confusing git...

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=7dbfd23797bf46bc27eb4d8a5a20ecc4165b9d57

Modified Files
--
.gitignore | 1 +
1 file changed, 1 insertion(+)



Re: [pgadmin4][patch] Solves the bug #3150

2018-02-27 Thread Dave Page
Thanks, applied.

On Mon, Feb 26, 2018 at 8:36 PM, Joao De Almeida Pereira <
jdealmeidapere...@pivotal.io> wrote:

> Hi hackers,
> Attached you can find the correct for the bug #3150. The functions SQL tab
> stopped working after #3060, this patch changes the SQL to ensure that the
> tab is working again.
>
> Thanks
> Joao
>



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

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


pgAdmin 4 commit: Fix function reserve SQL for GPDB. Fixes #3150

2018-02-27 Thread Dave Page
Fix function reserve SQL for GPDB. Fixes #3150

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=3be22383b81b05b8f5fb62173809e85faaac638b
Author: Joao Pedro De Almeida Pereira 

Modified Files
--
.../templates/function/gpdb/sql/default/get_definition.sql  | 6 --
1 file changed, 4 insertions(+), 2 deletions(-)



pgAdmin 4 commit: Support tab navigation in dialogs. Fixes #2898

2018-02-27 Thread Dave Page
Support tab navigation in dialogs. Fixes #2898

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=aa1849c13af7f7188c4ed0936eb22796b56a3998
Author: Harshal Dhumal 

Modified Files
--
docs/en_US/keyboard_shortcuts.rst  |  75 ++-
web/pgadmin/browser/__init__.py|  30 +
web/pgadmin/browser/static/js/keyboard.js  |  93 --
web/pgadmin/browser/static/js/node.js  |  15 ++-
web/pgadmin/browser/static/js/wizard.js|  12 +-
web/pgadmin/static/js/backform.pgadmin.js  |   4 +-
web/pgadmin/static/js/dialog_tab_navigator.js  | 143 +
web/pgadmin/static/js/utils.js |  38 ++
web/pgadmin/tools/backup/static/js/backup.js   |  15 ++-
.../tools/grant_wizard/static/js/grant_wizard.js   |   6 +-
.../tools/import_export/static/js/import_export.js |  11 +-
.../tools/maintenance/static/js/maintenance.js |   8 +-
web/pgadmin/tools/restore/static/js/restore.js |  11 +-
.../javascript/dialog_tab_navigator_spec.js| 115 +
web/webpack.shim.js|   1 +
15 files changed, 485 insertions(+), 92 deletions(-)



Re: RM2898 Keyboard navigation in dialog tabs (nav tabs)

2018-02-27 Thread Dave Page
Cool - that works. Patch applied.

Thanks!

On Tue, Feb 27, 2018 at 6:30 AM, Harshal Dhumal <
harshal.dhu...@enterprisedb.com> wrote:

> Hi,
>
> On Tue, Feb 27, 2018 at 1:08 AM, Dave Page  wrote:
>
>> Hi,
>>
>> I'm still able to make it get stuck, if I tab back and forth quickly.
>>
> Quickly switching tabs was causing to switch to next tab before previous
> navigation was completed and
> this was leading to lose focus on tab pane.
> Now I have made changes that it won't process any user navigation events
> until current navigation is completed.
>
>
>> On Mon, Feb 26, 2018 at 6:04 PM, Harshal Dhumal <
>> harshal.dhu...@enterprisedb.com> wrote:
>>
>>> Hi,
>>>
>>> Please find the updated patch.
>>>
>>> On Mon, Feb 26, 2018 at 8:03 PM, Dave Page  wrote:
>>>
 Hi

 On Mon, Feb 26, 2018 at 12:03 PM, Harshal Dhumal <
 harshal.dhu...@enterprisedb.com> wrote:

> Hi,
>
> Please find the updated patch for keyboard navigation.
>
> In this patch I have reduced delay which is required until current tab
> navigation is completed.
> Extracted class dialogTabNavigator and put it in new file.
> Added jasmine test cases.
> Fixed linting issues, variable naming convention issues.
>

 This is still getting stuck on the Connection tab when I test on the
 server dialog.

>>> The disabled input field (Host name/address) on connection tab was
>>> causing issue.
>>>
>>>

 BTW, I've updated the documentation a little - please find the attached
 version.

>>> Thanks for this. I have included revised version of documentation in
>>> current patch.
>>>
>>>

 Thanks.



>
>
>
> --
> *Harshal Dhumal*
> *Sr. Software Engineer*
>
> EnterpriseDB India: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
> On Wed, Feb 21, 2018 at 11:39 PM, Harshal Dhumal <
> harshaldhuma...@gmail.com> wrote:
>
>> Hi,
>>
>> On Wed, Feb 21, 2018 at 10:59 PM, Joao De Almeida Pereira <
>> jdealmeidapere...@pivotal.io> wrote:
>>
>>> Yep I installed the V2 file
>>>
>>> On Wed, Feb 21, 2018 at 11:31 AM Dave Page 
>>> wrote:
>>>
 On Wed, Feb 21, 2018 at 4:22 PM, Joao De Almeida Pereira <
 jdealmeidapere...@pivotal.io> wrote:

> Hello Harshal,
>
> I passed the patch through our CI and all the tests passed. The
> changes do not break previous behavior but because there are no tests 
> on
> the new feature  we could not be sure it was really working. So we 
> did some
> manual testing and sometimes it doesn't work, like it gets stuck in a 
> place
> and you need to press the shortcut again in order for it to move.
>

 It stuck because I have to wait until next tab is completely
>> visible (fade in effect is completed).
>> The fade in or fade out transition duration is 150 ms (set by
>> bootstrap). So I can not set focus back to tab pane
>> until fade in or fade out transition is completed. May be one
>> improvement I can do is to reduce wait time to
>> something 200 ms (currently it's 500 ms).
>>
>> Note that the original issue reported by Dave is already fixed in
>> updated patch.
>>
>>
>>> Was that with the updated patch? It sounds like the issue I saw with
 the original one.


>
> Codewise I have some suggestions:
>  - dialogTabNavigator looks a nice candidate for a class with its
> own file. This way we can test the behavior
>
 Ok I'll move dialogTabNavigator to new file and will add test cases.
>>
>>>  - There is no difference between a variable called e and a
> variable error so for sake of clarity I would love to see
> variable names that we can easily read
>  - We are also using 2 different types of variable naming
> camelCase and snake_case, if we could use only camelCase on 
> Javascript it
> would make the code more uniform
>
 Ok I'll do this.
>>
>>
>>>  - I noticed that there are some linting issues in the Javascript
> code
>
 I just found that linter was disabled for this file by adding
>> comment  /* eslint-disable */ at first line. (not sure why we did that)
>>
>>
> Summing it up I believe that despite the feature not working 100%
> of the time, looks like the code is almost there but needs some 
> refactoring
> to make it more readable, instead of comments we could have function 
> calls
> that more clearly state what we are looking for something like
> DialogTabNavigator.isLastTabOfChild
> ​
> ​
>
>
> Thanks
> Joao
>
> On Wed, Feb 21, 2018 at 4:32 AM Harshal Dh

Re: PEP-8 fixes

2018-02-27 Thread Dave Page
Thanks, applied!

On Tue, Feb 27, 2018 at 7:19 AM, Harshal Dhumal <
harshal.dhu...@enterprisedb.com> wrote:

> Hi,
>
> Please find patch to fix pep-8 issues for given modules.
>
> 1. server group (__init__.py)
> 2. server (__init__.py, gpdb.py, types.py, utils.py)
>
>
> --
> *Harshal Dhumal*
> *Sr. Software Engineer*
>
> EnterpriseDB India: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>



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

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


pgAdmin 4 commit: PEP8 fixes for the server and server group modules.

2018-02-27 Thread Dave Page
PEP8 fixes for the server and server group modules.

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=055f7abc9ed0f3b547cf1a93fac84ff3abdd14e1
Author: Harshal Dhumal 

Modified Files
--
web/pgadmin/browser/server_groups/__init__.py  |   8 +-
.../browser/server_groups/servers/__init__.py  | 136 -
web/pgadmin/browser/server_groups/servers/gpdb.py  |   1 -
web/pgadmin/browser/server_groups/servers/types.py |   4 +-
web/pgadmin/browser/server_groups/servers/utils.py |   9 +-
5 files changed, 94 insertions(+), 64 deletions(-)



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

2018-02-27 Thread Dave Page
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
>>
>
>


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

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


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

2018-02-27 Thread Murtuza Zabuawala
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  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
>>>
>>
>>
>
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>


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

2018-02-27 Thread Murtuza Zabuawala
I'm not able to re-produce the issue, Could you hard refresh and try again?

If possible could you please provide exact steps?

--
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  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
>


>>>
>>>
>>> --
>>> Dave Page
>>> Blog: http://pgsnake.blogspot.com
>>> Twitter: @pgsnake
>>>
>>> EnterpriseDB UK: http://www.enterprisedb.com
>>> The Enterprise PostgreSQL Company
>>>
>>
>>
>
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>


[pgAdmin4][RM#3002] To fix the indentation issue in query tool editor

2018-02-27 Thread Murtuza Zabuawala
Hi,

PFA patch to fix the issue where Tab key was not working as expected in
query tool editor.

Steps to reproduce:
1) Type any multiline sql/text.
2) select the complete sql by pressing Ctrl+A.
3) Press Tab key multiple times, you will see the problem in code
indentation.

Please review.

--
Regards,
Murtuza Zabuawala
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
diff --git a/web/pgadmin/browser/static/js/browser.js 
b/web/pgadmin/browser/static/js/browser.js
index 13af4ea..46b6033 100644
--- a/web/pgadmin/browser/static/js/browser.js
+++ b/web/pgadmin/browser/static/js/browser.js
@@ -1945,7 +1945,7 @@ define('pgadmin.browser', [
   'Shift-Tab': 'indentLess',
 },
 editor_options: {
-  tabSize: pgBrowser.utils.tabSize,
+  tabSize: parseInt(pgBrowser.utils.tabSize),
   wrapCode: pgBrowser.utils.wrapCode,
   insert_pair_brackets: pgBrowser.utils.insertPairBrackets,
   brace_matching: pgBrowser.utils.braceMatching,


pgAdmin 4 commit: Add keyboard shortcuts for the Query Tool. Fixes #290

2018-02-27 Thread Dave Page
Add keyboard shortcuts for the Query Tool. Fixes #2900

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=a9de043fef964586858acb7070cbbebf2601b340
Author: Murtuza Zabuawala 

Modified Files
--
.../images/preferences_sql_keyboard_shortcuts.png  | Bin 0 -> 138163 bytes
docs/en_US/keyboard_shortcuts.rst  |  38 +-
docs/en_US/preferences.rst |   5 +
web/pgadmin/static/js/keyboard_shortcuts.js|  52 +-
.../static/js/sqleditor/query_tool_actions.js  |  48 +-
web/pgadmin/tools/datagrid/__init__.py |   8 +-
.../tools/datagrid/templates/datagrid/index.html   |  79 ++-
web/pgadmin/tools/debugger/__init__.py |  36 +-
web/pgadmin/tools/sqleditor/__init__.py| 244 +---
web/pgadmin/tools/sqleditor/static/js/sqleditor.js |   5 +-
.../tools/sqleditor/tests/test_pref_utilities.py   | 100 
.../sqleditor/utils/query_tool_preferences.py  | 653 +
web/pgadmin/utils/__init__.py  |  37 ++
.../sqleditor/keyboard_shortcuts_spec.js   | 184 +-
14 files changed, 1133 insertions(+), 356 deletions(-)



Re: [pgAdmin4][RM#2900] Adding accessibility features in query tool

2018-02-27 Thread Dave Page
Thanks guys - patch applied.

On Mon, Feb 26, 2018 at 5:31 PM, Murtuza Zabuawala <
murtuza.zabuaw...@enterprisedb.com> wrote:

> Thank you Joao for reviewing.
>
> On Mon, Feb 26, 2018 at 10:43 PM, Joao De Almeida Pereira <
> jdealmeidapere...@pivotal.io> wrote:
>
>> Hello Murtuza,
>> We just passed the patch through our CI pipeline and all tests pass. The
>> patch looks good.
>>
>> Sorry that the patch I sent didn't help. Nevertheless when I finish the
>> tasks that we want to try to get accepted for pgAdmin4 3.0 release I will
>> try to change the way the preferences are retrieved, because at this point
>> in time they work because we only ask for them after some time we try to
>> get them, or else the code does not work.
>> Unless someone want to give it a shot first. From my point of view this
>> functionality should work like a separate service that we include where we
>> need it and work with a promise system. There are some nice article about
>> promises and how to handle them instead of using event bouncing all around:
>> https://medium.com/dev-bits/writing-neat-asynchronous-node-
>> js-code-with-promises-32ed3a4fd098
>> https://developers.google.com/web/fundamentals/primers/promises (this is
>> quite a complete guide on promises, and how to think about them)
>>
>> Sure, I'll go through the articles you provided.
>
> Thanks,
> Murtuza
>
>
>> Thanks
>> Joao
>>
>> On Mon, Feb 26, 2018 at 4:58 AM Murtuza Zabuawala <
>> murtuza.zabuaw...@enterprisedb.com> wrote:
>>
>>> Hi Joao,
>>>
>>> I tried the solution/patch you suggested but it is not working for me, I
>>> always get *undefined* for preferences values.
>>>
>>> Thanks,
>>> Murtuza
>>>
>>> On Thu, Feb 22, 2018 at 3:17 AM, Joao De Almeida Pereira <
>>> jdealmeidapere...@pivotal.io> wrote:
>>>
 Hello Murtuza,
 I created a small patch on the way I believe the function should work.
 Not 100% sure why we are piggybacking on the window.top, window.opener and
 so on to give us information. Nowadays I do not think that loading the JS
 files again costs that much in terms of time.

 The issue I came across was that cache_preferences/get_preference
 behave in a very strange way.

 Example:
 If the cache is populated no problem it returns a value and it is fine
 If the cache is not populated it sets a timeout that will check in 1
 second if is the cache is populated if it is not then does nothing, if it
 is then returns the value.
 The problem is that it returns the value to no place.

 This caching implementation works until this point because for some
 good fortune we never call get_preference before we have the cache full.
 Is my assessment correct?

 Nevertheless if the caching was using promises we could avoid the
 problem above.

 Thanks
 Joao

 On Wed, Feb 21, 2018 at 12:50 PM Murtuza Zabuawala <
 murtuza.zabuaw...@enterprisedb.com> wrote:

> Hi Joao,
>
> Thank you for your time in reviewing the patch.
>
>
> On Wed, Feb 21, 2018 at 9:11 PM, Joao De Almeida Pereira <
> jdealmeidapere...@pivotal.io> wrote:
>
>> Hello Murtuza,
>> After reviewing the code I have some suggestions:
>>  - We should split the PEP and the features into different patches,
>> or else it becomes very hard to separate Feature code from Code Style 
>> change
>>
> ​I'll keep that in mind next time onwards.
>
>>  - The function: `getTextRepresentaionShortcut` has a typo
>>
> ​I'll fix​
>
> ​that.​
>
>>  - As a personal point I have a hard time reading multiple
>> declarations of variables in javascript under a single `var`, I prefer 1
>> `let` per variable
>>
>  - I think we should use cameCase for our variables in Javascript code
>>  - What is the reason behind the move of the key shortcuts back into
>> the SQLEditorController? This look like something that could be extracted
>> from SQLEditor file into its own
>>
> I'll try to move that code.​
>
>
>>  - Looks like we are missing some test coverage on the new
>> implemented parts
>>
> ​I didn't added any new code as such, I just moved out preferences
> code out from main file.
>
>>  - The getKeyboardShortcuts function is retrieving information from
>> window.top and window.opener I think that we can come up with a better
>> pattern then this. Relying on window information doesn't look very good.
>> That was the pattern for JQuery that the new frameworks are trying to 
>> avoid
>> because polluting the global scope is almost always a Code Smell.
>>
> ​What do you suggest on this?​
>
>
>>
>>
>> I see there was some refactoring on the backend with the creation of
>> RegisterQueryToolPreferences and it is looking good, hope that we can do
>> this in more places specially in the front-end.
>>
>> Using t

RM3079 fix for wrong sql datetime/time related datatypes

2018-02-27 Thread Harshal Dhumal
Hi,

Please find patch to fix wrong sql issue for time related type.

Steps to reproduce:

Alter any time/datetime array related data type, it generates sql with
addition array bracket

[image: Inline image 1]




-- 
*Harshal Dhumal*
*Sr. Software Engineer*

EnterpriseDB India: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/templates/type/macros/get_full_type_sql_format.macros b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/templates/type/macros/get_full_type_sql_format.macros
index 1520232..a2ad322 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/templates/type/macros/get_full_type_sql_format.macros
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/templates/type/macros/get_full_type_sql_format.macros
@@ -58,6 +58,6 @@ time({{ data.attlen }}) with time zone {% endif %}{% if o_data.hasSqrBracket %}[
 {% if data.attlen and data.attlen != 'None' %}
 ({{ data.attlen }}{% elif o_data.attlen and o_data.attlen != 'None' %}({{ o_data.attlen }}{% endif %}{% if data.attprecision and data.attprecision != 'None' %}
 , {{ data.attprecision }}){% elif o_data.attprecision and o_data.attprecision != 'None' %}, {{ o_data.attprecision }}){% else %}){% endif %}
-{% endif %}
 {% endif %}{% if o_data.hasSqrBracket %}[]{% endif %}
+{% endif %}
 {% endmacro %}


Re: [pgAdmin4][RM#3002] To fix the indentation issue in query tool editor

2018-02-27 Thread Joao De Almeida Pereira
Hello Murtuza,

The patch looks good, and solves the problem. Run the patch on our CI and
everything is green.

Thanks
Joao

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

> Hi,
>
> PFA patch to fix the issue where Tab key was not working as expected in
> query tool editor.
>
> Steps to reproduce:
> 1) Type any multiline sql/text.
> 2) select the complete sql by pressing Ctrl+A.
> 3) Press Tab key multiple times, you will see the problem in code
> indentation.
>
> Please review.
>
> --
> Regards,
> Murtuza Zabuawala
> EnterpriseDB: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
>


Re: [pgAdmin4][RM#3002] To fix the indentation issue in query tool editor

2018-02-27 Thread Murtuza Zabuawala
Thank you for testing it Joao.

--
Regards,
Murtuza

On Tue, Feb 27, 2018 at 8:29 PM, Joao De Almeida Pereira <
jdealmeidapere...@pivotal.io> wrote:

> Hello Murtuza,
>
> The patch looks good, and solves the problem. Run the patch on our CI and
> everything is green.
>
> Thanks
> Joao
>
> On Tue, Feb 27, 2018 at 8:11 AM Murtuza Zabuawala  enterprisedb.com> wrote:
>
>> Hi,
>>
>> PFA patch to fix the issue where Tab key was not working as expected in
>> query tool editor.
>>
>> Steps to reproduce:
>> 1) Type any multiline sql/text.
>> 2) select the complete sql by pressing Ctrl+A.
>> 3) Press Tab key multiple times, you will see the problem in code
>> indentation.
>>
>> Please review.
>>
>> --
>> Regards,
>> Murtuza Zabuawala
>> EnterpriseDB: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>>
>>


[pgAdmin4][RM#3156] Fix PEP-8 issues

2018-02-27 Thread Murtuza Zabuawala
Hi,

PFA patch to fix the PEP-8 issues in Resource group, Roles & Tablespaces

pycodestyle --config=.pycodestyle
pgadmin/browser/server_groups/servers/tablespaces/
pycodestyle --config=.pycodestyle
pgadmin/browser/server_groups/servers/roles/
pycodestyle --config=.pycodestyle
pgadmin/browser/server_groups/servers/resource_groups/


--
Regards,
Murtuza Zabuawala
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
diff --git 
a/web/pgadmin/browser/server_groups/servers/resource_groups/__init__.py 
b/web/pgadmin/browser/server_groups/servers/resource_groups/__init__.py
index 336fe7d..a9b622d 100644
--- a/web/pgadmin/browser/server_groups/servers/resource_groups/__init__.py
+++ b/web/pgadmin/browser/server_groups/servers/resource_groups/__init__.py
@@ -32,12 +32,14 @@ class ResourceGroupModule(CollectionNodeModule):
 """
  class ResourceGroupModule(CollectionNodeModule)
 
-A module class for Resource Group node derived from 
CollectionNodeModule.
+A module class for Resource Group node derived from
+CollectionNodeModule.
 
 Methods:
 ---
 * __init__(*args, **kwargs)
-  - Method is used to initialize the ResourceGroupModule and it's base 
module.
+  - Method is used to initialize the ResourceGroupModule and it's
+  base module.
 
 * BackendSupported(manager, **kwargs)
   - This function is used to check the database server type and version.
@@ -50,8 +52,8 @@ class ResourceGroupModule(CollectionNodeModule):
   - Method is overridden from its base class to make the node as leaf node.
 
 * script_load()
-  - Load the module script for resource group, when any of the server node 
is
-initialized.
+  - Load the module script for resource group, when any of the server
+  node is initialized.
 """
 
 NODE_TYPE = 'resource_group'
@@ -59,7 +61,8 @@ class ResourceGroupModule(CollectionNodeModule):
 
 def __init__(self, *args, **kwargs):
 """
-Method is used to initialize the ResourceGroupModule and it's base 
module.
+Method is used to initialize the ResourceGroupModule and
+it's base module.
 
 Args:
 *args:
@@ -93,13 +96,13 @@ class ResourceGroupModule(CollectionNodeModule):
 @property
 def script_load(self):
 """
-Load the module script for resource group, when any of the server node 
is initialized.
+Load the module script for resource group, when any of the server
+node is initialized.
 
 Returns: node type of the server module.
 """
 return servers.ServerModule.NODE_TYPE
 
-
 @property
 def module_use_template_javascript(self):
 """
@@ -116,9 +119,10 @@ class ResourceGroupView(NodeView):
 """
 class ResourceGroupView(NodeView)
 
-A view class for resource group node derived from NodeView. This class 
is
-responsible for all the stuff related to view like 
create/update/delete resource group,
-showing properties of resource group node, showing sql in sql pane.
+A view class for resource group node derived from NodeView.
+This class is responsible for all the stuff related to view like
+create/update/delete resource group, showing properties of resource
+group node, showing sql in sql pane.
 
 Methods:
 ---
@@ -135,14 +139,16 @@ class ResourceGroupView(NodeView):
 manager,conn & template_path properties to self
 
 * list()
-  - This function is used to list all the resource group nodes within that 
collection.
+  - This function is used to list all the resource group nodes within
+  that collection.
 
 * nodes()
-  - This function will used to create all the child node within that 
collection.
-Here it will create all the resource group node.
+  - This function will used to create all the child node within that
+  collection. Here it will create all the resource group node.
 
 * properties(gid, sid, did, rg_id)
-  - This function will show the properties of the selected resource group 
node
+  - This function will show the properties of the selected resource
+  group node
 
 * create(gid, sid, did, rg_id)
   - This function will create the new resource group object
@@ -154,13 +160,15 @@ class ResourceGroupView(NodeView):
   - This function will drop the resource group object
 
 * msql(gid, sid, did, rg_id)
-  - This function is used to return modified SQL for the selected resource 
group node
+  - This function is used to return modified SQL for the selected
+  resource group node
 
 * get_sql(data, rg_id)
   - This function will generate sql from model data
 
 * sql(gid, sid, did, rg_id):
-  - This function will generate sql to show it in sql pane for the 
selected resource group node.
+  - This function will generate sql to show it in sql pane for the
+  selected reso

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

2018-02-27 Thread Dave Page
Hi

On Tue, Feb 27, 2018 at 12:03 PM, Murtuza Zabuawala <
murtuza.zabuaw...@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
>>
>
>


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

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

>>>
>>>
>>
>>
>> --
>> Dave Page
>> Blog: http://pgsnake.blogspot.com
>> Twitter: @pgsnake
>>
>> EnterpriseDB UK: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>>
>
>


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

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


pgagent.sql
Description: Binary data


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

2018-02-27 Thread Murtuza Zabuawala
​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
>>>
>>
>>
>
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>


>>>
>>>
>>> --
>>> Dave Page
>>> Blog: http://pgsnake.blogspot.com
>>> Twitter: @pgsnake
>>>
>>> EnterpriseDB UK: http://www.enterprisedb.com
>>> The Enterprise PostgreSQL Company
>>>
>>
>>
>
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>


pgAdmin 4 commit: Fix block indent/outdent with configurable width. Fix

2018-02-27 Thread Dave Page
Fix block indent/outdent with configurable width. Fixes #3002

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=f5afd5fdb4883011a1a1c0510823f43e98264b23
Author: Murtuza Zabuawala 

Modified Files
--
web/pgadmin/browser/static/js/browser.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)



Re: [pgAdmin4][RM#3002] To fix the indentation issue in query tool editor

2018-02-27 Thread Dave Page
Thanks, patch applied.

On Tue, Feb 27, 2018 at 3:00 PM, Murtuza Zabuawala <
murtuza.zabuaw...@enterprisedb.com> wrote:

> Thank you for testing it Joao.
>
> --
> Regards,
> Murtuza
>
> On Tue, Feb 27, 2018 at 8:29 PM, Joao De Almeida Pereira <
> jdealmeidapere...@pivotal.io> wrote:
>
>> Hello Murtuza,
>>
>> The patch looks good, and solves the problem. Run the patch on our CI and
>> everything is green.
>>
>> Thanks
>> Joao
>>
>> On Tue, Feb 27, 2018 at 8:11 AM Murtuza Zabuawala <
>> murtuza.zabuaw...@enterprisedb.com> wrote:
>>
>>> Hi,
>>>
>>> PFA patch to fix the issue where Tab key was not working as expected in
>>> query tool editor.
>>>
>>> Steps to reproduce:
>>> 1) Type any multiline sql/text.
>>> 2) select the complete sql by pressing Ctrl+A.
>>> 3) Press Tab key multiple times, you will see the problem in code
>>> indentation.
>>>
>>> Please review.
>>>
>>> --
>>> Regards,
>>> Murtuza Zabuawala
>>> EnterpriseDB: http://www.enterprisedb.com
>>> The Enterprise PostgreSQL Company
>>>
>>>
>


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

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


Re: RM3079 fix for wrong sql datetime/time related datatypes

2018-02-27 Thread Dave Page
Hi

On Tue, Feb 27, 2018 at 2:36 PM, Harshal Dhumal <
harshal.dhu...@enterprisedb.com> wrote:

> Hi,
>
> Please find patch to fix wrong sql issue for time related type.
>
> Steps to reproduce:
>
> Alter any time/datetime array related data type, it generates sql with
> addition array bracket
>
> [image: Inline image 1]
>

This seems to be missing the test case that you noted should be included in
the original bug report!

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

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


pgAdmin 4 commit: PEP8 fixes. Fixes #3156

2018-02-27 Thread Dave Page
PEP8 fixes. Fixes #3156

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=cca6504d54e2cac81c6be0d1e43138fa5c7e98a8
Author: Murtuza Zabuawala 

Modified Files
--
.../servers/resource_groups/__init__.py| 196 ++---
.../tests/test_resource_groups_delete.py   |   4 +-
.../tests/tests_resource_groups_get.py |   2 +-
.../server_groups/servers/roles/__init__.py| 141 +--
.../servers/roles/tests/test_role_add.py   |   9 +-
.../servers/roles/tests/test_role_delete.py|   1 -
.../servers/roles/tests/test_role_put.py   |   1 -
.../server_groups/servers/tablespaces/__init__.py  |  55 --
.../tablespaces/tests/test_backend_supported.py|   1 +
.../servers/tablespaces/tests/test_tbspc_add.py|   6 +-
.../servers/tablespaces/tests/test_tbspc_delete.py |  18 +-
.../servers/tablespaces/tests/test_tbspc_put.py|  10 +-
12 files changed, 290 insertions(+), 154 deletions(-)



Re: [pgAdmin4][RM#3156] Fix PEP-8 issues

2018-02-27 Thread Dave Page
Thanks, applied.

On Tue, Feb 27, 2018 at 3:02 PM, Murtuza Zabuawala <
murtuza.zabuaw...@enterprisedb.com> wrote:

> Hi,
>
> PFA patch to fix the PEP-8 issues in Resource group, Roles & Tablespaces
>
> pycodestyle --config=.pycodestyle pgadmin/browser/server_groups/
> servers/tablespaces/
> pycodestyle --config=.pycodestyle pgadmin/browser/server_groups/
> servers/roles/
> pycodestyle --config=.pycodestyle pgadmin/browser/server_groups/
> servers/resource_groups/
>
>
> --
> Regards,
> Murtuza Zabuawala
> EnterpriseDB: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
>


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

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


Re: [pgAdmin4][Patch]: PEP-8 issue fixes

2018-02-27 Thread Khushboo Vashi
On Mon, Feb 26, 2018 at 9:19 PM, Dave Page  wrote:

> Can you rebase this please? It doesn't apply against master.
>
> Please find the updated patch excluding utils module as it is already
done.

> On Mon, Feb 26, 2018 at 12:04 PM, Khushboo Vashi <
> khushboo.va...@enterprisedb.com> wrote:
>
>> Hi,
>>
>> Please find the attached patch to fix PEP-8 issues in the below modules:
>>
>> 1. about
>> 2. feature_tests
>> 3. misc
>> 4. utils
>>
>> Thanks,
>> Khushboo
>>
>
>
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
diff --git a/web/pgadmin/about/__init__.py b/web/pgadmin/about/__init__.py
index 98a4dd6..6d1e0b2 100644
--- a/web/pgadmin/about/__init__.py
+++ b/web/pgadmin/about/__init__.py
@@ -8,7 +8,6 @@
 ##
 
 """A blueprint module implementing the about box."""
-MODULE_NAME = 'about'
 
 import sys
 from flask import Response, render_template, __version__, url_for
@@ -18,6 +17,8 @@ from pgadmin.utils import PgAdminModule
 from pgadmin.utils.menu import MenuItem
 import config
 
+MODULE_NAME = 'about'
+
 
 class AboutModule(PgAdminModule):
 def get_own_menuitems(self):
diff --git a/web/pgadmin/feature_tests/keyboard_shortcut_test.py b/web/pgadmin/feature_tests/keyboard_shortcut_test.py
index b83457c..443eff6 100644
--- a/web/pgadmin/feature_tests/keyboard_shortcut_test.py
+++ b/web/pgadmin/feature_tests/keyboard_shortcut_test.py
@@ -65,7 +65,8 @@ class KeyboardShortcutFeatureTest(BaseFeatureTest):
 Keys.ALT
 ).perform()
 
-print("Executing shortcut: " + self.new_shortcuts[s]['locator'] + "...", file=sys.stderr, end="")
+print("Executing shortcut: " + self.new_shortcuts[s]['locator'] +
+  "...", file=sys.stderr, end="")
 
 self.wait.until(
 EC.presence_of_element_located(
diff --git a/web/pgadmin/feature_tests/view_data_dml_queries.py b/web/pgadmin/feature_tests/view_data_dml_queries.py
index aa75b6e..12e4295 100644
--- a/web/pgadmin/feature_tests/view_data_dml_queries.py
+++ b/web/pgadmin/feature_tests/view_data_dml_queries.py
@@ -100,7 +100,7 @@ CREATE TABLE public.defaults_{0}
 test_utils.create_database(self.server, "acceptance_test_db")
 
 # Create pre-requisite table
-for k, v in { 1: 'id', 2:'"ID"' }.items():
+for k, v in {1: 'id', 2: '"ID"'}.items():
 test_utils.create_table_with_query(
 self.server,
 "acceptance_test_db",
@@ -114,7 +114,7 @@ CREATE TABLE public.defaults_{0}
 self.page.add_server(self.server)
 self._tables_node_expandable()
 # iterate on both tables
-for cnt in (1,2):
+for cnt in (1, 2):
 self.page.select_tree_item('defaults_{0}'.format(str(cnt)))
 # Open Object -> View/Edit data
 self._view_data_grid()
diff --git a/web/pgadmin/misc/bgprocess/processes.py b/web/pgadmin/misc/bgprocess/processes.py
index 0c4112a..02b953d 100644
--- a/web/pgadmin/misc/bgprocess/processes.py
+++ b/web/pgadmin/misc/bgprocess/processes.py
@@ -21,10 +21,6 @@ from subprocess import Popen
 
 from pgadmin.utils import IS_PY2, u, file_quote, fs_encoding
 
-if IS_PY2:
-from StringIO import StringIO
-else:
-from io import StringIO
 import pytz
 from dateutil import parser
 from flask import current_app
@@ -33,6 +29,10 @@ from flask_security import current_user
 
 import config
 from pgadmin.model import Process, db
+if IS_PY2:
+from StringIO import StringIO
+else:
+from io import StringIO
 
 
 def get_current_time(format='%Y-%m-%d %H:%M:%S.%f %z'):
diff --git a/web/pgadmin/utils/__init__.py b/web/pgadmin/utils/__init__.py
index 631e981..c87a045 100644
--- a/web/pgadmin/utils/__init__.py
+++ b/web/pgadmin/utils/__init__.py
@@ -7,6 +7,8 @@
 #
 ##
 
+import os
+import sys
 from collections import defaultdict
 from operator import attrgetter
 
@@ -153,9 +155,6 @@ class PgAdminModule(Blueprint):
 return res
 
 
-import os
-import sys
-
 IS_PY2 = (sys.version_info[0] == 2)
 IS_WIN = (os.name == 'nt')
 
@@ -316,4 +315,3 @@ SHORTCUT_FIELDS = [
 'label': gettext('Alt/Option')
 }
 ]
-
diff --git a/web/pgadmin/utils/javascript/tests/test_javascript_bundler.py b/web/pgadmin/utils/javascript/tests/test_javascript_bundler.py
index f946cb8..7030703 100644
--- a/web/pgadmin/utils/javascript/tests/test_javascript_bundler.py
+++ b/web/pgadmin/utils/javascript/tests/test_javascript_bundler.py
@@ -9,16 +9,15 @@
 
 
 import sys
+from pgadmin.utils.route import BaseTestGenerator
+from pgadmin.utils.javascript.javascript_bundler import JavascriptBundler
+from pgadmin.utils.javascript.javascript_bundler import JsState
 
 if sys.version_info < (3, 3):
 from mock import patch
 else:
 from unittest