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

2017-08-28 Thread Akshay Joshi
Thanks patch applied.

On Mon, Aug 28, 2017 at 12:27 PM, Murtuza Zabuawala <
murtuza.zabuaw...@enterprisedb.com> wrote:

> Hi,
>
> Please find a patch to fix the issue for PG9.6 in Dashboard, this is
> regression of RM#2597.
>
> *Error:*
> 2017-08-28 11:49:28,238: ERROR pgadmin: Failed to execute query
> (execute_dict) for the server #34- DB:postgres (Query-id: 320468):
> Error Message:ERROR:  column "backend_type" does not exist
> LINE 14: backend_type
> in dashboard
> Request URL:http://127.0.0.1:5050/dashboard/activity/34
> 
>
> Earlier I tested changes only with PG9.4 and PG10, So I missed this issue,
> as "backend_type" column only exists in PG10+.
> Thanks to Surinder for reporting the issue.
>
> --
> Regards,
> Murtuza Zabuawala
> EnterpriseDB: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
> [image: https://community.postgresrocks.net/]
> 
>
> On Fri, Aug 25, 2017 at 9:27 PM, Dave Page  wrote:
>
>> Thanks, patch applied.
>>
>> On Wed, Aug 9, 2017 at 12:19 PM, Murtuza Zabuawala <
>> murtuza.zabuaw...@enterprisedb.com> wrote:
>>
>>> Hi,
>>>
>>> Please find the updated patch with new UI style in dashboard subnode
>>> control based on Chethana's design suggestion.
>>>
>>> @Shirley,
>>> Yes, DBA needs to click on the drop down to expand.
>>> - If we make whole row clickable then how are we going to identify if
>>> user is trying to expand the row or trying to cancel the active session? I
>>> am asking this because table row  tag comes before table column tag
>>>  in HTML DOM, so if we have click event listers on both of the tags
>>> then how are we going to differentiate the user operation?
>>> - In my opinion, another reason we can not do that on a dashboard grid
>>> because it will break the subnode control consistency, If user sees that
>>> grid expands on clicking the row they will expect the same behaviour in
>>> other grids as well.
>>>
>>> --
>>> Regards,
>>> Murtuza Zabuawala
>>> EnterpriseDB: http://www.enterprisedb.com
>>> The Enterprise PostgreSQL Company
>>>
>>> [image: https://community.postgresrocks.net/]
>>> 
>>>
>>> On Tue, Aug 8, 2017 at 7:47 PM, Shirley Wang  wrote:
>>>
 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 <
> chethana.ku...@enterprisedb.com> 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 <
>>> murtuza.zabuaw...@enterprisedb.com> wrote:
>>>
 ++ Attaching the patch

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

pgAdmin 4 commit: Fixed issue where 'backend_type' column is exist for

2017-08-28 Thread Akshay Joshi
Fixed issue where 'backend_type' column is exist for database server version 
greater than 10.
Issue is regression of RM #2597.

Branch
--
master

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

Modified Files
--
web/pgadmin/dashboard/static/js/dashboard.js| 21 ++---
.../templates/dashboard/sql/10_plus/activity.sql| 19 +++
.../templates/dashboard/sql/9.6_plus/activity.sql   |  3 +--
3 files changed, 34 insertions(+), 9 deletions(-)



Re: [pgAdmin4][RM2586] Cleanup feature test

2017-08-28 Thread Harshal Dhumal
Hi,

Please find attached updated patch

On Fri, Aug 25, 2017 at 2:32 PM, Dave Page  wrote:

> Hi
>
> On Thu, Aug 24, 2017 at 11:51 AM, Harshal Dhumal <
> harshal.dhu...@enterprisedb.com> wrote:
>
>> Hi,
>>
>> Last week Sarah, Matt and I had call regarding some issues with feature
>> test cases.
>> For example in auto commit disable test scenario from query tool test
>> cases by removing code line
>> *self.page.find_by_id("btn-auto-commit").click() *the test case scenario
>> was not falling.
>> This issue was due to previously on going database transaction. This
>> issue was also with test scenarios like
>> auto commit enable and auto rollback enabled. The attached patch fixes
>> this issue.
>>
>> @Sarah and Matt can you please give this patch a try to check if issues
>> we discussed last week are fixed.
>>
>
> I don't think Matt and Sarah are working on pgAdmin any more :-(
>
> I just tried this patch, and whilst the tests all passed, it spent quite
> some time typing "select * from hats" into random places in the query tool,
> such that it ended up running queries like
>
> select * select * select * from hats from hats from hats
>
> I don't remember it doing that before; I think it was a) clearing
> codemirror each time and b) entering the text much more quickly (in fact I
> just tried it, and it enters the text and executes the query so fast the
> screen basically strobes).
>
Fixed.


> Performance-wise, I got 266 seconds with the patch, and 378 without, so
> there's definitely some good improvement here, just a little funkyness with
> the query tool journey test.
>

Recently Wenlin Zhang has fixed this in this commit
.
Here is link

to email thread.


> 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/feature_tests/connect_to_server_feature_test.py b/web/pgadmin/feature_tests/connect_to_server_feature_test.py
deleted file mode 100644
index 97e96f2..000
--- a/web/pgadmin/feature_tests/connect_to_server_feature_test.py
+++ /dev/null
@@ -1,84 +0,0 @@
-##
-#
-# pgAdmin 4 - PostgreSQL Tools
-#
-# Copyright (C) 2013 - 2017, The pgAdmin Development Team
-# This software is released under the PostgreSQL Licence
-#
-##
-
-import time
-from selenium.webdriver import ActionChains
-
-import config as app_config
-from regression.feature_utils.base_feature_test import BaseFeatureTest
-from regression.python_test_utils import test_utils
-
-
-class ConnectsToServerFeatureTest(BaseFeatureTest):
-"""
-Tests that a database connection can be created from the UI
-"""
-scenarios = [
-("Test database connection", dict())
-]
-
-def before(self):
-connection = test_utils.get_db_connection(self.server['db'],
-  self.server['username'],
-  self.server['db_password'],
-  self.server['host'],
-  self.server['port'],
-  self.server['sslmode'])
-test_utils.drop_database(connection, "acceptance_test_db")
-test_utils.create_database(self.server, "acceptance_test_db")
-test_utils.create_table(self.server, "acceptance_test_db", "test_table")
-
-def runTest(self):
-"""This function tests that a database connection can be created from
-the UI"""
-self.assertEqual(app_config.APP_NAME, self.page.driver.title)
-self.page.wait_for_spinner_to_disappear()
-
-self._connects_to_server()
-self._tables_node_expandable()
-
-def after(self):
-self.page.remove_server(self.server)
-
-connection = test_utils.get_db_connection(self.server['db'],
-  self.server['username'],
-  self.server['db_password'],
-  self.server['host'],
-  self.server['port'],
-  self.server['sslmode'])
-test_utils.drop_database(connection, "acceptance_test_db")
-
-def _connects_to_server(self):
-self.page.find_by_xpath("//*[@class='aciTreeText' and .='Servers']").click()
-time.sleep(2)
-self.page.driver.find_element_by_link_text("Object").click()
-   

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

2017-08-28 Thread Murtuza Zabuawala
Hi,

Please find a patch to fix the issue for PG9.6 in Dashboard, this is
regression of RM#2597.

*Error:*
2017-08-28 11:49:28,238: ERROR pgadmin: Failed to execute query
(execute_dict) for the server #34- DB:postgres (Query-id: 320468):
Error Message:ERROR:  column "backend_type" does not exist
LINE 14: backend_type
in dashboard
Request URL:http://127.0.0.1:5050/dashboard/activity/34


Earlier I tested changes only with PG9.4 and PG10, So I missed this issue,
as "backend_type" column only exists in PG10+.
Thanks to Surinder for reporting the issue.

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

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


On Fri, Aug 25, 2017 at 9:27 PM, Dave Page  wrote:

> Thanks, patch applied.
>
> On Wed, Aug 9, 2017 at 12:19 PM, Murtuza Zabuawala  enterprisedb.com> wrote:
>
>> Hi,
>>
>> Please find the updated patch with new UI style in dashboard subnode
>> control based on Chethana's design suggestion.
>>
>> @Shirley,
>> Yes, DBA needs to click on the drop down to expand.
>> - If we make whole row clickable then how are we going to identify if
>> user is trying to expand the row or trying to cancel the active session? I
>> am asking this because table row  tag comes before table column tag
>>  in HTML DOM, so if we have click event listers on both of the tags
>> then how are we going to differentiate the user operation?
>> - In my opinion, another reason we can not do that on a dashboard grid
>> because it will break the subnode control consistency, If user sees that
>> grid expands on clicking the row they will expect the same behaviour in
>> other grids as well.
>>
>> --
>> Regards,
>> Murtuza Zabuawala
>> EnterpriseDB: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>>
>> [image: https://community.postgresrocks.net/]
>> 
>>
>> On Tue, Aug 8, 2017 at 7:47 PM, Shirley Wang  wrote:
>>
>>> 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 <
 chethana.ku...@enterprisedb.com> 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 <
>> murtuza.zabuaw...@enterprisedb.com> 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 <
>>> murtuza.zabuaw...@enterprisedb.com> wrote:
>>>
 Hi Dave,

 PFA patch to display additional information from pg_stat_activity
 table using subnode