pgAdmin 4 commit: Properly set the hostname for SSL use in containers.

2017-11-16 Thread Dave Page
Properly set the hostname for SSL use in containers.

Branch
--
master

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

Modified Files
--
pkg/docker/pgadmin4.conf.j2 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)



[pgAdmin4][Patch]: RM #2781 - New option to set the quotation mark for copying to clipboard.

2017-11-16 Thread Khushboo Vashi
Hi,

Please find the attached patch for RM #2781 : New option to set the
quotation mark for copying to clipboard.

This patch includes:

- Provide options in preferences to control the CSV output which includes
copy to clipboard and download as CSV features in Query Tool
- Modified related jasmine tests
- Modified related feature tests

Thanks,
Khushboo
diff --git a/web/pgadmin/feature_tests/copy_selected_query_results_feature_test.py b/web/pgadmin/feature_tests/copy_selected_query_results_feature_test.py
index d01bf66..41fd6da 100644
--- a/web/pgadmin/feature_tests/copy_selected_query_results_feature_test.py
+++ b/web/pgadmin/feature_tests/copy_selected_query_results_feature_test.py
@@ -66,7 +66,7 @@ class CopySelectedQueryResultsFeatureTest(BaseFeatureTest):
 
 self.page.find_by_xpath("//*[@id='btn-copy-row']").click()
 
-self.assertEqual("'Some-Name','6','some info'",
+self.assertEqual('"Some-Name","6","some info"',
  pyperclip.paste())
 
 def _copies_columns(self):
@@ -75,9 +75,9 @@ class CopySelectedQueryResultsFeatureTest(BaseFeatureTest):
 self.page.find_by_xpath("//*[@id='btn-copy-row']").click()
 
 self.assertEqual(
-"""'Some-Name'
-'Some-Other-Name'
-'Yet-Another-Name'""",
+"""\"Some-Name"
+"Some-Other-Name"
+"Yet-Another-Name\,
 pyperclip.paste())
 
 def _copies_row_using_keyboard_shortcut(self):
@@ -86,7 +86,7 @@ class CopySelectedQueryResultsFeatureTest(BaseFeatureTest):
 
 ActionChains(self.page.driver).key_down(Keys.CONTROL).send_keys('c').key_up(Keys.CONTROL).perform()
 
-self.assertEqual("'Some-Name','6','some info'",
+self.assertEqual('"Some-Name","6","some info"',
  pyperclip.paste())
 
 def _copies_column_using_keyboard_shortcut(self):
@@ -96,9 +96,9 @@ class CopySelectedQueryResultsFeatureTest(BaseFeatureTest):
 ActionChains(self.page.driver).key_down(Keys.CONTROL).send_keys('c').key_up(Keys.CONTROL).perform()
 
 self.assertEqual(
-"""'Some-Name'
-'Some-Other-Name'
-'Yet-Another-Name'""",
+"""\"Some-Name"
+"Some-Other-Name"
+"Yet-Another-Name\,
 pyperclip.paste())
 
 def _copies_rectangular_selection(self):
@@ -112,8 +112,8 @@ class CopySelectedQueryResultsFeatureTest(BaseFeatureTest):
 .release(bottom_right_cell).perform()
 ActionChains(self.page.driver).key_down(Keys.CONTROL).send_keys('c').key_up(Keys.CONTROL).perform()
 
-self.assertEqual("""'Some-Other-Name','22'
-'Yet-Another-Name','14'""", pyperclip.paste())
+self.assertEqual("""\"Some-Other-Name","22"
+"Yet-Another-Name","14\, pyperclip.paste())
 
 def _shift_resizes_rectangular_selection(self):
 pyperclip.copy("old clipboard contents")
@@ -128,8 +128,8 @@ class CopySelectedQueryResultsFeatureTest(BaseFeatureTest):
 ActionChains(self.page.driver).key_down(Keys.SHIFT).send_keys(Keys.ARROW_RIGHT).key_up(Keys.SHIFT).perform()
 ActionChains(self.page.driver).key_down(Keys.CONTROL).send_keys('c').key_up(Keys.CONTROL).perform()
 
-self.assertEqual("""'Some-Other-Name','22','some other info'
-'Yet-Another-Name','14','cool info'""", pyperclip.paste())
+self.assertEqual("""\"Some-Other-Name","22","some other info"
+"Yet-Another-Name","14","cool info\, pyperclip.paste())
 
 def _shift_resizes_column_selection(self):
 pyperclip.copy("old clipboard contents")
@@ -141,9 +141,9 @@ class CopySelectedQueryResultsFeatureTest(BaseFeatureTest):
 ActionChains(self.page.driver).key_down(Keys.CONTROL).send_keys('c').key_up(Keys.CONTROL).perform()
 
 self.assertEqual(
-"""'Some-Name','6'
-'Some-Other-Name','22'
-'Yet-Another-Name','14'""",
+"""\"Some-Name","6"
+"Some-Other-Name","22"
+"Yet-Another-Name","14\,
 pyperclip.paste())
 
 def _mouseup_outside_grid_still_makes_a_selection(self):
@@ -160,7 +160,7 @@ class CopySelectedQueryResultsFeatureTest(BaseFeatureTest):
 
 ActionChains(self.page.driver).key_down(Keys.CONTROL).send_keys('c').key_up(Keys.CONTROL).perform()
 
-self.assertEqual("'cool info'", pyperclip.paste())
+self.assertEqual('"cool info"', pyperclip.paste())
 
 def after(self):
 self.page.close_query_tool()
diff --git a/web/pgadmin/feature_tests/query_tool_journey_test.py b/web/pgadmin/feature_tests/query_tool_journey_test.py
index 87514b1..6b79948 100644
--- a/web/pgadmin/feature_tests/query_tool_journey_test.py
+++ b/web/pgadmin/feature_tests/query_tool_journey_test.py
@@ -54,7 +54,7 @@ class QueryToolJourneyTest(BaseFeatureTest):
 self.page.find_by_xpath("//*[contains(@class, 'slick-row')]/*[1]").click()
 self.page.find_by_xpath("//*[@id='btn-copy-row']").click()
 
-self.assertEqual("'Some-Name','6','some info'",
+self.assertEqual('"Some-Name","6","some info"',
  pype

pgAdmin 4 commit: Focus on the filter textarea when opening filter opti

2017-11-16 Thread Dave Page
Focus on the filter textarea when opening filter options in the query tool.

Branch
--
master

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

Modified Files
--
web/pgadmin/tools/sqleditor/static/js/sqleditor.js | 2 ++
1 file changed, 2 insertions(+)



Re: [pgAdmin4][Patch]: Set focus on Filter window when opened by user

2017-11-16 Thread Dave Page
Thanks, applied.

When you get a minute, could you also look at the View Filtered Data menu
option? The initial filter dialogue there seems to have the same problem,
plus the layout is a little messed up.

On Tue, Nov 14, 2017 at 5:25 PM, Murtuza Zabuawala <
murtuza.zabuaw...@enterprisedb.com> wrote:

> Hi,
>
> PFA minor patch to set proper cursor & focus on Filter editor window in
> view data mode.
>
> --
> Regards,
> Murtuza Zabuawala
> EnterpriseDB: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
>


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

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


Re: [pgAdmin4][Patch]: To make error message uniform for Create schema action

2017-11-16 Thread Dave Page
On Tue, Nov 14, 2017 at 5:56 PM, Murtuza Zabuawala <
murtuza.zabuaw...@enterprisedb.com> wrote:

> Hi,
>
> PFA minor patch to make error message uniform for 'Create schema' in both
> query tool and create schema dialog.
> RM#2094
>

The error message is definitely an improvement, but the dialogue title
needs work:

Error saving properties: GONE

Why does it have : GONE on the end? That seems unhelpful.

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

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


pgAdmin 4 commit: Display long names appropriately in dialogue headers.

2017-11-16 Thread Dave Page
Display long names appropriately in dialogue headers. Fixes #2278

Branch
--
master

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

Modified Files
--
web/pgadmin/static/scss/_alertify.overrides.scss | 2 ++
1 file changed, 2 insertions(+)



Re: [pgAdmin4][Patch]: Display long object name on alertify dialog header

2017-11-16 Thread Dave Page
Thanks, patch applied.

On Wed, Nov 15, 2017 at 9:51 AM, Murtuza Zabuawala <
murtuza.zabuaw...@enterprisedb.com> wrote:

> Hi,
>
> PFA minor patch to display database object names on alertify dialog header
> if they are long and user have low screen resolution.
> RM#2278
>
> --
> Regards,
> Murtuza Zabuawala
> EnterpriseDB: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
>


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

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


pgAdmin 4 commit: Python tests don't need to have JS dependencies insta

2017-11-16 Thread Dave Page
Python tests don't need to have JS dependencies installed.

Branch
--
master

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

Modified Files
--
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)



pgAdmin 4 commit: Current versions of Chrome need a newer driver for se

2017-11-16 Thread Dave Page
Current versions of Chrome need a newer driver for selenium tests.

Branch
--
master

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

Modified Files
--
web/regression/requirements.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)



Re: Fix for minor issue RM2868

2017-11-16 Thread Dave Page
Thanks, applied.

On Wed, Nov 15, 2017 at 10:35 AM, Harshal Dhumal <
harshal.dhu...@enterprisedb.com> wrote:

> Hi,
>
> Path to fix minor issue "local variable 'password' referenced before
> assignment."
>
>
> --
> *Harshal Dhumal*
> *Sr. Software Engineer*
>
> EnterpriseDB India: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>



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

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


pgAdmin 4 commit: Fix a referenced before assignment bug in connection

2017-11-16 Thread Dave Page
Fix a referenced before assignment bug in connection management. Fixes #2868

Branch
--
master

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

Modified Files
--
web/pgadmin/browser/server_groups/servers/__init__.py | 9 +++--
1 file changed, 3 insertions(+), 6 deletions(-)



[pgAdmin4][Patch]: To upgrade Selenium

2017-11-16 Thread Murtuza Zabuawala
Hi,

PFA patch to upgrade Selenium module to latest version.
Tested on Python3.6 and working fine with latest chrome webdriver.

--
Regards,
Murtuza Zabuawala
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
diff --git a/web/regression/requirements.txt b/web/regression/requirements.txt
index 183b963..b5b0146 100644
--- a/web/regression/requirements.txt
+++ b/web/regression/requirements.txt
@@ -1,5 +1,5 @@
 pyperclip~=1.5.27
-selenium==3.3.3
+selenium==3.7.0
 testscenarios==0.5.0
 testtools==2.0.0
 traceback2==1.4.0


Re: [pgAdmin4][Patch]: Allow user to choose background colour for server

2017-11-16 Thread Dave Page
Hi

Looks good. A few changes/suggestions:

- There seem to be some debugger calls left in the code, e.g. in editors.js
- Instead of bgcolor and font_color, lets use bgcolor and fgcolor
(foreground).
- The docs are (technically) en_US, so we should use color not colour in
them.
- If the colours have been set for a server, I think we should also colour
the title bar in the query tool. The only possible problem there is that
the current default colours are reversed in comparison to the treeview
(e.g. the treeview defaults to black text, whilst the query tool title bar
is white on blue. Not sure if that is really an issue or not.

What do you think?

On Wed, Nov 15, 2017 at 12:15 PM, Murtuza Zabuawala <
murtuza.zabuaw...@enterprisedb.com> wrote:

> Hi,
>
> Apologies but please find updated patch. Earlier I forgot to add copyright
> information in migration file.
>
> On Wed, Nov 15, 2017 at 4:58 PM, Murtuza Zabuawala  enterprisedb.com> wrote:
>
>> Hi,
>>
>> Please find updated patch.​
>>
>> On Wed, Nov 15, 2017 at 3:01 PM, Dave Page  wrote:
>>
>>>
>>>
>>> On Wed, Nov 15, 2017 at 9:26 AM, Ashesh Vashi <
>>> ashesh.va...@enterprisedb.com> wrote:
>>>
 On Wed, Nov 15, 2017 at 2:28 PM, Murtuza Zabuawala <
 murtuza.zabuaw...@enterprisedb.com> wrote:

> On Wed, Nov 15, 2017 at 1:20 PM, Ashesh Vashi <
> ashesh.va...@enterprisedb.com> wrote:
>
>> Hi Murtuza,
>>
>> On Wed, Nov 15, 2017 at 12:58 PM, Murtuza Zabuawala <
>> murtuza.zabuaw...@enterprisedb.com> wrote:
>>
>>> Hi,
>>>
>>> PFA new patch.
>>>
>> If I have reviewed correctly, the current patch allows to select the
>> colour for background color for server, and its children.
>> I believe - we should allow to select text color too for better
>> readability.
>>
>> ​Yes Ashesh, After our discussion I tried that but with all the
> different colours in browser tree it looks cartoonish.
>
 I am not sure - what looked like cartoonish to you (totally depend on
 the color choices made by the users). :-)

 If I choose any dark color as background color, text in nodes won't be
 clear to the user, and that will make the tree nodes completely unusable.
 If we allow to choose the foreground/text color, those dark colors will
 become usable by choosing suitable light color as text colors.

 I don't want to make any decision here, just asking for opinions from
 others.

 So - Again ball is back in Dave's courtyard :-).

>>>
>>> pgAdmin 3 didn't allow selection of the foreground colour, and I don't
>>> recall anyone ever asking for it. It's clearly up to the user to not select
>>> colours that won't work.
>>>
>>> I'm fine with just setting the background colour to satisfy this
>>> requirement, though if it's trivial to do, I have no objection to allowing
>>> changes to the foreground colour.
>>>
>>> --
>>> Dave Page
>>> Blog: http://pgsnake.blogspot.com
>>> Twitter: @pgsnake
>>>
>>> EnterpriseDB UK: http://www.enterprisedb.com
>>> The Enterprise PostgreSQL Company
>>>
>>
>>
>


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

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


Re: Next release

2017-11-16 Thread Dave Page
On Fri, Aug 25, 2017 at 9:34 AM, Dave Page  wrote:

>
>
> On Fri, Aug 25, 2017 at 9:28 AM, Harshal Dhumal <
> harshal.dhu...@enterprisedb.com> wrote:
>
>> One more thing that this will only work for future pgAdmin4 versions
>>
>
>
> Yeah :-(
>

Hmm, can you check this please? I'm getting the error below when using a
newer DB (that I tested an upgrade with) with an older code version:

Traceback (most recent call last):
  File "/Users/dpage/git/pgadmin4/web/pgAdmin4.py", line 67, in 
app = create_app()
  File "/Users/dpage/git/pgadmin4/web/pgadmin/__init__.py", line 303, in
create_app
db_upgrade(app)
  File "/Users/dpage/git/pgadmin4/web/pgadmin/setup/db_upgrade.py", line
25, in db_upgrade
flask_migrate.upgrade(migration_folder)
  File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-
packages/flask_migrate/__init__.py", line 244, in upgrade
command.upgrade(config, revision, sql=sql, tag=tag)
  File 
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/alembic/command.py",
line 254, in upgrade
script.run_env()
  File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-
packages/alembic/script/base.py", line 425, in run_env
util.load_python_file(self.dir, 'env.py')
  File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-
packages/alembic/util/pyfiles.py", line 81, in load_python_file
module = load_module_py(module_id, path)
  File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-
packages/alembic/util/compat.py", line 141, in load_module_py
mod = imp.load_source(module_id, path, fp)
  File "/Users/dpage/git/pgadmin4/web/pgadmin/setup/../../migrations/env.py",
line 94, in 
run_migrations_online()
  File "/Users/dpage/git/pgadmin4/web/pgadmin/setup/../../migrations/env.py",
line 87, in run_migrations_online
context.run_migrations()
  File "", line 8, in run_migrations
  File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-
packages/alembic/runtime/environment.py", line 836, in run_migrations
self.get_context().run_migrations(**kw)
  File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-
packages/alembic/runtime/migration.py", line 321, in run_migrations
for step in self._migrations_fn(heads, self):
  File 
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/alembic/command.py",
line 243, in upgrade
return script._upgrade_revs(revision, rev)
  File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-
packages/alembic/script/base.py", line 338, in _upgrade_revs
for script in reversed(list(revs))
  File 
"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/contextlib.py",
line 35, in __exit__
self.gen.throw(type, value, traceback)
  File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-
packages/alembic/script/base.py", line 174, in _catch_revision_errors
compat.raise_from_cause(util.CommandError(resolution))
  File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-
packages/alembic/util/compat.py", line 205, in raise_from_cause
reraise(type(exception), exception, tb=exc_tb)
  File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-
packages/alembic/script/base.py", line 143, in _catch_revision_errors
yield
  File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-
packages/alembic/script/base.py", line 334, in _upgrade_revs
revs = list(revs)
  File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-
packages/alembic/script/revision.py", line 645, in _iterate_revisions
requested_lowers = self.get_revisions(lower)
  File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-
packages/alembic/script/revision.py", line 299, in get_revisions
return sum([self.get_revisions(id_elem) for id_elem in id_], ())
  File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-
packages/alembic/script/revision.py", line 304, in get_revisions
for rev_id in resolved_id)
  File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-
packages/alembic/script/revision.py", line 304, in 
for rev_id in resolved_id)
  File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-
packages/alembic/script/revision.py", line 362, in _revision_for_ident
resolved_id)
alembic.util.exc.CommandError: Can't locate revision identified by
'02b9dccdcfcb'


>
>
>>
>> --
>> *Harshal Dhumal*
>> *Sr. Software Engineer*
>>
>> EnterpriseDB India: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>>
>> On Fri, Aug 25, 2017 at 1:48 PM, Dave Page  wrote:
>>
>>>
>>>
>>> On Fri, Aug 25, 2017 at 9:15 AM, Surinder Kumar <
>>> surinder.ku...@enterprisedb.com> wrote:
>>>
 ​Hi​

 On Fri, Aug 25, 2017 at 12:21 PM, Ashesh Vashi <
 ashesh.va...@enterprisedb.com> wrote:

> On Fri, Aug 25, 2017 at 12:16 PM, Surinder Kumar <
> surinder.ku...@enterprisedb.com> wrote:
>
>> Hi
>> On Fri, Aug 25, 2017 at 1:03 AM, Dave Page  wrote:
>>
>>>
>>>
>>> On Thu, Aug 24, 2017 at 8:28 PM, Harshal Dhumal <
>>> harshal.

[pgAdmin4][patch][runtime]: RM#2829, RM#2491 - pgAdmin4 crashes while saving CSV data from Query tool

2017-11-16 Thread Neel Patel
Hi,

I am able to reproduce the crash while downloading and save data in CSV
file from query tool.

Please find attached updated patch with below changes after reading Qt
documentation.

   - Added new signal "readyRead". As per the Qt documentation, this signal
   will be emitted when data is ready from IO channel for large amount of data
   transfer between server and client.
   - Ready read and DownloadInProgress signal is very quick in call so we
   should not do large operation inside that slot because for downloading big
   data it may possible of frequent call of those signals which may cause the
   crash or missing data to write inside the file so removed unnecessary logic
   from that slot.
   - Fixed the crash while opening IODevice with NULL handle.

With above changes, I have tested with same data as earlier and it is
working as expected without crashing the application.

Do review it and let me know for comments.

Thanks,
Neel Patel


RM_2829_RM_2491.patch
Description: Binary data


Re: [pgAdmin4][patch][runtime]: RM#2829, RM#2491 - pgAdmin4 crashes while saving CSV data from Query tool

2017-11-16 Thread Neel Patel
Hi,

Adding information.

With this patch, RM#2715 should also be resolved.

Thanks,
Neel Patel

On Thu, Nov 16, 2017 at 7:01 PM, Neel Patel 
wrote:

> Hi,
>
> I am able to reproduce the crash while downloading and save data in CSV
> file from query tool.
>
> Please find attached updated patch with below changes after reading Qt
> documentation.
>
>- Added new signal "readyRead". As per the Qt documentation, this
>signal will be emitted when data is ready from IO channel for large amount
>of data transfer between server and client.
>- Ready read and DownloadInProgress signal is very quick in call so we
>should not do large operation inside that slot because for downloading big
>data it may possible of frequent call of those signals which may cause the
>crash or missing data to write inside the file so removed unnecessary logic
>from that slot.
>- Fixed the crash while opening IODevice with NULL handle.
>
> With above changes, I have tested with same data as earlier and it is
> working as expected without crashing the application.
>
> Do review it and let me know for comments.
>
> Thanks,
> Neel Patel
>


[pgAdmin4][Patch]: To fix issues in Boolean editor

2017-11-16 Thread Murtuza Zabuawala
Hi,

PFA patch to fix the issue in boolean editor & also corrected feature test.
RM#2848

--
Regards,
Murtuza Zabuawala
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
diff --git a/web/pgadmin/feature_tests/view_data_dml_queries.py 
b/web/pgadmin/feature_tests/view_data_dml_queries.py
index 153d796..bb9d688 100644
--- a/web/pgadmin/feature_tests/view_data_dml_queries.py
+++ b/web/pgadmin/feature_tests/view_data_dml_queries.py
@@ -197,9 +197,6 @@ CREATE TABLE public.defaults
 if data[1] == 'true':
 checkbox_el = cell_el.find_element_by_xpath(".//input")
 checkbox_el.click()
-
ActionChains(self.driver).move_to_element(checkbox_el).double_click(
-checkbox_el
-).perform()
 
 def _tables_node_expandable(self):
 self.page.toggle_open_tree_item(self.server['name'])
diff --git a/web/pgadmin/static/js/slickgrid/editors.js 
b/web/pgadmin/static/js/slickgrid/editors.js
index 80f7cce..9d5986f 100644
--- a/web/pgadmin/static/js/slickgrid/editors.js
+++ b/web/pgadmin/static/js/slickgrid/editors.js
@@ -545,7 +545,7 @@
*/
   function CheckboxEditor(args) {
 var $select, el;
-var defaultValue;
+var defaultValue, previousState;
 var scope = this;
 
 this.init = function () {
@@ -564,22 +564,31 @@
   checkbox_status = 1;
 }
 switch(checkbox_status) {
-  // unchecked, going indeterminate
+  // State 0 will come when we had indeterminate state
   case 0:
-el.prop('indeterminate', true);
-el.data('checked', 2); // determines next checkbox status
+// We will check now
+el.prop('checked', true);
+el.data('checked', 1);
 break;
 
-  // indeterminate, going checked
+  // State 1 will come when we had checked state
   case 1:
-el.prop('checked', true);
+// We will uncheck now
+el.prop('checked', false);
+el.data('checked', 2);
+break;
+
+  // State 2 will come when we had unchecked state
+  case 2:
+// We will set to indeterminate state
+el.prop('indeterminate', true);
 el.data('checked', 0);
 break;
 
-  // checked, going unchecked
+  // Default, Set to indeterminate state
   default:
-el.prop('checked', false);
-el.data('checked', 1);
+el.prop('indeterminate', true);
+el.data('checked', 0);
 }
   });
 };
@@ -594,18 +603,21 @@
 
 this.loadValue = function (item) {
   defaultValue = item[args.column.field];
+  previousState = 0;
   if (_.isNull(defaultValue)||_.isUndefined(defaultValue)) {
 $select.prop('indeterminate', true);
-$select.data('checked', 2);
+$select.data('checked', 0);
   }
   else {
 defaultValue = !!item[args.column.field];
 if (defaultValue) {
   $select.prop('checked', true);
-  $select.data('checked', 0);
+  $select.data('checked', 1);
+  previousState = 1;
 } else {
   $select.prop('checked', false);
-  $select.data('checked', 1);
+  $select.data('checked', 2);
+  previousState = 2;
 }
   }
 };
@@ -622,10 +634,8 @@
 };
 
 this.isValueChanged = function () {
-  // var select_value = this.serializeValue();
-  var select_value = $select.data('checked');
-  return (!(select_value === 2 && (defaultValue == null || defaultValue == 
undefined))) &&
-(select_value !== defaultValue);
+  var currentState = $select.data('checked');
+  return currentState !== previousState;
 };
 
 this.validate = function () {


Re: [pgAdmin4][Patch]: RM #2781 - New option to set the quotation mark for copying to clipboard.

2017-11-16 Thread Dave Page
Hi

On Thu, Nov 16, 2017 at 10:01 AM, Khushboo Vashi <
khushboo.va...@enterprisedb.com> wrote:

> Hi,
>
> Please find the attached patch for RM #2781 : New option to set the
> quotation mark for copying to clipboard.
>
> This patch includes:
>
> - Provide options in preferences to control the CSV output which includes
> copy to clipboard and download as CSV features in Query Tool
> - Modified related jasmine tests
> - Modified related feature tests
>

Thanks. At first glance, I see a few issues with this patch:

- I can type into the combo boxes in the preferences, but only to search.
That means (for example) that the only quote character I can use is ". I
can't use anything else as a might want. The same applies to the field
separator.

- I can click the x to clear the options in the combo boxes, but then the
settings can be accepted and stored. For the separator and quote char, I
assume they just become blank, however the quoting method makes no sense to
be unspecified.

- There don't seem to be any documentation updates.

- The CSV Quoting options appear to apply to copying from the grid, but
they should apply to saving results as CSV.

- The Result Copy quoting options (which should apply to copied data) are
missing altogether.

To be clear, there should be 6 new config options, 3 of which apply to data
when copied from the grid, and the other 3 which apply when saving data as
CSV. Please see the original RM case in which I detailed what the settings
should be and what they should do.

Thanks.

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

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


pgAdmin 4 commit: Update selenium version

2017-11-16 Thread Dave Page
Update selenium version

Branch
--
master

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

Modified Files
--
web/regression/requirements.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)



Re: [pgAdmin4][Patch]: To upgrade Selenium

2017-11-16 Thread Dave Page
Thanks, applied.

On Thu, Nov 16, 2017 at 12:52 PM, Murtuza Zabuawala <
murtuza.zabuaw...@enterprisedb.com> wrote:

> Hi,
>
> PFA patch to upgrade Selenium module to latest version.
> Tested on Python3.6 and working fine with latest chrome webdriver.
>
> --
> Regards,
> Murtuza Zabuawala
> EnterpriseDB: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
>


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

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


Re: [pgAdmin4][patch][runtime]: RM#2829, RM#2491 - pgAdmin4 crashes while saving CSV data from Query tool

2017-11-16 Thread Dave Page
Hi

On Thu, Nov 16, 2017 at 1:47 PM, Neel Patel 
wrote:

> Hi,
>
> Adding information.
>
> With this patch, RM#2715 should also be resolved.
>
> Thanks,
> Neel Patel
>
> On Thu, Nov 16, 2017 at 7:01 PM, Neel Patel 
> wrote:
>
>> Hi,
>>
>> I am able to reproduce the crash while downloading and save data in CSV
>> file from query tool.
>>
>> Please find attached updated patch with below changes after reading Qt
>> documentation.
>>
>>- Added new signal "readyRead". As per the Qt documentation, this
>>signal will be emitted when data is ready from IO channel for large amount
>>of data transfer between server and client.
>>- Ready read and DownloadInProgress signal is very quick in call so
>>we should not do large operation inside that slot because for downloading
>>big data it may possible of frequent call of those signals which may cause
>>the crash or missing data to write inside the file so removed unnecessary
>>logic from that slot.
>>- Fixed the crash while opening IODevice with NULL handle.
>>
>> With above changes, I have tested with same data as earlier and it is
>> working as expected without crashing the application.
>>
>> Do review it and let me know for comments.
>>
>
My first test was on Mac using Qt 5.8 with webkit, and when I attempted to
download the results from a 300K row query, it basically hung showing the
Downloading File progress indicator. It let me cancel it and carried on
working, but hung again the next time I tried the CSV download. Each time
it seems to download some data - from the same query I've seen 2.8MB, 5.1MB
and 1.5MB.

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

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


Re: [pgAdmin4][Patch]: RM #2781 - New option to set the quotation mark for copying to clipboard.

2017-11-16 Thread Khushboo Vashi
Hi Dave,

Thanks for reviewing the patch.

On Thu, Nov 16, 2017 at 7:42 PM, Dave Page  wrote:

> Hi
>
> On Thu, Nov 16, 2017 at 10:01 AM, Khushboo Vashi <
> khushboo.va...@enterprisedb.com> wrote:
>
>> Hi,
>>
>> Please find the attached patch for RM #2781 : New option to set the
>> quotation mark for copying to clipboard.
>>
>> This patch includes:
>>
>> - Provide options in preferences to control the CSV output which includes
>> copy to clipboard and download as CSV features in Query Tool
>> - Modified related jasmine tests
>> - Modified related feature tests
>>
>
> Thanks. At first glance, I see a few issues with this patch:
>
> - I can type into the combo boxes in the preferences, but only to search.
> That means (for example) that the only quote character I can use is ". I
> can't use anything else as a might want. The same applies to the field
> separator.
>
> - I can click the x to clear the options in the combo boxes, but then the
> settings can be accepted and stored. For the separator and quote char, I
> assume they just become blank, however the quoting method makes no sense to
> be unspecified.
>
> Will fix above issues.


> - There don't seem to be any documentation updates.
>
> Will do.

> - The CSV Quoting options appear to apply to copying from the grid, but
> they should apply to saving results as CSV.
>
>
All 3 CSV options are applicable for both, copying from grid and download
as CSV as I understood this way.
I had a doubt regarding this and have asked regarding this in the ticket
but didn't get reply, so implemented this way.
Now I understood correctly, so will change accordingly.


> - The Result Copy quoting options (which should apply to copied data) are
> missing altogether.
>
> To be clear, there should be 6 new config options, 3 of which apply to
> data when copied from the grid, and the other 3 which apply when saving
> data as CSV. Please see the original RM case in which I detailed what the
> settings should be and what they should do.
>
> Thanks.
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>

Thanks,
Khushboo


Build failed in Jenkins: pgadmin4-master-python26 #510

2017-11-16 Thread pgAdmin 4 Jenkins
See 


Changes:

[Dave Page] Update selenium version

--
Started by an SCM change
Started by an SCM change
Started by an SCM change
Started by an SCM change
Started by an SCM change
Started by an SCM change
Started by an SCM change
Started by an SCM change
Started by an SCM change
Started by an SCM change
[EnvInject] - Loading node environment variables.
Building in workspace 

 > git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
 > git config remote.origin.url git://git.postgresql.org/git/pgadmin4.git # 
 > timeout=10
Cleaning workspace
 > git rev-parse --verify HEAD # timeout=10
Resetting working tree
 > git reset --hard # timeout=10
 > git clean -fdx # timeout=10
Fetching upstream changes from git://git.postgresql.org/git/pgadmin4.git
 > git --version # timeout=10
 > git fetch --tags --progress git://git.postgresql.org/git/pgadmin4.git 
 > +refs/heads/*:refs/remotes/origin/*
 > git rev-parse origin/master^{commit} # timeout=10
Checking out Revision 2f17ecba760dcb210b6bf70b259860dd569a7888 (origin/master)
Commit message: "Update selenium version"
 > git config core.sparsecheckout # timeout=10
 > git checkout -f 2f17ecba760dcb210b6bf70b259860dd569a7888
 > git rev-list 051788d040049682cbde78c4bb5343f92b4eb5a2 # timeout=10
[EnvInject] - Executing scripts and injecting environment variables after the 
SCM step.
[EnvInject] - Injecting as environment variables the properties content 
PYTHON_VERSION=2.6

[EnvInject] - Variables injected successfully.
[pgadmin4-master-python26] $ /bin/sh -xe /tmp/jenkins8163038226280116557.sh
+ 
EXECUTING: Create pgAdmin config

EXECUTING: Python tests

Creating Python 2.6 virtual environment...

New python executable in 

Installing setuptools, pip...done.
Running virtualenv with interpreter /usr/local/python-2.6/bin/python
DEPRECATION: Python 2.6 is no longer supported by the Python core team, please 
upgrade your Python. A future version of pip will drop support for Python 2.6
Collecting wheel==0.29.0
:318:
 SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name 
Indication) extension to TLS is not available on this platform. This may cause 
the server to present an incorrect TLS certificate, which can cause validation 
failures. You can upgrade to a newer version of Python to solve this. For more 
information, see 
https://urllib3.readthedocs.io/en/latest/security.html#snimissingwarning.
  SNIMissingWarning
:122:
 InsecurePlatformWarning: A true SSLContext object is not available. This 
prevents urllib3 from configuring SSL appropriately and may cause certain SSL 
connections to fail. You can upgrade to a newer version of Python to solve 
this. For more information, see 
https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
  Using cached wheel-0.29.0-py2.py3-none-any.whl
Collecting argparse; python_version == "2.6" (from wheel==0.29.0)
  Using cached argparse-1.4.0-py2.py3-none-any.whl
Installing collected packages: argparse, wheel
Successfully installed argparse-1.4.0 wheel-0.29.0
DEPRECATION: Python 2.6 is no longer supported by the Python core team, please 
upgrade your Python. A future version of pip will drop support for Python 2.6
Ignoring Flask-HTMLmin: markers 'python_version >= "2.7"' don't match your 
environment
Collecting Babel==2.3.4 (from -r requirements.txt (line 4))
:318:
 SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name 
Indication) extension to TLS is not available on this platform. This may cause 
the server to present an incorrect TLS certificate, which can cause validation 
failures. You can upgrade to a newer version of Python to solve this. For more 
information, see 
https://urllib3.readthedocs.io/en/latest/security.html#snimissingwarning.
  SNIMissingWarning
:122:
 InsecurePlatformWarning: A true SSLContext object is not available. This 
prevents urllib3 from configuring SSL appropriately and may cause certain SSL 
connections to fail. You can upgrade t

Re: [pgAdmin4][Patch]: To fix issues in Boolean editor

2017-11-16 Thread Dave Page
Hi

On Thu, Nov 16, 2017 at 2:04 PM, Murtuza Zabuawala <
murtuza.zabuaw...@enterprisedb.com> wrote:

> Hi,
>
> PFA patch to fix the issue in boolean editor & also corrected feature test.
> RM#2848
>

Testing in webkit on Mac (Qt 5.8), the problem does not appear to be solved
for me. I have run make bundle, and restarted the runtime multiple times.


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

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


Re: [pgAdmin4][Patch]: To fix issues in Boolean editor

2017-11-16 Thread Murtuza Zabuawala
Hi Dave,

On Thu, Nov 16, 2017 at 8:59 PM, Dave Page  wrote:

> Hi
>
> On Thu, Nov 16, 2017 at 2:04 PM, Murtuza Zabuawala  enterprisedb.com> wrote:
>
>> Hi,
>>
>> PFA patch to fix the issue in boolean editor & also corrected feature
>> test.
>> RM#2848
>>
>
> Testing in webkit on Mac (Qt 5.8), the problem does not appear to be
> solved for me. I have run make bundle, and restarted the runtime multiple
> times.
>
​I tested in Chrome and it was working as expected, Have you tested patch
with browser?​


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


Re: [pgAdmin4][Patch]: To fix issues in Boolean editor

2017-11-16 Thread Dave Page
On Thu, Nov 16, 2017 at 4:30 PM, Murtuza Zabuawala <
murtuza.zabuaw...@enterprisedb.com> wrote:

> Hi Dave,
>
> On Thu, Nov 16, 2017 at 8:59 PM, Dave Page  wrote:
>
>> Hi
>>
>> On Thu, Nov 16, 2017 at 2:04 PM, Murtuza Zabuawala <
>> murtuza.zabuaw...@enterprisedb.com> wrote:
>>
>>> Hi,
>>>
>>> PFA patch to fix the issue in boolean editor & also corrected feature
>>> test.
>>> RM#2848
>>>
>>
>> Testing in webkit on Mac (Qt 5.8), the problem does not appear to be
>> solved for me. I have run make bundle, and restarted the runtime multiple
>> times.
>>
> ​I tested in Chrome and it was working as expected, Have you tested patch
> with browser?​
>
>

It works fine in Chrome... but then, it was never broken there for me!

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

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


Re: Next release

2017-11-16 Thread Murtuza Zabuawala
Hi Dave,

There is no programmatic way of fixing the issue if you have already
deleted the new migration file without downgrading via alembic downgrade
command.
The only way I know is to manually update 'alembic_version' table in
pgAdmin4.db to current revision which is 'ef590e979b0d'

​-- Murtuza​


On Thu, Nov 16, 2017 at 6:58 PM, Dave Page  wrote:

>
>
> On Fri, Aug 25, 2017 at 9:34 AM, Dave Page  wrote:
>
>>
>>
>> On Fri, Aug 25, 2017 at 9:28 AM, Harshal Dhumal <
>> harshal.dhu...@enterprisedb.com> wrote:
>>
>>> One more thing that this will only work for future pgAdmin4 versions
>>>
>>
>>
>> Yeah :-(
>>
>
> Hmm, can you check this please? I'm getting the error below when using a
> newer DB (that I tested an upgrade with) with an older code version:
>
> Traceback (most recent call last):
>   File "/Users/dpage/git/pgadmin4/web/pgAdmin4.py", line 67, in 
> app = create_app()
>   File "/Users/dpage/git/pgadmin4/web/pgadmin/__init__.py", line 303, in
> create_app
> db_upgrade(app)
>   File "/Users/dpage/git/pgadmin4/web/pgadmin/setup/db_upgrade.py", line
> 25, in db_upgrade
> flask_migrate.upgrade(migration_folder)
>   File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packa
> ges/flask_migrate/__init__.py", line 244, in upgrade
> command.upgrade(config, revision, sql=sql, tag=tag)
>   File 
> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/alembic/command.py",
> line 254, in upgrade
> script.run_env()
>   File 
> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/alembic/script/base.py",
> line 425, in run_env
> util.load_python_file(self.dir, 'env.py')
>   File 
> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/alembic/util/pyfiles.py",
> line 81, in load_python_file
> module = load_module_py(module_id, path)
>   File 
> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/alembic/util/compat.py",
> line 141, in load_module_py
> mod = imp.load_source(module_id, path, fp)
>   File "/Users/dpage/git/pgadmin4/web/pgadmin/setup/../../migrations/env.py",
> line 94, in 
> run_migrations_online()
>   File "/Users/dpage/git/pgadmin4/web/pgadmin/setup/../../migrations/env.py",
> line 87, in run_migrations_online
> context.run_migrations()
>   File "", line 8, in run_migrations
>   File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packa
> ges/alembic/runtime/environment.py", line 836, in run_migrations
> self.get_context().run_migrations(**kw)
>   File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packa
> ges/alembic/runtime/migration.py", line 321, in run_migrations
> for step in self._migrations_fn(heads, self):
>   File 
> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/alembic/command.py",
> line 243, in upgrade
> return script._upgrade_revs(revision, rev)
>   File 
> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/alembic/script/base.py",
> line 338, in _upgrade_revs
> for script in reversed(list(revs))
>   File 
> "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/contextlib.py",
> line 35, in __exit__
> self.gen.throw(type, value, traceback)
>   File 
> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/alembic/script/base.py",
> line 174, in _catch_revision_errors
> compat.raise_from_cause(util.CommandError(resolution))
>   File 
> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/alembic/util/compat.py",
> line 205, in raise_from_cause
> reraise(type(exception), exception, tb=exc_tb)
>   File 
> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/alembic/script/base.py",
> line 143, in _catch_revision_errors
> yield
>   File 
> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/alembic/script/base.py",
> line 334, in _upgrade_revs
> revs = list(revs)
>   File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packa
> ges/alembic/script/revision.py", line 645, in _iterate_revisions
> requested_lowers = self.get_revisions(lower)
>   File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packa
> ges/alembic/script/revision.py", line 299, in get_revisions
> return sum([self.get_revisions(id_elem) for id_elem in id_], ())
>   File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packa
> ges/alembic/script/revision.py", line 304, in get_revisions
> for rev_id in resolved_id)
>   File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packa
> ges/alembic/script/revision.py", line 304, in 
> for rev_id in resolved_id)
>   File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packa
> ges/alembic/script/revision.py", line 362, in _revision_for_ident
> resolved_id)
> alembic.util.exc.CommandError: Can't locate revision identified by
> '02b9dccdcfcb'
>
>
>>
>>
>>>
>>> --
>>> *Harshal Dhumal*
>>> *Sr. Software Engineer*
>>>
>>> EnterpriseDB India: http://www.enterprisedb.com
>>> The Enterprise PostgreSQL Company