Re: [pgAdmin4][Patch][RM_2567] : Default privileges don't show on Properties tab for database.

2017-08-08 Thread Murtuza Zabuawala
Hi Atul,

The given patch breaks RM#1801 .
After applying the patch, Now I'm not able to see the properties of a
database of which "datallowconn" is set to False.

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

[image: https://community.postgresrocks.net/]


On Tue, Aug 8, 2017 at 12:08 PM, Ashesh Vashi  wrote:

> Murtuza,
>
> Please review this one.
>
> --
>
> Thanks & Regards,
>
> Ashesh Vashi
> EnterpriseDB INDIA: Enterprise PostgreSQL Company
> 
>
>
> *http://www.linkedin.com/in/asheshvashi*
> 
>
> On Tue, Aug 1, 2017 at 3:23 PM, Atul Sharma 
> wrote:
>
>> Hi,
>>
>> PFA patch that fixes Default privileges don't show on Properties tab for
>> database
>>
>> Thanks,
>> Atul
>>
>
>


Re: [pgAdmin4][Patch][RM_2567] : Default privileges don't show on Properties tab for database.

2017-08-08 Thread Atul Sharma
ok, Lemme check and I will get back to you.

Thanks,
Atul

On Tue, Aug 8, 2017 at 12:40 PM, Murtuza Zabuawala <
murtuza.zabuaw...@enterprisedb.com> wrote:

> Hi Atul,
>
> The given patch breaks RM#1801
> .
> After applying the patch, Now I'm not able to see the properties of a
> database of which "datallowconn" is set to False.
>
> --
> Regards,
> Murtuza Zabuawala
> EnterpriseDB: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
> [image: https://community.postgresrocks.net/]
> 
>
> On Tue, Aug 8, 2017 at 12:08 PM, Ashesh Vashi <
> ashesh.va...@enterprisedb.com> wrote:
>
>> Murtuza,
>>
>> Please review this one.
>>
>> --
>>
>> Thanks & Regards,
>>
>> Ashesh Vashi
>> EnterpriseDB INDIA: Enterprise PostgreSQL Company
>> 
>>
>>
>> *http://www.linkedin.com/in/asheshvashi*
>> 
>>
>> On Tue, Aug 1, 2017 at 3:23 PM, Atul Sharma > > wrote:
>>
>>> Hi,
>>>
>>> PFA patch that fixes Default privileges don't show on Properties tab for
>>> database
>>>
>>> Thanks,
>>> Atul
>>>
>>
>>
>


Re: Unified server/desktop config

2017-08-08 Thread Dave Page
On Tue, Aug 8, 2017 at 7:18 AM, Surinder Kumar <
surinder.ku...@enterprisedb.com> wrote:

> Hi
>
> On Ubuntu-14.04, I got error Application Server couldn't be contacted:
>
> *Steps performed:*
>
>- I have already installed pgAdmin4-1.4 which come with PostgreSQL-9.6
>installer.
>then I run root@ubuntu:/opt/PostgreSQL/9.6/pgAdmin 4/bin# ./pgAdmin4./.
>- Now took latest git pull from HEAD
>- Apply unified_config.diff patch.
>- Then compiled pgAdmin4 in runtime and then run ./pgAdmin.
>- Got error Application Server couldn't be contacted.
>
> But when I ran ./pgAdmin4 for the second time. pgAdmin4 runs without any
> issue.
> I didn’t get any error on the terminal and log file.
> ​ I couldn't find why it gives this error.​
>

I know Fahar has run into this with existing releases on Ubuntu. If you
enable debugging, can you see any clues? I assume it's going round the
retry loop before aborting?

> *Another issue related to Alembic:*
>
> If I am running pgAdmin4 already installed on my machine, then I upgrade
> pgAdmin4 using Python wheel:
>
> (test_p27) surinder@ubuntu:~/virtualenvs/test_p27$ python
> ~/virtualenvs/test_p27/lib/python2.7/site-packages/pgadmin4/pgAdmin4.py
>
> *I am getting error:*
>
> alembic.util.exc.CommandError: Can't locate revision identified by
> 'd85a62333272'
>
> To fix this, I have to delete existing pgadmin4.db file. I don’t know if
> it is a valid case or should I log an RM if it is?
>
That's an annoying side-effect of the move to Alembic. The previous DB code
would quite happily (and intentionally) run with a newer version of the
database, however, the new code does not. You'll see this issue whenever
you've run a newer version of pgAdmin and then go back to an older version
that uses an older schema version.

It would be nice to change this so it doesn't complain - but we'd have to
be cautious to only break compatibility on major releases.



> Apart for this, I didn’t see any functionality break. It works!!
>
> I liked the approach to set SEVER_MODE in runtime using built-ins.
>
Thanks. Do you think it warrants a 2.0 version number, given the potential
for breaking existing installations (I do, but would like other feedback)?
If we do that - and thus allow a parallel installation of 1.x and 2.x), how
would we resolve the Alembic issue you noted such that both versions could
be run against the same DB?



> Thanks,
> Surinder
> ​
>
> On Mon, Aug 7, 2017 at 7:01 PM, Dave Page  wrote:
>
>>
>>
>> On Mon, Aug 7, 2017 at 1:43 PM, Surinder Kumar <
>> surinder.ku...@enterprisedb.com> wrote:
>>
>>> Hi,
>>>
>>> The patch seems to work in Runtime mode, but fails in Server mode with
>>> error:
>>>
>>> (pgAdmin_27)Laptop195:pgadmin4 surinder$ python web/pgAdmin4.py
>>> Traceback (most recent call last):
>>>   File "web/pgAdmin4.py", line 55, in 
>>> exec(open(file_quote(setupfile), 'r').read())
>>>   File "", line 35, in 
>>>   File 
>>> "/Users/surinder/Documents/Projects/pgadmin4/web/pgadmin/setup/data_directory.py",
>>>  line 23, in create_app_data_directory
>>> _create_directory_if_not_exists(os.path.dirname(config.SQLITE_PATH))
>>>   File 
>>> "/Users/surinder/Documents/Projects/pgadmin4/web/pgadmin/setup/data_directory.py",
>>>  line 15, in _create_directory_if_not_exists
>>> os.mkdir(_path)
>>> OSError: [Errno 13] Permission denied: '/var/lib/pgadmin'
>>> (pgAdmin_27)Laptop195:pgadmin4 surinder$
>>>
>>> This is because the directory /var/lib/ has root only access and I am
>>> running pgAdmin4 with the non-root user.
>>>
>>> Also pgadmin directory is not created.
>>>
>>> (pgAdmin_35)Laptop195:pgadmin4 surinder$ ls /var/lib/pgadmin
>>> ls: /var/lib/pgadmin: No such file or directory
>>>
>>> I got same error with MacOSX and Ubuntu-14.04 machines irrespective of
>>> Python version.
>>>
>>> Meanwhile, I am testing patch with other test cases.
>>>
>> That's fully expected. In the case of Linux, the packages will be
>> responsible for creating those directories with the appropriate ownership.
>> In other cases, the user would.
>>
> ​ok, I got it.​
>
>>
>> There's not really much we can do about that - and it's exactly what
>> would happen if you try to run many other packages yourself when standard
>> *nix paths are used.
>>
>
>>
>>
>>> Thanks,
>>> Surinder
>>> ​
>>>
>>> On Mon, Aug 7, 2017 at 4:33 PM, Surinder Kumar <
>>> surinder.ku...@enterprisedb.com> wrote:
>>>
 On Mon, Aug 7, 2017 at 4:11 PM, Ashesh Vashi <
 ashesh.va...@enterprisedb.com> wrote:

> On Mon, Aug 7, 2017 at 3:59 PM, Dave Page  wrote:
>
>> Anyone?
>>
> Surinder - please give this one priority.
>
 Sure
 ​.​


>
> --
>
> Thanks & Regards,
>
> Ashesh Vashi
> EnterpriseDB INDIA: Enterprise PostgreSQL Company
> 
>
>
> *http://www.linkedin.com/in/asheshvashi*
> 
>
>>
>> On Thu, Jul 20, 2017 at 5:03 PM, Dave Page 

Re: [pgAdmin4][PATCH] To fix the add New Server through Quick links on Dashboard

2017-08-08 Thread Murtuza Zabuawala
Hi,

PFA updated patch for the same.

Thanks Surinder for pointing that out, I assumed that we had a typo in that
file.



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

[image: https://community.postgresrocks.net/]


On Tue, Aug 8, 2017 at 12:18 PM, Surinder Kumar <
surinder.ku...@enterprisedb.com> wrote:

> Hi Murtuza,
>
> As type server-group is renamed to server_group, I can see there are
> other occurrences of string server-group which needs to be replaced when
> I perform search in pgAdmin4.
>
> Can you please take care of those occurrences?
>
> Thanks,
> Surinder
>
> On Tue, Aug 8, 2017 at 12:02 PM, Murtuza Zabuawala [murtuza.zabuawala@
> enterprisedb.com](mailto:murtuza.zabuaw...@enterprisedb.com)
> 
> wrote:
>
> Hi,
>>
>> PFA minor patch to fix the issue where add new server functionality
>> through Quick link on Dashboard is broken.
>> RM#2634
>>
>> --
>> Regards,
>> Murtuza Zabuawala
>> EnterpriseDB: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>>
>> [image: https://community.postgresrocks.net/]
>> 
>>
> ​
>
diff --git a/web/pgadmin/browser/server_groups/servers/roles/static/js/role.js 
b/web/pgadmin/browser/server_groups/servers/roles/static/js/role.js
index 44703f1..d7f3f40 100644
--- a/web/pgadmin/browser/server_groups/servers/roles/static/js/role.js
+++ b/web/pgadmin/browser/server_groups/servers/roles/static/js/role.js
@@ -556,8 +556,7 @@ define('pgadmin.node.role', [
   return null;
 }
   })
-}),
-sg = pgBrowser.Nodes['server-group'];
+})
   }
 
   return pgBrowser.Nodes['role'];
diff --git a/web/pgadmin/browser/templates/browser/js/utils.js 
b/web/pgadmin/browser/templates/browser/js/utils.js
index 2e59512..a3723ec 100644
--- a/web/pgadmin/browser/templates/browser/js/utils.js
+++ b/web/pgadmin/browser/templates/browser/js/utils.js
@@ -9,7 +9,7 @@ define('pgadmin.browser.utils',
 
   // Define list of nodes on which Query tool option doesn't appears
   var unsupported_nodes = pgAdmin.unsupported_nodes = [
- 'server-group', 'server', 'coll-tablespace', 'tablespace',
+ 'server_group', 'server', 'coll-tablespace', 'tablespace',
  'coll-role', 'role', 'coll-resource_group', 'resource_group',
  'coll-database'
   ];
@@ -85,4 +85,4 @@ define('pgadmin.browser.utils',
 }
   };
   return pgBrowser;
-});
\ No newline at end of file
+});
diff --git a/web/pgadmin/dashboard/static/js/dashboard.js 
b/web/pgadmin/dashboard/static/js/dashboard.js
index 86ebe38..22b7675 100644
--- a/web/pgadmin/dashboard/static/js/dashboard.js
+++ b/web/pgadmin/dashboard/static/js/dashboard.js
@@ -357,11 +357,13 @@ function(url_for, gettext, r, $, _, pgAdmin, Backbone, 
Backgrid, Flotr,
 // Handler function to support the "Add Server" link
 add_new_server: function() {
 if (pgBrowser && pgBrowser.tree) {
-var i = pgBrowser.tree.first(null, false),
-serverModule = r('pgadmin.node.server'),
-itemData = pgBrowser.tree.itemData(i);
+var i = pgBrowser.tree.selected().length != 0 ?
+  pgBrowser.tree.selected() :
+  pgBrowser.tree.first(null, false),
+ serverModule = r('pgadmin.node.server'),
+ itemData = pgBrowser.tree.itemData(i);
 
-while (itemData && itemData._type != "server-group") {
+while (itemData && itemData._type != "server_group") {
 i = pgBrowser.tree.next(i);
 itemData = pgBrowser.tree.itemData(i);
 }
diff --git a/web/pgadmin/static/js/check_node_visibility.js 
b/web/pgadmin/static/js/check_node_visibility.js
index 18b6655..5a627ec 100644
--- a/web/pgadmin/static/js/check_node_visibility.js
+++ b/web/pgadmin/static/js/check_node_visibility.js
@@ -24,7 +24,7 @@ define(['jquery', 'underscore', 'underscore.string'],
 
   // Exclude non-applicable nodes
   var nodes_not_supported = [
-"server-group", "server", "catalog_object_column"
+"server_group", "server", "catalog_object_column"
   ];
   if(_.indexOf(nodes_not_supported, node_type) >= 0) {
 return true;


Re: [pgAdmin4][Patch][RM_2567] : Default privileges don't show on Properties tab for database.

2017-08-08 Thread Murtuza Zabuawala
Hi Atul,

Better solution to solve this issue is to use self.conn instead of creating
new conn using did, we already checking for "datallowconn" flag in
check_precondition
decorator.

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

[image: https://community.postgresrocks.net/]


On Tue, Aug 8, 2017 at 12:42 PM, Atul Sharma 
wrote:

> ok, Lemme check and I will get back to you.
>
> Thanks,
> Atul
>
> On Tue, Aug 8, 2017 at 12:40 PM, Murtuza Zabuawala  enterprisedb.com> wrote:
>
>> Hi Atul,
>>
>> The given patch breaks RM#1801
>> .
>> After applying the patch, Now I'm not able to see the properties of a
>> database of which "datallowconn" is set to False.
>>
>> --
>> Regards,
>> Murtuza Zabuawala
>> EnterpriseDB: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>>
>> [image: https://community.postgresrocks.net/]
>> 
>>
>> On Tue, Aug 8, 2017 at 12:08 PM, Ashesh Vashi <
>> ashesh.va...@enterprisedb.com> wrote:
>>
>>> Murtuza,
>>>
>>> Please review this one.
>>>
>>> --
>>>
>>> Thanks & Regards,
>>>
>>> Ashesh Vashi
>>> EnterpriseDB INDIA: Enterprise PostgreSQL Company
>>> 
>>>
>>>
>>> *http://www.linkedin.com/in/asheshvashi*
>>> 
>>>
>>> On Tue, Aug 1, 2017 at 3:23 PM, Atul Sharma <
>>> atul.sha...@enterprisedb.com> wrote:
>>>
 Hi,

 PFA patch that fixes Default privileges don't show on Properties tab
 for database

 Thanks,
 Atul

>>>
>>>
>>
>


Re: [pgAdmin4][patch] update the alert style in the sub-navigation

2017-08-08 Thread Wenlin Zhang
Hi Surinder,

   Thanks for your review.

   We have changed the indentation for _dashboard.scss file and also
removed the style about icon-postgres:before, like margin-top,etc, but we
are not sure if it is perfectly aligned now, you can add further change to
it.

As the second comment, I'm sorry I'm not sure what's the problem, could
you please clarify it? Because we replace css with scss right now,
dashboard.css doesn't exist. So maybe you are looking at the css file that
are complied by the scss?

For the fourth comment, we tried the steps you suggested on master
branch, the error is not shown either. So it should be an existing issue.
But if you want to see the error message, navigate to "Servers" at the top
of browser, then navigate back to postgresql server, then you will see the
error message.


Thanks,

Wenlin &Violet



On Mon, Aug 7, 2017 at 2:30 PM, Surinder Kumar <
surinder.ku...@enterprisedb.com> wrote:

> Hi
> Review comments:
>
>1.
>
>For consistency, we use two spaces for indentation in CSS files. Four
>spaces are used in _dashboard.scss file. The configurations are
>defined in web/.editorconfig file.
>2.
>
>In,dashboard.css Can we return function object in return instead of
>function class itself, this will eliminate the need of creating function
>object every time we use info and error?
>3.
>
>On Dashboard, I can see Postgres icon is misaligned compared to other
>icons in Getting Started section. It is not related to this patch.
>adjusting margin top will fix it.
>4.
>
>I tried to test out Error message displayed, but I encounter an
>error(screenshot attached).
>Steps to reproduce:
>   - Open pgAdmin4 in browser
>   - Connect to PostgreSQL Server, Keep dashboard tab open.
>   - Navigate to the database which is connected.
>   - Now disconnect pgAdmin4 python server.
>   - No error message is displayed on Dashboard because it breaks in
>   JS as xhr.responseText is empty.
>   However, it might be an existing issue.
>
> Thanks,
> Surinder
>
> On Mon, Aug 7, 2017 at 10:40 AM, Wenlin Zhang  wrote:
>
> Hi Ashesh,
>>
>> That's correct. This patch just changed alert style in the 'tabs',
>> such as Dependency and Dependents.
>>
>> Thanks
>>
>> Wenlin
>>
>> On Mon, Aug 7, 2017 at 12:51 PM, Ashesh Vashi <
>> ashesh.va...@enterprisedb.com> wrote:
>>
>>> Surinder,
>>>
>>> Please take a look at this patch.
>>>
>>> If I recalls correctly, this patch is related to styling of the 'tabs'
>>> shown on the main window.
>>> Wenlin - please correct me if my understanding is wrong.
>>>
>>> --
>>>
>>> Thanks & Regards,
>>>
>>> Ashesh Vashi
>>> EnterpriseDB INDIA: Enterprise PostgreSQL Company
>>> 
>>>
>>>
>>> *http://www.linkedin.com/in/asheshvashi*
>>> 
>>>
>>> On Mon, Aug 7, 2017 at 8:11 AM, Sarah McAlear 
>>> wrote:
>>>
 Hi hackers,

 Could you please review this patch?

 Thanks

 Wenlin and Sarah

 On Wed, Aug 2, 2017 at 2:15 PM, Wenlin Zhang  wrote:

> Hi Hackers,
>
> This patch changes the alert style in the sub-navigation to match
> style guide.
>
> Thanks,
> Wenlin, Shirley & Sarah
>
>
>

>>>
>> ​
>
diff --git a/web/pgadmin/browser/static/js/browser.js 
b/web/pgadmin/browser/static/js/browser.js
index 45939b00..23d1d50e 100644
--- a/web/pgadmin/browser/static/js/browser.js
+++ b/web/pgadmin/browser/static/js/browser.js
@@ -136,7 +136,7 @@ define(
 width: 500,
 isCloseable: false,
 isPrivate: true,
-content: '' + select_object_msg + '',
+content: '' + 
select_object_msg + '',
 events: panelEvents
   }),
   // Reversed engineered SQL for the object
@@ -157,7 +157,7 @@ define(
 width: 500,
 isCloseable: false,
 isPrivate: true,
-content: '' + select_object_msg + '',
+content: '' + 
select_object_msg + '',
 events: panelEvents
   }),
   // Dependents of the object
@@ -168,7 +168,7 @@ define(
 width: 500,
 isCloseable: false,
 isPrivate: true,
-content: '' + select_object_msg + '',
+content: '' + 
select_object_msg + '',
 events: panelEvents
   })
 },
diff --git a/web/pgadmin/dashboard/__init__.py 
b/web/pgadmin/dashboard/__init__.py
index 8ebab16c..24cc86ef 100644
--- a/web/pgadmin/dashboard/__init__.py
+++ b/web/pgadmin/dashboard/__init__.py
@@ -45,10 +45,7 @@ class DashboardModule(PgAdminModule):
 Returns:
 list: the stylesheets used by this module.
 """
-stylesheets = [
-url_for('dashboard.static', filename='css/dashboard.css')
-]
-return stylesheets
+return []
 
 def get_panels(self):
 return [
diff --git a/web/pgadmin/dashboard/static/css/dashboard.css 
b/web/pgadmin/dashboard/static/css/dashboard.c

Re: [pgAdmin4][Patch][RM_2567] : Default privileges don't show on Properties tab for database.

2017-08-08 Thread Atul Sharma
makes sense. Thanks for the solution.

Please find attached revised patch.

Thanks,
Atul

On Tue, Aug 8, 2017 at 2:12 PM, Murtuza Zabuawala <
murtuza.zabuaw...@enterprisedb.com> wrote:

> Hi Atul,
>
> Better solution to solve this issue is to use self.conn instead of
> creating new conn using did, we already checking for "datallowconn" flag
> in check_precondition decorator.
>
> --
> Regards,
> Murtuza Zabuawala
> EnterpriseDB: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
> [image: https://community.postgresrocks.net/]
> 
>
> On Tue, Aug 8, 2017 at 12:42 PM, Atul Sharma  > wrote:
>
>> ok, Lemme check and I will get back to you.
>>
>> Thanks,
>> Atul
>>
>> On Tue, Aug 8, 2017 at 12:40 PM, Murtuza Zabuawala <
>> murtuza.zabuaw...@enterprisedb.com> wrote:
>>
>>> Hi Atul,
>>>
>>> The given patch breaks RM#1801
>>> .
>>> After applying the patch, Now I'm not able to see the properties of a
>>> database of which "datallowconn" is set to False.
>>>
>>> --
>>> Regards,
>>> Murtuza Zabuawala
>>> EnterpriseDB: http://www.enterprisedb.com
>>> The Enterprise PostgreSQL Company
>>>
>>> [image: https://community.postgresrocks.net/]
>>> 
>>>
>>> On Tue, Aug 8, 2017 at 12:08 PM, Ashesh Vashi <
>>> ashesh.va...@enterprisedb.com> wrote:
>>>
 Murtuza,

 Please review this one.

 --

 Thanks & Regards,

 Ashesh Vashi
 EnterpriseDB INDIA: Enterprise PostgreSQL Company
 


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

 On Tue, Aug 1, 2017 at 3:23 PM, Atul Sharma <
 atul.sha...@enterprisedb.com> wrote:

> Hi,
>
> PFA patch that fixes Default privileges don't show on Properties tab
> for database
>
> Thanks,
> Atul
>


>>>
>>
>


RM_2567_v2.patch
Description: Binary data


Re: [pgAdmin4][PATCH] Refactor and change of implementation of keyboard_shortcuts function dependencies

2017-08-08 Thread Murtuza Zabuawala
Hi Wenlin,

Patch looks good to me.

I'm also attaching minor patch to update document for new keyboard
shortcuts.

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

[image: https://community.postgresrocks.net/]


On Tue, Aug 8, 2017 at 1:41 PM, Wenlin Zhang  wrote:

> Hi Murtuza,
>
>  Thanks for your review.
>
>   We have fixed download bug, you can try it with the new patch
> 1.3_refactor_keyactions.diff, to see if it works.
>   And we also changed the typo in the patch
> 2.1_change_keyboard_shortcuts_for_commenting_and_fix_typo.diff, 
> ('client_plaform'
> -> 'client_platform').
>
> Thanks.
>
> Wenlin & Violet
>
> On Mon, Aug 7, 2017 at 2:30 PM, Murtuza Zabuawala  enterprisedb.com> wrote:
>
>> Hi Sarah,
>>
>> - Download button is not working, getting error on console (attaching
>> screenshot).
>> - While testing the patch I also observed another minor issue, If we
>> click on Explain & Explain analyze buttons, previous messages from Message
>> tab are not getting clear but instead new messages are getting appended to
>> previous ones.
>>
>> And could you please correct a typo introduced by Me from file
>> ../templates/datagrid/index.html, 'client_plaform' -> 'client_platform'
>> in your next patch as you working on it :)
>>
>> Rest of the changes looks good to me.
>>
>> --
>> Regards,
>> Murtuza Zabuawala
>> EnterpriseDB: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>>
>>
>> On Mon, Aug 7, 2017 at 8:09 AM, Sarah McAlear 
>> wrote:
>>
>>> Hi Murtuza,
>>>
>>>  We have rebased and send the new patch.
>>>
>>> Thanks,
>>>
>>> Wenlin and Sarah
>>>
>>> On Fri, Aug 4, 2017 at 8:54 PM, Murtuza Zabuawala <
>>> murtuza.zabuaw...@enterprisedb.com> wrote:
>>>
 Hi Sarah,

 Could you please rebase and send the patch again, I am not able to
 apply any of the patch.

 murtuza@laptop:~/Documents/projects/pgadmin4$ git apply
 ~/Downloads/1_refactor_keyactions.diff
 error: patch failed: web/pgadmin/tools/sqleditor/st
 atic/js/sqleditor.js:552
 error: web/pgadmin/tools/sqleditor/static/js/sqleditor.js: patch does
 not apply
 murtuza@laptop:~/Documents/projects/pgadmin4$ git apply
 ~/Downloads/2_change_keyboard_shortcuts_for_commenting.diff
 error: patch failed: web/pgadmin/static/js/sqledito
 r/keyboard_shortcuts.js:26
 error: web/pgadmin/static/js/sqleditor/keyboard_shortcuts.js: patch
 does not apply
 error: patch failed: web/regression/javascript/sqle
 ditor/keyboard_shortcuts_spec.js:181
 error: web/regression/javascript/sqleditor/keyboard_shortcuts_spec.js:
 patch does not apply


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

 [image: https://community.postgresrocks.net/]
 

 On Fri, Aug 4, 2017 at 5:37 PM, Ashesh Vashi <
 ashesh.va...@enterprisedb.com> wrote:

> Murtuza,
>
> On Thu, Aug 3, 2017 at 3:38 PM, Sarah McAlear 
> wrote:
>
>> Hi Hackers!
>>
>> Attached is a patch that extracts the functions called by the
>> keyboard_shortcuts function extracted earlier from sqlEditor. This
>> includes
>>
>>- executeQuery
>>- explainAnalyze
>>- explain
>>- download
>>- commentBlockCode
>>- commentLineCode
>>- uncommentLineCode
>>
>>
>> There is still more work to be done, but this is it for now.
>>
>> There is also an additional patch that changes the implementation of
>> the commentLineCode, uncommentLineCode, and commentBlockCode functions. 
>> The
>> shortcut
>>
>>- for commentLineCode is now  cmd + / (ctrl + / for Windows)
>>- for uncommentLineCode cmd + . (ctrl + . for Windows)
>>- for comment and uncomment blockCode shift + cmd + / (shift +
>>ctrl + / for Windows)
>>
>> This is consistent with other IDEs and the way commenting is
>> implemented.
>>
> Please review it, and let us know your comments.
>
> --
>
> Thanks & Regards,
>
> Ashesh Vashi
> EnterpriseDB INDIA: Enterprise PostgreSQL Company
> 
>
>
> *http://www.linkedin.com/in/asheshvashi*
> 
>
>>
>> Thanks!
>> Hao & Sarah
>>
>
>

>>>
>>
>
diff --git a/docs/en_US/keyboard_shortcuts.rst 
b/docs/en_US/keyboard_shortcuts.rst
index 8604395..3129e77 100644
--- a/docs/en_US/keyboard_shortcuts.rst
+++ b/docs/en_US/keyboard_shortcuts.rst
@@ -41,11 +41,11 @@ When using the syntax-highlighting SQL editors, the 
following shortcuts are avai
 
+--+--+-+
 | Ctrl+Alt+Right   | Cmd+Option+Right | Mov

Re: [pgAdmin4][Patch][RM_2567] : Default privileges don't show on Properties tab for database.

2017-08-08 Thread Murtuza Zabuawala
Patch looks good to me.

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

[image: https://community.postgresrocks.net/]


On Tue, Aug 8, 2017 at 3:25 PM, Atul Sharma 
wrote:

> makes sense. Thanks for the solution.
>
> Please find attached revised patch.
>
> Thanks,
> Atul
>
> On Tue, Aug 8, 2017 at 2:12 PM, Murtuza Zabuawala  enterprisedb.com> wrote:
>
>> Hi Atul,
>>
>> Better solution to solve this issue is to use self.conn instead of
>> creating new conn using did, we already checking for "datallowconn" flag
>> in check_precondition decorator.
>>
>> --
>> Regards,
>> Murtuza Zabuawala
>> EnterpriseDB: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>>
>> [image: https://community.postgresrocks.net/]
>> 
>>
>> On Tue, Aug 8, 2017 at 12:42 PM, Atul Sharma <
>> atul.sha...@enterprisedb.com> wrote:
>>
>>> ok, Lemme check and I will get back to you.
>>>
>>> Thanks,
>>> Atul
>>>
>>> On Tue, Aug 8, 2017 at 12:40 PM, Murtuza Zabuawala <
>>> murtuza.zabuaw...@enterprisedb.com> wrote:
>>>
 Hi Atul,

 The given patch breaks RM#1801
 .
 After applying the patch, Now I'm not able to see the properties of a
 database of which "datallowconn" is set to False.

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

 [image: https://community.postgresrocks.net/]
 

 On Tue, Aug 8, 2017 at 12:08 PM, Ashesh Vashi <
 ashesh.va...@enterprisedb.com> wrote:

> Murtuza,
>
> Please review this one.
>
> --
>
> Thanks & Regards,
>
> Ashesh Vashi
> EnterpriseDB INDIA: Enterprise PostgreSQL Company
> 
>
>
> *http://www.linkedin.com/in/asheshvashi*
> 
>
> On Tue, Aug 1, 2017 at 3:23 PM, Atul Sharma <
> atul.sha...@enterprisedb.com> wrote:
>
>> Hi,
>>
>> PFA patch that fixes Default privileges don't show on Properties tab
>> for database
>>
>> Thanks,
>> Atul
>>
>
>

>>>
>>
>


Re: Unified server/desktop config

2017-08-08 Thread Surinder Kumar
On Tue, Aug 8, 2017 at 1:47 PM, Dave Page  wrote:


>
> On Tue, Aug 8, 2017 at 7:18 AM, Surinder Kumar <
> surinder.ku...@enterprisedb.com> wrote:
>
>> Hi
>>
>> On Ubuntu-14.04, I got error Application Server couldn't be contacted:
>>
>> *Steps performed:*
>>
>>- I have already installed pgAdmin4-1.4 which come with
>>PostgreSQL-9.6 installer.
>>then I run root@ubuntu:/opt/PostgreSQL/9.6/pgAdmin 4/bin# ./pgAdmin4./
>>.
>>- Now took latest git pull from HEAD
>>- Apply unified_config.diff patch.
>>- Then compiled pgAdmin4 in runtime and then run ./pgAdmin.
>>- Got error Application Server couldn't be contacted.
>>
>> But when I ran ./pgAdmin4 for the second time. pgAdmin4 runs without any
>> issue.
>> I didn’t get any error on the terminal and log file.
>> ​ I couldn't find why it gives this error.​
>>
>
> I know Fahar has run into this with existing releases on Ubuntu. If you
> enable debugging, can you see any clues? I assume it's going round the
> retry loop before aborting?
>
>> *Another issue related to Alembic:*
>>
>> If I am running pgAdmin4 already installed on my machine, then I upgrade
>> pgAdmin4 using Python wheel:
>>
>> (test_p27) surinder@ubuntu:~/virtualenvs/test_p27$ python
>> ~/virtualenvs/test_p27/lib/python2.7/site-packages/pgadmin4/pgAdmin4.py
>>
>> *I am getting error:*
>>
>> alembic.util.exc.CommandError: Can't locate revision identified by
>> 'd85a62333272'
>>
>> To fix this, I have to delete existing pgadmin4.db file. I don’t know if
>> it is a valid case or should I log an RM if it is?
>>
> That's an annoying side-effect of the move to Alembic. The previous DB
> code would quite happily (and intentionally) run with a newer version of
> the database, however, the new code does not. You'll see this issue
> whenever you've run a newer version of pgAdmin and then go back to an older
> version that uses an older schema version.
>
> It would be nice to change this so it doesn't complain - but we'd have to
> be cautious to only break compatibility on major releases.
>
>
>
>> Apart for this, I didn’t see any functionality break. It works!!
>> ​
>>
>> I liked the approach to set SEVER_MODE in runtime using built-ins.
>>
> Thanks. Do you think it warrants a 2.0 version number, given the potential
> for breaking existing installations (I do, but would like other feedback)?
> If we do that - and thus allow a parallel installation of 1.x and 2.x), how
> would we resolve the Alembic issue you noted such that both versions could
> be run against the same DB?
>
To resolve this issue while upgrading to newer version of pgAdmin4, we can
add a parameter version_table: 'alembic_version-1.6 in web/migrations/env.py
of upcoming pgAdmin4 source code(reference link

)
It will create a new version table in pgadmin4.db database and it will
instruct the Alembic to run migrations for the version stored in
table(alembic_version-1.6) when new pgAdmin4 will be installed.

I tried to check if it works or not. But somehow I couldn’t install
pgAdmin4-1.5 from wheel.

Alternatively I will try to generate new schema using in pgAdmin4 source
code(Git HEAD). It will generate a new migration version and then i will
run pgAdmin4-1.6 from wheel having different migration number. It will
create pgadmin4.db for 1.5.
Then
 I will run pgAdmin4-1.6 from source code, so migration will take place and
hopefully
​the ​
sa
me
​ ​
pgadmin4.db will work for newer pgAdmin4 version.

Reference link 
where the same issue has been discussed.

Thanks,
Surinder


>
>
>> Thanks,
>> Surinder
>> ​
>>
>> On Mon, Aug 7, 2017 at 7:01 PM, Dave Page  wrote:
>>
>>>
>>>
>>> On Mon, Aug 7, 2017 at 1:43 PM, Surinder Kumar <
>>> surinder.ku...@enterprisedb.com> wrote:
>>>
 Hi,

 The patch seems to work in Runtime mode, but fails in Server mode with
 error:

 (pgAdmin_27)Laptop195:pgadmin4 surinder$ python web/pgAdmin4.py
 Traceback (most recent call last):
   File "web/pgAdmin4.py", line 55, in 
 exec(open(file_quote(setupfile), 'r').read())
   File "", line 35, in 
   File 
 "/Users/surinder/Documents/Projects/pgadmin4/web/pgadmin/setup/data_directory.py",
  line 23, in create_app_data_directory
 _create_directory_if_not_exists(os.path.dirname(config.SQLITE_PATH))
   File 
 "/Users/surinder/Documents/Projects/pgadmin4/web/pgadmin/setup/data_directory.py",
  line 15, in _create_directory_if_not_exists
 os.mkdir(_path)
 OSError: [Errno 13] Permission denied: '/var/lib/pgadmin'
 (pgAdmin_27)Laptop195:pgadmin4 surinder$

 This is because the directory /var/lib/ has root only access and I am
 running pgAdmin4 with the non-root user.

 Also pgadmin directory is not created.

 (pgAdmin_35)Laptop195:pgadmin4 surinder$ ls /var/lib/pgadmin
 ls: /var/lib/pgadmin

Re: [gpAdmin4][patch] query history updates

2017-08-08 Thread Khushboo Vashi
Hi Wenlin & Violet,


On Tue, Aug 8, 2017 at 12:05 PM, Wenlin Zhang  wrote:

> Hi Khushboo,
>
>  Thanks for your review.
>
>  About the copy/paste function bug, we just found that this is an
> existing bug in master. Except for the query History tab, this bug also
> exist in the query data output . If you copy the data row in "Data Output"
> tab,  it works fine, but the copy/paste in query tool won't work either. We
> will create a Redmine bug later.
>
>  And the feature test failure, we've already sent a new patch that
> fixed it. See this patch
> 
>
> I need to test this patch with the history tab update patch. Right now I
can not apply this patch on top of the history update patch.
Can you please re-base that patch?

> Thanks,
>
> Wenlin & Violet
>
>
> On Mon, Aug 7, 2017 at 1:45 PM, Khushboo Vashi <
> khushboo.va...@enterprisedb.com> wrote:
>
>> Hi Sarah & Hao,
>>
>> The copy/paste functionality through the added copy button is working
>> fine, however once I copy the query text from the History tab through the
>> copy button, I can not perform copy/paste for some another text in the
>> Query tool.
>>
>> Also, the feature test (QueryToolJourneyTest) is failing, please refer
>> the attached screen-shot.
>>
>> Thanks,
>> Khushboo
>>
>> On Thu, Aug 3, 2017 at 9:03 AM, Hao Wang  wrote:
>>
>>> Hi Hackers,
>>>
>>> Here is a patch for query tools history UX improvements:
>>>
>>>- Add copy button for query text
>>>- Historical queries are binned by day
>>>
>>> Thanks,
>>> Sarah & Hao
>>>
>>
>>
>
Thanks,
Khushboo


Re: Unified server/desktop config

2017-08-08 Thread Dave Page
On Tue, Aug 8, 2017 at 11:27 AM, Surinder Kumar <
surinder.ku...@enterprisedb.com> wrote:

> On Tue, Aug 8, 2017 at 1:47 PM, Dave Page  wrote:
>
>
>>
>> On Tue, Aug 8, 2017 at 7:18 AM, Surinder Kumar <
>> surinder.ku...@enterprisedb.com> wrote:
>>
>>> Hi
>>>
>>> On Ubuntu-14.04, I got error Application Server couldn't be contacted:
>>>
>>> *Steps performed:*
>>>
>>>- I have already installed pgAdmin4-1.4 which come with
>>>PostgreSQL-9.6 installer.
>>>then I run root@ubuntu:/opt/PostgreSQL/9.6/pgAdmin 4/bin#
>>>./pgAdmin4./.
>>>- Now took latest git pull from HEAD
>>>- Apply unified_config.diff patch.
>>>- Then compiled pgAdmin4 in runtime and then run ./pgAdmin.
>>>- Got error Application Server couldn't be contacted.
>>>
>>> But when I ran ./pgAdmin4 for the second time. pgAdmin4 runs without
>>> any issue.
>>> I didn’t get any error on the terminal and log file.
>>> ​ I couldn't find why it gives this error.​
>>>
>>
>> I know Fahar has run into this with existing releases on Ubuntu. If you
>> enable debugging, can you see any clues? I assume it's going round the
>> retry loop before aborting?
>>
>>> *Another issue related to Alembic:*
>>>
>>> If I am running pgAdmin4 already installed on my machine, then I upgrade
>>> pgAdmin4 using Python wheel:
>>>
>>> (test_p27) surinder@ubuntu:~/virtualenvs/test_p27$ python
>>> ~/virtualenvs/test_p27/lib/python2.7/site-packages/pgadmin4/pgAdmin4.py
>>>
>>> *I am getting error:*
>>>
>>> alembic.util.exc.CommandError: Can't locate revision identified by
>>> 'd85a62333272'
>>>
>>> To fix this, I have to delete existing pgadmin4.db file. I don’t know
>>> if it is a valid case or should I log an RM if it is?
>>>
>> That's an annoying side-effect of the move to Alembic. The previous DB
>> code would quite happily (and intentionally) run with a newer version of
>> the database, however, the new code does not. You'll see this issue
>> whenever you've run a newer version of pgAdmin and then go back to an older
>> version that uses an older schema version.
>>
>> It would be nice to change this so it doesn't complain - but we'd have to
>> be cautious to only break compatibility on major releases.
>>
>>
>>
>>> Apart for this, I didn’t see any functionality break. It works!!
>>> ​
>>>
>>> I liked the approach to set SEVER_MODE in runtime using built-ins.
>>>
>> Thanks. Do you think it warrants a 2.0 version number, given the
>> potential for breaking existing installations (I do, but would like other
>> feedback)? If we do that - and thus allow a parallel installation of 1.x
>> and 2.x), how would we resolve the Alembic issue you noted such that both
>> versions could be run against the same DB?
>>
> To resolve this issue while upgrading to newer version of pgAdmin4, we can
> add a parameter version_table: 'alembic_version-1.6 in
> web/migrations/env.py of upcoming pgAdmin4 source code(reference link
> 
> )
> It will create a new version table in pgadmin4.db database and it will
> instruct the Alembic to run migrations for the version stored in
> table(alembic_version-1.6) when new pgAdmin4 will be installed.
>
> I tried to check if it works or not. But somehow I couldn’t install
> pgAdmin4-1.5 from wheel.
>
> Alternatively I will try to generate new schema using in pgAdmin4 source
> code(Git HEAD). It will generate a new migration version and then i will
> run pgAdmin4-1.6 from wheel having different migration number. It will
> create pgadmin4.db for 1.5.
> Then
>  I will run pgAdmin4-1.6 from source code, so migration will take place
> and hopefully
> ​the ​
> sa
> me
> ​ ​
> pgadmin4.db will work for newer pgAdmin4 version.
>
> Reference link 
> where the same issue has been discussed.
>

Sounds good - please investigate further.

Thanks!


> Thanks,
> Surinder
>
>
>>
>>
>>> Thanks,
>>> Surinder
>>> ​
>>>
>>> On Mon, Aug 7, 2017 at 7:01 PM, Dave Page  wrote:
>>>


 On Mon, Aug 7, 2017 at 1:43 PM, Surinder Kumar <
 surinder.ku...@enterprisedb.com> wrote:

> Hi,
>
> The patch seems to work in Runtime mode, but fails in Server mode with
> error:
>
> (pgAdmin_27)Laptop195:pgadmin4 surinder$ python web/pgAdmin4.py
> Traceback (most recent call last):
>   File "web/pgAdmin4.py", line 55, in 
> exec(open(file_quote(setupfile), 'r').read())
>   File "", line 35, in 
>   File 
> "/Users/surinder/Documents/Projects/pgadmin4/web/pgadmin/setup/data_directory.py",
>  line 23, in create_app_data_directory
> _create_directory_if_not_exists(os.path.dirname(config.SQLITE_PATH))
>   File 
> "/Users/surinder/Documents/Projects/pgadmin4/web/pgadmin/setup/data_directory.py",
>  line 15, in _create_directory_if_not_exists
> os.mkdir(_path)
> OSError: [Errno 13] Permission denied: '/var/lib/pgadmin'
> (pgAdm

Re: Can someone tell me what this code does ?

2017-08-08 Thread Dave Cramer
Hi,

I guess my question was a bit vague. I get that it loads drivers. But note
it does not actually put them anywhere.

First it creates a dict
sets the attribute in the app
loads the drivers dynamically
and returns an empty dict.

>From what I can tell this:

DriverRegistry.load_drivers()

is all it does?






Dave Cramer

On 7 August 2017 at 23:35, Murtuza Zabuawala <
murtuza.zabuaw...@enterprisedb.com> wrote:

> Hi,
>
> This piece of code allow us to dynamically import all the available driver
> modules from '../utils/driver/' directory into our application.
>
> --
> Regards,
> Murtuza Zabuawala
> EnterpriseDB: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
> [image: https://community.postgresrocks.net/]
> 
>
> On Tue, Aug 8, 2017 at 4:20 AM, Dave Cramer  wrote:
>
>> I'm fairly new to Python so excuse my naiveté.
>>
>> This code: in web/pgadmin/utils/driver/__init__.py  does not appear to
>> load the drivers into the drivers dictionary ? Or am I missing something
>>
>> def init_app(app):
>> drivers = dict()
>>
>> setattr(app, '_pgadmin_server_drivers', drivers)
>> DriverRegistry.load_drivers()
>>
>> return drivers
>>
>>
>>
>> Dave Cramer
>>
>
>


Re: [pgAdmin4][Patch]: Allow user to cancel long running queries from dashboard

2017-08-08 Thread Shirley Wang
Nice! 

Would a DBA need to click on the drop down to expand? I think that drop down 
icon might be too small. Perhaps the whole row could be a clickable area to 
show further details. This is a good thing to test with some people


> On Aug 8, 2017, at 12:52, Ashesh Vashi  wrote:
> 
>> On Mon, Aug 7, 2017 at 9:06 PM, Dave Page  wrote:
>> 
>> 
>>> On Mon, Aug 7, 2017 at 3:49 PM, Chethana Kumar 
>>>  wrote:
>>> Hi Dave,
>>> 
>>> Could you comment on the new design update for subnode control ?
>>> 
>>> Attached designs -
>>> 
>>> 1. subnode_current.png -  The existing view
>>> 2. subnode_new.png - The updated view
>>> 3. current_new.png - Existing and new design placed together for comparison 
>>> purpose
>>> 
>>> Below changes done -
>>> 
>>> 1. Reduced number of gray color variations
>>> 2. Made more simplified by removing unwanted borders
>>> 3. Merged "Arrow Down" background and the body background for more clarity
>>> 
>>> Please feel free to provide your input on the same.
>> 
>> Much nicer in my opinion! Good work.
>> 
>> Anyone else have any comments?
> It looks much nicer.
> I would like to see the effect on another dialogs like 'Table properties', 
> where we have multiple level of subgrid controls with tabs.
> 
> -- Thanks, Ashesh 
>>  
>>> 
>>> Regards,
>>> Chethana kumar
>>> 
>>> 
>>> 
 On Fri, Jul 28, 2017 at 4:11 PM, Dave Page  wrote:
 Hi
 
 I took a quick look at this and have a couple of thoughts:
 
 - Instead of the "edit" icon to open the subnode, we should use something 
 more appropriate - a "properties" icon perhaps.
 
 - There seems to be a lot of different shades of grey on there (maybe a 
 subnode design in general that just shows up with the disabled controls), 
 and the subnode control looks a bit messy as a result.
 
 Can you work with Chethana to improve the look and feel please?
 
 Input from others welcome of course - screenshot attached.
 
 Thanks.
 
> On Fri, Jul 28, 2017 at 11:33 AM, Murtuza Zabuawala 
>  wrote:
> ++ Attaching the patch
> 
> --
> Regards,
> Murtuza Zabuawala
> EnterpriseDB: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
> 
>> On Fri, Jul 28, 2017 at 4:02 PM, Murtuza Zabuawala 
>>  wrote:
>> Hi Dave,
>> 
>> PFA patch to display additional information from pg_stat_activity table 
>> using subnode control.
>> RM#2597
>> 
>> Please review.
>> 
>> --
>> Regards,
>> Murtuza Zabuawala
>> EnterpriseDB: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>> 
>> On Tue, Jul 25, 2017 at 10:56 AM, Shirley Wang  wrote:
 
 On Mon, Jul 24, 2017 at 8:11 PM, Dave Page  wrote:
> 
> 
>> On Mon, Jul 24, 2017 at 3:28 PM, Shirley Wang  
>> wrote:
>> 2-3 days is a lot of valuable engineering time. Is this a 'drop 
>> everything now' kind of feature or can this wait for some user 
>> validation on a mock up first? 
> 
> Most of the time will likely be on the infrastructure to change the 
> display to a subnode control. If you have some cycles to mockup 
> potential layouts for the subnode view and have them validated, 
> please feel free, however, that seems like an awful lot of work to me 
> to display some missing SQL using a standard control.
 
 Regarding SQL display: Developing simple control to show codemirror in 
 disabled state (for now) wont take that much time.
  
>>> Part of a product designer's job is to make sure there is a definitive 
>>> need for a feature and that the interface for the feature is designed 
>>> in such a way that the user gets all intended value from it. Time spent 
>>> validating now will decrease the time spent later on redesigning / 
>>> reimplementing.
>>> 
>>> If everyone is aware of what that value is and confident that how it'll 
>>> be displayed is right, there's little risk in starting to develop it. 
>>> If we're wrong, it'll add to feature bloat and detract from the 
>>> experience.
>>> 
>>> Would Chethana be able to take on some of the design work? It would be 
>>> valuable for the dev team to also be part of design process.
>> 
> 
 
 
 
 -- 
 Dave Page
 Blog: http://pgsnake.blogspot.com
 Twitter: @pgsnake
 
 EnterpriseDB UK: http://www.enterprisedb.com
 The Enterprise PostgreSQL Company
>>> 
>>> 
>>> 
>>> -- 
>>> Chethana Kumar
>>> Principal UI/UX Designer
>>> EnterpriseDB Corporation
>>> 
>>> 
>>> The Postgres Database Company
>>> 
>>> P: +91 86981 57146
>>> www.enterprisedb.com
>> 
>> 
>> 
>> 
>> -- 
>> Dave Page
>> Blog: http://pgsnake.blogspot.com
>> Twitter: @pgsnake
>> 
>> EnterpriseDB UK: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
> 


Re: [pgAdmin4][PATCH] Refactor and change of implementation of keyboard_shortcuts function dependencies

2017-08-08 Thread Sarah McAlear
Oh, great! Thanks Murtuza!

On Tue, Aug 8, 2017 at 6:16 PM, Murtuza Zabuawala <
murtuza.zabuaw...@enterprisedb.com> wrote:

> Hi Wenlin,
>
> Patch looks good to me.
>
> I'm also attaching minor patch to update document for new keyboard
> shortcuts.
>
> --
> Regards,
> Murtuza Zabuawala
> EnterpriseDB: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
> [image: https://community.postgresrocks.net/]
> 
>
> On Tue, Aug 8, 2017 at 1:41 PM, Wenlin Zhang  wrote:
>
>> Hi Murtuza,
>>
>>  Thanks for your review.
>>
>>   We have fixed download bug, you can try it with the new patch
>> 1.3_refactor_keyactions.diff, to see if it works.
>>   And we also changed the typo in the patch
>> 2.1_change_keyboard_shortcuts_for_commenting_and_fix_typo.diff, 
>> ('client_plaform'
>> -> 'client_platform').
>>
>> Thanks.
>>
>> Wenlin & Violet
>>
>> On Mon, Aug 7, 2017 at 2:30 PM, Murtuza Zabuawala <
>> murtuza.zabuaw...@enterprisedb.com> wrote:
>>
>>> Hi Sarah,
>>>
>>> - Download button is not working, getting error on console (attaching
>>> screenshot).
>>> - While testing the patch I also observed another minor issue, If we
>>> click on Explain & Explain analyze buttons, previous messages from Message
>>> tab are not getting clear but instead new messages are getting appended to
>>> previous ones.
>>>
>>> And could you please correct a typo introduced by Me from file
>>> ../templates/datagrid/index.html, 'client_plaform' -> 'client_platform'
>>> in your next patch as you working on it :)
>>>
>>> Rest of the changes looks good to me.
>>>
>>> --
>>> Regards,
>>> Murtuza Zabuawala
>>> EnterpriseDB: http://www.enterprisedb.com
>>> The Enterprise PostgreSQL Company
>>>
>>>
>>> On Mon, Aug 7, 2017 at 8:09 AM, Sarah McAlear 
>>> wrote:
>>>
 Hi Murtuza,

  We have rebased and send the new patch.

 Thanks,

 Wenlin and Sarah

 On Fri, Aug 4, 2017 at 8:54 PM, Murtuza Zabuawala <
 murtuza.zabuaw...@enterprisedb.com> wrote:

> Hi Sarah,
>
> Could you please rebase and send the patch again, I am not able to
> apply any of the patch.
>
> murtuza@laptop:~/Documents/projects/pgadmin4$ git apply
> ~/Downloads/1_refactor_keyactions.diff
> error: patch failed: web/pgadmin/tools/sqleditor/st
> atic/js/sqleditor.js:552
> error: web/pgadmin/tools/sqleditor/static/js/sqleditor.js: patch does
> not apply
> murtuza@laptop:~/Documents/projects/pgadmin4$ git apply
> ~/Downloads/2_change_keyboard_shortcuts_for_commenting.diff
> error: patch failed: web/pgadmin/static/js/sqledito
> r/keyboard_shortcuts.js:26
> error: web/pgadmin/static/js/sqleditor/keyboard_shortcuts.js: patch
> does not apply
> error: patch failed: web/regression/javascript/sqle
> ditor/keyboard_shortcuts_spec.js:181
> error: web/regression/javascript/sqleditor/keyboard_shortcuts_spec.js:
> patch does not apply
>
>
> --
> Regards,
> Murtuza Zabuawala
> EnterpriseDB: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
> [image: https://community.postgresrocks.net/]
> 
>
> On Fri, Aug 4, 2017 at 5:37 PM, Ashesh Vashi <
> ashesh.va...@enterprisedb.com> wrote:
>
>> Murtuza,
>>
>> On Thu, Aug 3, 2017 at 3:38 PM, Sarah McAlear 
>> wrote:
>>
>>> Hi Hackers!
>>>
>>> Attached is a patch that extracts the functions called by the
>>> keyboard_shortcuts function extracted earlier from sqlEditor. This
>>> includes
>>>
>>>- executeQuery
>>>- explainAnalyze
>>>- explain
>>>- download
>>>- commentBlockCode
>>>- commentLineCode
>>>- uncommentLineCode
>>>
>>>
>>> There is still more work to be done, but this is it for now.
>>>
>>> There is also an additional patch that changes the implementation of
>>> the commentLineCode, uncommentLineCode, and commentBlockCode functions. 
>>> The
>>> shortcut
>>>
>>>- for commentLineCode is now  cmd + / (ctrl + / for Windows)
>>>- for uncommentLineCode cmd + . (ctrl + . for Windows)
>>>- for comment and uncomment blockCode shift + cmd + / (shift +
>>>ctrl + / for Windows)
>>>
>>> This is consistent with other IDEs and the way commenting is
>>> implemented.
>>>
>> Please review it, and let us know your comments.
>>
>> --
>>
>> Thanks & Regards,
>>
>> Ashesh Vashi
>> EnterpriseDB INDIA: Enterprise PostgreSQL Company
>> 
>>
>>
>> *http://www.linkedin.com/in/asheshvashi*
>> 
>>
>>>
>>> Thanks!
>>> Hao & Sarah
>>>
>>
>>
>

>>>
>>
>


Re: [pgAdmin4[Patch][Webpacking]: Enable source maps in pgAdmin4 for development environment

2017-08-08 Thread Wenlin Zhang
Hi Surinder,

This is great and useful. Looks good to me. Hope this can be committed
ASAP.

Thanks,

Wenlin & Violet



On Wed, Aug 2, 2017 at 9:41 PM, Surinder Kumar <
surinder.ku...@enterprisedb.com> wrote:

> Hi All,
>
> This patch enables source maps in pgAdmin4 for development environment.
>
> On running yarn run bundle It will create source maps(i.e. extract each
> module js file so that it is available to debug).
>
> You can search each module(ie. menu.js to debug) file by filename as
> follows:
>
>1.
>
>Start pgAdmin4 server or run separately yarn run bundle in pgadmin/web
>2.
>
>Open pgAdmin4 in browser(I am using chrome). Click sources panel and
>press CMD+P and search for file menu.js. Click and then add breakpoint
>to the line where you want to debug codebase. Screenshot attached for
>reference.
>
> I have excluded vendor and codemirror bundle from source map as i believe
> we don’t debug these files. If someone needs, they can remove vendor.js
> from source map plugin and rebuild.
>
> I didn’t add this for production mode yet.
>
> Reference to SourceMapDevToolPlugin
> 
>
> Please find attached patch and review.
>
> Thanks,
> Surinder
> ​
>


Re: [pgAdmin4][Patch]: Use the correct resultset type for Type module

2017-08-08 Thread Ashesh Vashi
On Thu, Aug 3, 2017 at 2:41 PM, Murtuza Zabuawala <
murtuza.zabuaw...@enterprisedb.com> wrote:

> Hi,
>
> PFA minor patch to use fetch dict based data instead of 2d-array based in
> Type module as we are adding keys on the fly.
> There is no RM just a minor enhancement.
>
Harshal,

Please review this one.

--

Thanks & Regards,

Ashesh Vashi
EnterpriseDB INDIA: Enterprise PostgreSQL Company



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


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


Re: [gpAdmin4][patch] query history updates

2017-08-08 Thread Sarah McAlear
Hi Khushboo!

These are 2 separate patches. The failure of the feature test you're
describing happens on Master even without this patch. The other patch fixes
this, but is unrelated to this patch. Right now it applies cleanly on
Master. If we rebase it here, we won't be able to apply it on master.

Thanks,
Sarah

On Tue, Aug 8, 2017 at 6:27 PM, Khushboo Vashi <
khushboo.va...@enterprisedb.com> wrote:

> Hi Wenlin & Violet,
>
>
> On Tue, Aug 8, 2017 at 12:05 PM, Wenlin Zhang  wrote:
>
>> Hi Khushboo,
>>
>>  Thanks for your review.
>>
>>  About the copy/paste function bug, we just found that this is an
>> existing bug in master. Except for the query History tab, this bug also
>> exist in the query data output . If you copy the data row in "Data Output"
>> tab,  it works fine, but the copy/paste in query tool won't work either. We
>> will create a Redmine bug later.
>>
>>  And the feature test failure, we've already sent a new patch that
>> fixed it. See this patch
>> 
>>
>> I need to test this patch with the history tab update patch. Right now I
> can not apply this patch on top of the history update patch.
> Can you please re-base that patch?
>
>> Thanks,
>>
>> Wenlin & Violet
>>
>>
>> On Mon, Aug 7, 2017 at 1:45 PM, Khushboo Vashi <
>> khushboo.va...@enterprisedb.com> wrote:
>>
>>> Hi Sarah & Hao,
>>>
>>> The copy/paste functionality through the added copy button is working
>>> fine, however once I copy the query text from the History tab through the
>>> copy button, I can not perform copy/paste for some another text in the
>>> Query tool.
>>>
>>> Also, the feature test (QueryToolJourneyTest) is failing, please refer
>>> the attached screen-shot.
>>>
>>> Thanks,
>>> Khushboo
>>>
>>> On Thu, Aug 3, 2017 at 9:03 AM, Hao Wang  wrote:
>>>
 Hi Hackers,

 Here is a patch for query tools history UX improvements:

- Add copy button for query text
- Historical queries are binned by day

 Thanks,
 Sarah & Hao

>>>
>>>
>>
> Thanks,
> Khushboo
>


Re: [pgAdmin4][patch] Fix feature tests failure

2017-08-08 Thread Sarah McAlear
Hi Hackers!

Could someone review this patch, please?

Thanks so much!
Sarah

On Mon, Aug 7, 2017 at 4:42 PM, Wenlin Zhang  wrote:

> Hi Hackers,
>
> This patch is about fixing the feature tests failure.
>
> Thanks,
> Wenlin, Violet & Hao
>


Re: [pgAdmin4][patch] Fix feature tests failure

2017-08-08 Thread Khushboo Vashi
Hi Sarah,

I am doing this and didn't reply on this thread as we are discussing this
on the another thread (the History Update patch).

Thanks,
Khushboo

On Wed, Aug 9, 2017 at 9:10 AM, Sarah McAlear  wrote:

> Hi Hackers!
>
> Could someone review this patch, please?
>
> Thanks so much!
> Sarah
>
> On Mon, Aug 7, 2017 at 4:42 PM, Wenlin Zhang  wrote:
>
>> Hi Hackers,
>>
>> This patch is about fixing the feature tests failure.
>>
>> Thanks,
>> Wenlin, Violet & Hao
>>
>
>


[pgadmin4][Patch] Greenplum specific DDL and Dashboard display

2017-08-08 Thread Sarah McAlear
Hi Hackers!

This patch enables Greenplum users to see the same charts on the dashboard
as postgres users. It also adds some additional information to the DDL that
is Greenplum specific and necessary to create a new table.

Thanks!
Sarah
diff --git 
a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/__init__.py
 
b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/__init__.py
index e22e54cf..76f2b2d3 100644
--- 
a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/__init__.py
+++ 
b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/__init__.py
@@ -1216,8 +1216,13 @@ class TableView(BaseTableView, DataTypeReader, 
VacuumSettings):
 """
 main_sql = []
 
+if self.manager.gpdbversion != 0:
+template_path = 'table/sql/#{0}#'.format(self.manager.gpdbversion)
+else:
+template_path = self.table_template_path
+
 SQL = render_template(
-"/".join([self.table_template_path, 'properties.sql']),
+"/".join([template_path, 'properties.sql']),
 did=did, scid=scid, tid=tid,
 datlastsysoid=self.datlastsysoid
 )
diff --git 
a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/table/sql/gpdb_5.0_plus/create.sql
 
b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/table/sql/gpdb_5.0_plus/create.sql
new file mode 100644
index ..9bcfd598
--- /dev/null
+++ 
b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/table/sql/gpdb_5.0_plus/create.sql
@@ -0,0 +1,168 @@
+{% import 'macros/schemas/security.macros' as SECLABEL %}
+{% import 'macros/schemas/privilege.macros' as PRIVILEGE %}
+{% import 'macros/variable.macros' as VARIABLE %}
+{% import 'column/macros/security.macros' as COLUMN_SECLABEL %}
+{% import 'column/macros/privilege.macros' as COLUMN_PRIVILEGE %}
+{% import 'table/sql/macros/constraints.macro' as CONSTRAINTS %}
+{% import 'type/macros/get_full_type_sql_format.macros' as GET_TYPE %}
+{#===#}
+{#== MAIN TABLE TEMPLATE STARTS HERE ==#}
+{#===#}
+{#
+ If user has not provided any details but only name then
+ add empty bracket with table name
+#}
+{% set empty_bracket = ""%}
+{% if data.coll_inherits|length == 0 and  data.columns|length == 0 and not 
data.typname and not data.like_relation and data.primary_key|length == 0 and 
data.unique_constraint|length == 0 and data.foreign_key|length == 0 and 
data.check_constraint|length == 0 and data.exclude_constraint|length == 0 %}
+{% set empty_bracket = "\n(\n)"%}
+{% endif %}
+CREATE {% if data.relpersistence %}UNLOGGED {% endif %}TABLE 
{{conn|qtIdent(data.schema, data.name)}}{{empty_bracket}}
+{% if data.typname %}
+OF {{ data.typname }}
+{% endif %}
+{% if data.like_relation or data.coll_inherits or data.columns|length > 0 or 
data.primary_key|length > 0 or data.unique_constraint|length > 0 or 
data.foreign_key|length > 0 or data.check_constraint|length > 0 or 
data.exclude_constraint|length > 0 %}
+(
+{% endif %}
+{% if data.like_relation %}
+LIKE {{ data.like_relation }}{% if data.like_default_value %}
+
+INCLUDING DEFAULTS{% endif %}{% if data.like_constraints %}
+
+INCLUDING CONSTRAINTS{% endif %}{% if data.like_indexes %}
+
+INCLUDING INDEXES{% endif %}{% if data.like_storage %}
+
+INCLUDING STORAGE{% endif %}{% if data.like_comments %}
+
+INCLUDING COMMENTS{% endif %}{% if data.columns|length > 0 %},
+{% endif %}
+
+{% endif %}
+{### Add columns ###}
+{% if data.columns and data.columns|length > 0 %}
+{% for c in data.columns %}
+{% if c.name and c.cltype %}
+{% if loop.index != 1 %},
+{% endif %}
+{{conn|qtIdent(c.name)}} {% if is_sql %}{{c.displaytypname}}{% else %}{{ 
GET_TYPE.CREATE_TYPE_SQL(conn, c.cltype, c.attlen, c.attprecision, 
c.hasSqrBracket) }}{% endif %}{% if c.collspcname %} COLLATE 
{{c.collspcname}}{% endif %}{% if c.attnotnull %} NOT NULL{% endif %}{% if 
c.defval %} DEFAULT {{c.defval}}{% endif %}
+{% endif %}
+{% endfor %}
+{% endif %}
+{# Macro to render for constraints #}
+{% if data.primary_key|length > 0 %}{% if data.columns|length > 0 %},{% endif 
%}
+{{CONSTRAINTS.PRIMARY_KEY(conn, data.primary_key[0])}}{% endif %}{% if 
data.unique_constraint|length > 0 %}{% if data.columns|length > 0 or 
data.primary_key|length > 0 %},{% endif %}
+{{CONSTRAINTS.UNIQUE(conn, data.unique_constraint)}}{% endif %}{% if 
data.foreign_key|length > 0 %}{% if data.columns|length > 0 or 
data.primary_key|length > 0 or data.unique_constraint|length > 0 %},{% endif %}
+{{CONSTRAINTS.FOREIGN_KEY(conn, data.foreign_key)}}{% endif %}{% if 
data.check_constraint|length > 0 %}{% if data.columns|length > 0 or 
data.primary_key|length > 0 or data.unique_constraint|length > 0 or 
data.foreign_key|length > 0 %},{% endif %}
+{{CONSTRAINTS.CHECK(conn, data.check_constraint

Re: Unified server/desktop config

2017-08-08 Thread Surinder Kumar
Hi,

I noticed that test cases don’t run and I got an error:

(pgAdmin_27)Laptop195:regression surinder$ python runtests.py --pkg
feature_tests

Traceback (most recent call last):
  File "runtests.py", line 45, in 
import config
  File "/Users/surinder/Documents/Projects/pgadmin4/web/config.py",
line 121, in 
if builtins.SERVER_MODE is None:
AttributeError: 'module' object has no attribute'
SERVER_MODE
'

I think this is because we are setting​ ​first​ ​builtins.SERVER_MODE​
in​ ​pgAdmin4.py
but in test cases pgAdmin4.py is not being called.​


On Tue, Aug 8, 2017 at 4:03 PM, Dave Page  wrote:

>
>
> On Tue, Aug 8, 2017 at 11:27 AM, Surinder Kumar <
> surinder.ku...@enterprisedb.com> wrote:
>
>> On Tue, Aug 8, 2017 at 1:47 PM, Dave Page  wrote:
>>
>>
>>>
>>> On Tue, Aug 8, 2017 at 7:18 AM, Surinder Kumar <
>>> surinder.ku...@enterprisedb.com> wrote:
>>>
 Hi

 On Ubuntu-14.04, I got error Application Server couldn't be contacted:

 *Steps performed:*

- I have already installed pgAdmin4-1.4 which come with
PostgreSQL-9.6 installer.
then I run root@ubuntu:/opt/PostgreSQL/9.6/pgAdmin 4/bin#
./pgAdmin4./.
- Now took latest git pull from HEAD
- Apply unified_config.diff patch.
- Then compiled pgAdmin4 in runtime and then run ./pgAdmin.
- Got error Application Server couldn't be contacted.

 But when I ran ./pgAdmin4 for the second time. pgAdmin4 runs without
 any issue.
 I didn’t get any error on the terminal and log file.
 ​ I couldn't find why it gives this error.​

>>>
>>> I know Fahar has run into this with existing releases on Ubuntu. If you
>>> enable debugging, can you see any clues? I assume it's going round the
>>> retry loop before aborting?
>>>
 *Another issue related to Alembic:*

 If I am running pgAdmin4 already installed on my machine, then I
 upgrade pgAdmin4 using Python wheel:

 (test_p27) surinder@ubuntu:~/virtualenvs/test_p27$ python
 ~/virtualenvs/test_p27/lib/python2.7/site-packages/pgadmin4/pgAdmin4.py

 *I am getting error:*

 alembic.util.exc.CommandError: Can't locate revision identified by
 'd85a62333272'

 To fix this, I have to delete existing pgadmin4.db file. I don’t know
 if it is a valid case or should I log an RM if it is?

>>> That's an annoying side-effect of the move to Alembic. The previous DB
>>> code would quite happily (and intentionally) run with a newer version of
>>> the database, however, the new code does not. You'll see this issue
>>> whenever you've run a newer version of pgAdmin and then go back to an older
>>> version that uses an older schema version.
>>>
>>> It would be nice to change this so it doesn't complain - but we'd have
>>> to be cautious to only break compatibility on major releases.
>>>
>>>
>>>
 Apart for this, I didn’t see any functionality break. It works!!
 ​

 I liked the approach to set SEVER_MODE in runtime using built-ins.

>>> Thanks. Do you think it warrants a 2.0 version number, given the
>>> potential for breaking existing installations (I do, but would like other
>>> feedback)? If we do that - and thus allow a parallel installation of 1.x
>>> and 2.x), how would we resolve the Alembic issue you noted such that both
>>> versions could be run against the same DB?
>>>
>> To resolve this issue while upgrading to newer version of pgAdmin4, we
>> can add a parameter version_table: 'alembic_version-1.6 in
>> web/migrations/env.py of upcoming pgAdmin4 source code(reference link
>> 
>> )
>> It will create a new version table in pgadmin4.db database and it will
>> instruct the Alembic to run migrations for the version stored in
>> table(alembic_version-1.6) when new pgAdmin4 will be installed.
>>
>> I tried to check if it works or not. But somehow I couldn’t install
>> pgAdmin4-1.5 from wheel.
>>
>> Alternatively I will try to generate new schema using in pgAdmin4 source
>> code(Git HEAD). It will generate a new migration version and then i will
>> run pgAdmin4-1.6 from wheel having different migration number. It will
>> create pgadmin4.db for 1.5.
>> Then
>>  I will run pgAdmin4-1.6 from source code, so migration will take place
>> and hopefully
>> ​the ​
>> sa
>> me
>> ​ ​
>> pgadmin4.db will work for newer pgAdmin4 version.
>>
>> Reference link 
>> where the same issue has been discussed.
>>
>
> Sounds good - please investigate further.
>
 I spent some time, understands how Alembic works and I thought it is easy
using the reference link but not, It needs more R&D. I will look how can we
fix it.

>
> Thanks!
>
>
>> Thanks,
>> Surinder
>>
>>
>>>
>>>
 Thanks,
 Surinder
 ​

 On Mon, Aug 7, 2017 at 7:01 PM, Dave Page  wrote:

>
>
> On Mon, Aug 7, 2017 at 1:43 PM, Su

Re: [pgAdmin4][patch] update the alert style in the sub-navigation

2017-08-08 Thread Surinder Kumar
Hi Wenlin,

On Tue, Aug 8, 2017 at 3:15 PM, Wenlin Zhang  wrote:

> Hi Surinder,
>
>Thanks for your review.
>
>We have changed the indentation for _dashboard.scss file and also
> removed the style about icon-postgres:before, like margin-top,etc, but we
> are not sure if it is perfectly aligned now, you can add further change to
> it.
>
> As the second comment, I'm sorry I'm not sure what's the problem,
> could you please clarify it? Because we replace css with scss right now,
> dashboard.css doesn't exist. So maybe you are looking at the css file that
> are complied by the scss?
>
​Sorry I​ typed 'dashboard.css' instead of 'dashboard.js'.
​In dashboard.js can we change `return DashboardAlert;` to `return new
DashboardAlert();`
and then we can remove the instances being created(var alertDashboard = new
AlertDashboard();) from dashboard.js, and simply
use `AlertDashboard.info('message')`.


> For the fourth comment, we tried the steps you suggested on master
> branch, the error is not shown either. So it should be an existing issue.
> But if you want to see the error message, navigate to "Servers" at the top
> of browser, then navigate back to postgresql server, then you will see the
> error message.
>
​The error in console will appear when you selected a database which is
connected and stop the backend Python server because the request for graphs
for database level will fail and there is no response returned from server.
It might be not reproducible to you If you set the refresh rate to higher
value (i.e. Preferences > Graphs) in preferences. Just set refresh rate to
1 for all dashboard graphs and repeat the steps.

>
>
> Thanks,
>
> Wenlin &Violet
>
>
>
> On Mon, Aug 7, 2017 at 2:30 PM, Surinder Kumar <
> surinder.ku...@enterprisedb.com> wrote:
>
>> Hi
>> Review comments:
>>
>>1.
>>
>>For consistency, we use two spaces for indentation in CSS files. Four
>>spaces are used in _dashboard.scss file. The configurations are
>>defined in web/.editorconfig file.
>>2.
>>
>>In,dashboard.css Can we return function object in return instead of
>>function class itself, this will eliminate the need of creating function
>>object every time we use info and error?
>>3.
>>
>>On Dashboard, I can see Postgres icon is misaligned compared to other
>>icons in Getting Started section. It is not related to this patch.
>>adjusting margin top will fix it.
>>4.
>>
>>I tried to test out Error message displayed, but I encounter an
>>error(screenshot attached).
>>Steps to reproduce:
>>   - Open pgAdmin4 in browser
>>   - Connect to PostgreSQL Server, Keep dashboard tab open.
>>   - Navigate to the database which is connected.
>>   - Now disconnect pgAdmin4 python server.
>>   ​
>>
>> ​Here I mean Stop Python server. I​


>
>>1.
>>   - ​
>>   - No error message is displayed on Dashboard because it breaks in
>>   JS as xhr.responseText is empty.
>>   However, it might be an existing issue.
>>
>> Thanks,
>> Surinder
>>
>> On Mon, Aug 7, 2017 at 10:40 AM, Wenlin Zhang  wrote:
>>
>> Hi Ashesh,
>>>
>>> That's correct. This patch just changed alert style in the 'tabs',
>>> such as Dependency and Dependents.
>>>
>>> Thanks
>>>
>>> Wenlin
>>>
>>> On Mon, Aug 7, 2017 at 12:51 PM, Ashesh Vashi <
>>> ashesh.va...@enterprisedb.com> wrote:
>>>
 Surinder,

 Please take a look at this patch.

 If I recalls correctly, this patch is related to styling of the 'tabs'
 shown on the main window.
 Wenlin - please correct me if my understanding is wrong.

 --

 Thanks & Regards,

 Ashesh Vashi
 EnterpriseDB INDIA: Enterprise PostgreSQL Company
 


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

 On Mon, Aug 7, 2017 at 8:11 AM, Sarah McAlear 
 wrote:

> Hi hackers,
>
> Could you please review this patch?
>
> Thanks
>
> Wenlin and Sarah
>
> On Wed, Aug 2, 2017 at 2:15 PM, Wenlin Zhang 
> wrote:
>
>> Hi Hackers,
>>
>> This patch changes the alert style in the sub-navigation to match
>> style guide.
>>
>> Thanks,
>> Wenlin, Shirley & Sarah
>>
>>
>>
>

>>> ​
>>
>
>


Re: Build failed in Jenkins: pgadmin4-master-python33 #207

2017-08-08 Thread Navnath Gadakh
Hi Dave,

On Fri, Jun 30, 2017 at 3:57 PM, pgAdmin 4 Jenkins 
wrote:

> See  7/display/redirect?page=changes>
>
> Changes:
>
> [Dave Page] Fix a couple of gripes from the JS linter on Windows.
>
> --
> [...truncated 289.08 KB...]
> Update materialized view under schema node ... ok
> runTest (pgadmin.browser.server_groups.servers.databases.tests.test_
> db_add.DatabaseAddTestCase)
> Check Databases Node URL ... ok
> runTest (pgadmin.browser.server_groups.servers.databases.tests.test_
> db_delete.DatabaseDeleteTestCase)
> Check Databases Node URL ... ok
> runTest (pgadmin.browser.server_groups.servers.databases.tests.test_
> db_get.DatabasesGetTestCase)
> Check Databases Node URL ... ok
> runTest (pgadmin.browser.server_groups.servers.databases.tests.test_
> db_put.DatabasesUpdateTestCase)
> Check Databases Node ... ok
> runTest (pgadmin.browser.server_groups.servers.resource_groups.
> tests.test_resource_groups_add.ResourceGroupsAddTestCase)
> Add resource groups ... ok
> runTest (pgadmin.browser.server_groups.servers.resource_groups.
> tests.test_resource_groups_delete.ResourceGroupsDeleteTestCase)
> Delete resource groups ... ok
> runTest (pgadmin.browser.server_groups.servers.resource_groups.
> tests.test_resource_groups_put.ResourceGroupsPutTestCase)
> Put resource groups ... ok
> runTest (pgadmin.browser.server_groups.servers.resource_groups.
> tests.tests_resource_groups_get.ResourceGroupsGetTestCase)
> Get resource groups ... ok
> runTest (pgadmin.browser.server_groups.servers.roles.tests.test_
> role_add.LoginRoleAddTestCase)
> Check Role Node ... ok
> runTest (pgadmin.browser.server_groups.servers.roles.tests.test_
> role_delete.LoginRoleDeleteTestCase)
> Check Role Node ... ok
> runTest (pgadmin.browser.server_groups.servers.roles.tests.test_
> role_get.LoginRoleGetTestCase)
> Check Role Node ... ok
> runTest (pgadmin.browser.server_groups.servers.roles.tests.test_
> role_put.LoginRolePutTestCase)
> Check Role Node ... ok
> runTest (pgadmin.browser.server_groups.servers.tablespaces.tests.
> test_tbspc_add.TableSpaceAddTestCase)
> Check Tablespace Node ... ok
> runTest (pgadmin.browser.server_groups.servers.tablespaces.tests.
> test_tbspc_delete.TableSpaceDeleteTestCase)
> Check Tablespace Node ... ok
> runTest (pgadmin.browser.server_groups.servers.tablespaces.tests.
> test_tbspc_get.TablespaceGetTestCase)
> Check Tablespace Node ... ok
> runTest (pgadmin.browser.server_groups.servers.tablespaces.tests.
> test_tbspc_put.TableSpaceUpdateTestCase)
> Check Tablespace Node ... ok
> runTest (pgadmin.browser.server_groups.servers.tests.test_check_
> recovery.TestCheckRecovery)
> Test for check recovery ... ok
> runTest (pgadmin.browser.server_groups.servers.tests.test_dependenci
> es_sql.TestDependenciesSql)
> Test dependencies SQL file ... ok
> runTest (pgadmin.browser.server_groups.servers.tests.test_dependents
> _sql.TestDependentsSql)
> Test dependencies SQL file ... ok
> runTest (pgadmin.browser.server_groups.servers.tests.test_role_
> dependencies_sql.TestRoleDependenciesSql)
> Test Role Dependencies SQL file ... ok
> runTest (pgadmin.browser.server_groups.servers.tests.test_server_
> add.ServersAddTestCase)
> Default Server Node url ... ok
> runTest (pgadmin.browser.server_groups.servers.tests.test_server_
> delete.ServerDeleteTestCase)
> Default Server Node url ... ok
> runTest (pgadmin.browser.server_groups.servers.tests.test_server_
> get.ServersGetTestCase)
> Default Server Node url ... ok
> runTest (pgadmin.browser.server_groups.servers.tests.test_server_
> put.ServerUpdateTestCase)
> Default Server Node url ... ok
> runTest (pgadmin.browser.server_groups.tests.test_sg_get.SgNodeTestCase)
> Check Server Group Node ... ok
> runTest (pgadmin.utils.javascript.tests.test_javascript_bundler.Java
> scriptBundlerTestCase)
> scenario name: JavascriptBundlerTestCase ... ok
> runTest (pgadmin.utils.tests.test_versioned_template_loader.TestVers
> ionedTemplateLoader)
> Render a template when called ... ok
> runTest (pgadmin.utils.tests.test_versioned_template_loader.TestVers
> ionedTemplateLoader)
> Render a version 9.1 template when it is present ... ok
> runTest (pgadmin.utils.tests.test_versioned_template_loader.TestVers
> ionedTemplateLoader)
> Render a version 9.2 template when request for a higher version ... ok
> runTest (pgadmin.utils.tests.test_versioned_template_loader.TestVers
> ionedTemplateLoader)
> Render default version when version 9.0 was requested and only 9.1 and 9.2
> are present ... ok
> runTest (pgadmin.utils.tests.test_versioned_template_loader.TestVers
> ionedTemplateLoader)
> Raise error when version is smaller than available templates ... ok
> runTest (regression.python_test_utils.sql_template_test_base.SQLTemp
> lateTestBase)
> parent test class ... ok
>
> --
> Ran 163 tests in 25.568s
>
> OK
>
> 

Re: Unified server/desktop config

2017-08-08 Thread Dave Page
Please update the patch :-)

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

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

> On 9 Aug 2017, at 05:53, Surinder Kumar  
> wrote:
> 
> Hi,
> 
> I noticed that test cases don’t run and I got an error:
> 
> (pgAdmin_27)Laptop195:regression surinder$ python runtests.py --pkg 
> feature_tests
> 
> Traceback (most recent call last):
>   File "runtests.py", line 45, in 
> import config
>   File "/Users/surinder/Documents/Projects/pgadmin4/web/config.py", line 121, 
> in 
> if builtins.SERVER_MODE is None:
> AttributeError: 'module' object has no attribute'
> SERVER_MODE
> '
> 
> I think this is because we are setting​ ​first​ ​builtins.SERVER_MODE​ in​ 
> ​pgAdmin4.py
> but in test cases pgAdmin4.py is not being called.​
> 
> 
>> On Tue, Aug 8, 2017 at 4:03 PM, Dave Page  wrote:
>> 
>> 
>>> On Tue, Aug 8, 2017 at 11:27 AM, Surinder Kumar 
>>>  wrote:
 On Tue, Aug 8, 2017 at 1:47 PM, Dave Page  wrote:
 
 
 
> On Tue, Aug 8, 2017 at 7:18 AM, Surinder Kumar 
>  wrote:
> Hi
> 
> On Ubuntu-14.04, I got error Application Server couldn't be contacted:
> 
> Steps performed:
> 
> I have already installed pgAdmin4-1.4 which come with PostgreSQL-9.6 
> installer.
> then I run root@ubuntu:/opt/PostgreSQL/9.6/pgAdmin 4/bin# ./pgAdmin4./.
> Now took latest git pull from HEAD
> Apply unified_config.diff patch.
> Then compiled pgAdmin4 in runtime and then run ./pgAdmin.
> Got error Application Server couldn't be contacted.
> But when I ran ./pgAdmin4 for the second time. pgAdmin4 runs without any 
> issue.
> I didn’t get any error on the terminal and log file.
> 
> ​ I couldn't find why it gives this error.​
 
 I know Fahar has run into this with existing releases on Ubuntu. If you 
 enable debugging, can you see any clues? I assume it's going round the 
 retry loop before aborting? 
> Another issue related to Alembic:
> 
> If I am running pgAdmin4 already installed on my machine, then I upgrade 
> pgAdmin4 using Python wheel:
> 
> (test_p27) surinder@ubuntu:~/virtualenvs/test_p27$ python 
> ~/virtualenvs/test_p27/lib/python2.7/site-packages/pgadmin4/pgAdmin4.py
> 
> I am getting error:
> 
> alembic.util.exc.CommandError: Can't locate revision identified by 
> 'd85a62333272'
> 
> To fix this, I have to delete existing pgadmin4.db file. I don’t know if 
> it is a valid case or should I log an RM if it is?
> 
 
 That's an annoying side-effect of the move to Alembic. The previous DB 
 code would quite happily (and intentionally) run with a newer version of 
 the database, however, the new code does not. You'll see this issue 
 whenever you've run a newer version of pgAdmin and then go back to an 
 older version that uses an older schema version.
 
 It would be nice to change this so it doesn't complain - but we'd have to 
 be cautious to only break compatibility on major releases.
 
  
> Apart for this, I didn’t see any functionality break. It works!!
> 
> I liked the approach to set SEVER_MODE in runtime using built-ins.
> 
 
 Thanks. Do you think it warrants a 2.0 version number, given the potential 
 for breaking existing installations (I do, but would like other feedback)? 
 If we do that - and thus allow a parallel installation of 1.x and 2.x), 
 how would we resolve the Alembic issue you noted such that both versions 
 could be run against the same DB?
>>> 
>>> To resolve this issue while upgrading to newer version of pgAdmin4, we can 
>>> add a parameter version_table: 'alembic_version-1.6 in 
>>> web/migrations/env.py of upcoming pgAdmin4 source code(reference link)
>>> It will create a new version table in pgadmin4.db database and it will 
>>> instruct the Alembic to run migrations for the version stored in 
>>> table(alembic_version-1.6) when new pgAdmin4 will be installed.
>>> 
>>> I tried to check if it works or not. But somehow I couldn’t install 
>>> pgAdmin4-1.5 from wheel.
>>> 
>>> Alternatively I will try to generate new schema using in pgAdmin4 source 
>>> code(Git HEAD). It will generate a new migration version and then i will 
>>> run pgAdmin4-1.6 from wheel having different migration number. It will 
>>> create pgadmin4.db for 1.5.
>>> 
>>> Then I will run pgAdmin4-1.6 from source code, so migration will take place 
>>> and hopefully ​the ​same​ ​pgadmin4.db will work for newer pgAdmin4 version.
>>> Reference link where the same issue has been discussed.
>>> 
>> 
>> Sounds good - please investigate further.
>  I spent some time, understands how Alembic works and I thought it is easy 
> using the reference link but not, It needs more R&D. I will look how can we 
> fix it.
>> 
>> Thanks!
>>  
>>> Thanks,
>>> Surinder
>>> 
 
  
> Thanks,

Re: Unified server/desktop config

2017-08-08 Thread Surinder Kumar
Sure, I will update.

On Wed, Aug 9, 2017 at 11:17 AM, Dave Page  wrote:

> Please update the patch :-)
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK:http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
> On 9 Aug 2017, at 05:53, Surinder Kumar 
> wrote:
>
> Hi,
>
> I noticed that test cases don’t run and I got an error:
>
> (pgAdmin_27)Laptop195:regression surinder$ python runtests.py --pkg 
> feature_tests
> 
> Traceback (most recent call last):
>   File "runtests.py", line 45, in 
> import config
>   File "/Users/surinder/Documents/Projects/pgadmin4/web/config.py", line 121, 
> in 
> if builtins.SERVER_MODE is None:
> AttributeError: 'module' object has no attribute'
> SERVER_MODE
> '
>
> I think this is because we are setting​ ​first​ ​builtins.SERVER_MODE​ in​ 
> ​pgAdmin4.py
> but in test cases pgAdmin4.py is not being called.​
>
>
> On Tue, Aug 8, 2017 at 4:03 PM, Dave Page  wrote:
>
>>
>>
>> On Tue, Aug 8, 2017 at 11:27 AM, Surinder Kumar <
>> surinder.ku...@enterprisedb.com> wrote:
>>
>>> On Tue, Aug 8, 2017 at 1:47 PM, Dave Page  wrote:
>>>
>>>

 On Tue, Aug 8, 2017 at 7:18 AM, Surinder Kumar <
 surinder.ku...@enterprisedb.com> wrote:

> Hi
>
> On Ubuntu-14.04, I got error Application Server couldn't be contacted:
>
> *Steps performed:*
>
>- I have already installed pgAdmin4-1.4 which come with
>PostgreSQL-9.6 installer.
>then I run root@ubuntu:/opt/PostgreSQL/9.6/pgAdmin 4/bin#
>./pgAdmin4./.
>- Now took latest git pull from HEAD
>- Apply unified_config.diff patch.
>- Then compiled pgAdmin4 in runtime and then run ./pgAdmin.
>- Got error Application Server couldn't be contacted.
>
> But when I ran ./pgAdmin4 for the second time. pgAdmin4 runs without
> any issue.
> I didn’t get any error on the terminal and log file.
> ​ I couldn't find why it gives this error.​
>

 I know Fahar has run into this with existing releases on Ubuntu. If you
 enable debugging, can you see any clues? I assume it's going round the
 retry loop before aborting?

> *Another issue related to Alembic:*
>
> If I am running pgAdmin4 already installed on my machine, then I
> upgrade pgAdmin4 using Python wheel:
>
> (test_p27) surinder@ubuntu:~/virtualenvs/test_p27$ python
> ~/virtualenvs/test_p27/lib/python2.7/site-packages/pgadmin4/
> pgAdmin4.py
>
> *I am getting error:*
>
> alembic.util.exc.CommandError: Can't locate revision identified by
> 'd85a62333272'
>
> To fix this, I have to delete existing pgadmin4.db file. I don’t know
> if it is a valid case or should I log an RM if it is?
>
 That's an annoying side-effect of the move to Alembic. The previous DB
 code would quite happily (and intentionally) run with a newer version of
 the database, however, the new code does not. You'll see this issue
 whenever you've run a newer version of pgAdmin and then go back to an older
 version that uses an older schema version.

 It would be nice to change this so it doesn't complain - but we'd have
 to be cautious to only break compatibility on major releases.



> Apart for this, I didn’t see any functionality break. It works!!
> ​
>
> I liked the approach to set SEVER_MODE in runtime using built-ins.
>
 Thanks. Do you think it warrants a 2.0 version number, given the
 potential for breaking existing installations (I do, but would like other
 feedback)? If we do that - and thus allow a parallel installation of 1.x
 and 2.x), how would we resolve the Alembic issue you noted such that both
 versions could be run against the same DB?

>>> To resolve this issue while upgrading to newer version of pgAdmin4, we
>>> can add a parameter version_table: 'alembic_version-1.6 in
>>> web/migrations/env.py of upcoming pgAdmin4 source code(reference link
>>> 
>>> )
>>> It will create a new version table in pgadmin4.db database and it will
>>> instruct the Alembic to run migrations for the version stored in
>>> table(alembic_version-1.6) when new pgAdmin4 will be installed.
>>>
>>> I tried to check if it works or not. But somehow I couldn’t install
>>> pgAdmin4-1.5 from wheel.
>>>
>>> Alternatively I will try to generate new schema using in pgAdmin4 source
>>> code(Git HEAD). It will generate a new migration version and then i will
>>> run pgAdmin4-1.6 from wheel having different migration number. It will
>>> create pgadmin4.db for 1.5.
>>> Then
>>>  I will run pgAdmin4-1.6 from source code, so migration will take place
>>> and hopefully
>>> ​the ​
>>> sa
>>> me
>>> ​ ​
>>> pgadmin4.db will work for newer pgAdmin4 version.
>>>
>>> Reference link