Re: [pgAdmin4][Patch] To fix the issue in Debugger module

2017-06-27 Thread Murtuza Zabuawala
Hi Dave

Please find updated patch,

On Fri, Jun 23, 2017 at 7:09 PM, Dave Page  wrote:

> Hi
>
> I'm unable to properly test this, as the debugger doesn't even seem to
> launch for a non-superuser. I just get a white tab, and a whole lot of
> polling indefinitely. Can you debug if you're not a superuser, but you
> own the function?
>
> I tested this scenario both ways,
1) Direct debugging: I was able to debug function, when debugger library is
loaded via shared preload libraries and also when it is not loaded.
2) Indirect debugging: I was not able to debug.
So, I have added the validation in both Server and Client side, Now we will
not show the option for the same if user is non-super user.

Looking at the patch itself, I wonder if the logic is still a little
> off. You need to be a superuser to use indirect debugging (because of
> the DOS potential), so shouldn't the superuser check be changed to "if
> !superuser then throw error"? As it is, if you're not superuser then
> it just skips the check for the plugin, which seems like it'll never
> end well.
>
> Fixed.

>
> On Fri, Jun 23, 2017 at 1:35 PM, Murtuza Zabuawala
>  wrote:
> > Hi Dave,
> >
> > Please find updated patch.
> >
> > --
> > Regards,
> > Murtuza Zabuawala
> > EnterpriseDB: http://www.enterprisedb.com
> > The Enterprise PostgreSQL Company
> >
> > On Fri, Jun 23, 2017 at 2:38 PM, Murtuza Zabuawala
> >  wrote:
> >>
> >> Yes, I'm looking into it, I will send updated patch.
> >>
> >> --
> >> Regards,
> >> Murtuza Zabuawala
> >> EnterpriseDB: http://www.enterprisedb.com
> >> The Enterprise PostgreSQL Company
> >>
> >> On Fri, Jun 23, 2017 at 2:32 PM, Dave Page  wrote:
> >>>
> >>> On Fri, Jun 23, 2017 at 9:56 AM, Murtuza Zabuawala
> >>>  wrote:
> >>> > Yes Dave,
> >>> >
> >>> > You are right, I tested and found that indirect debugging is not
> >>> > working.
> >>> > But otherwise for direct debugging it works properly.
> >>>
> >>> Does the patch take that into account, or are you modifying it?
> >>>
> >>> > On Fri, Jun 23, 2017 at 1:20 PM, Dave Page 
> wrote:
> >>> >>
> >>> >> On Fri, Jun 23, 2017 at 7:16 AM, Murtuza Zabuawala
> >>> >>  wrote:
> >>> >> > Hi,
> >>> >> >
> >>> >> > PFA patch to fix the issue in Debugger module where it was unable
> to
> >>> >> > start
> >>> >> > debugging if 'plugin_debugger' can not found in
> >>> >> > shared_preload_libraries.
> >>> >> > RM#2162
> >>> >> >
> >>> >> > Original patch by: Kit Yam Tse
> >>> >> > (who reported the issue)
> >>> >> >
> >>> >> > I just re-based it against current code.
> >>> >>
> >>> >> Isn't that code required? We do need plugin_debugger to be present
> for
> >>> >> global (indirect) debugging to work. I suppose it may not be
> required
> >>> >> for direct debugging, but I haven't tested that.
> >>> >>
> >>> >>
> >>> >> --
> >>> >> Dave Page
> >>> >> Blog: http://pgsnake.blogspot.com
> >>> >> Twitter: @pgsnake
> >>> >>
> >>> >> EnterpriseDB UK: http://www.enterprisedb.com
> >>> >> The Enterprise PostgreSQL Company
> >>> >
> >>> >
> >>>
> >>>
> >>>
> >>> --
> >>> Dave Page
> >>> Blog: http://pgsnake.blogspot.com
> >>> Twitter: @pgsnake
> >>>
> >>> EnterpriseDB UK: http://www.enterprisedb.com
> >>> The Enterprise PostgreSQL Company
> >>
> >>
> >
>
>
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>


RM_2162_v2.patch
Description: Binary data


crypto.py bug on server add form (button save) with python 3.5 - Can't convert 'bytes' object to str implicitly

2017-06-27 Thread Ladislav Jech
I am running on following Gentoo system with Python 3.5 as default
(although i have 2.7 and 3.4 available to switch as well).

I compiled from source code via github:
commit 15cb9fc35b41736a331a452b9303a79e8f13ee36 (HEAD -> master,
origin/master, origin/HEAD)

The error appears when I want to click on Save while adding new server to
the list, I put few lines into the code to detect the times:
2017-06-27 13:21:48,329: DEBUG pgadmin: Not running under the desktop
runtime, port: 5050
Starting pgAdmin 4. Please navigate to http://127.0.0.1:5050 in your
browser.
str var python type is 
str var object's type is str
padding_string var python type is 
padding_string var object's type is bytes
2017-06-27 13:21:53,028: ERROR pgadmin: Can't convert 'bytes' object to str
implicitly
Traceback (most recent call last):
  File
"/home/zangetsu/devel/tmp/pgadmin4/web/pgadmin/browser/server_groups/servers/__init__.py",
line 619, in create
password = encrypt(password, current_user.password)
  File "/home/zangetsu/devel/tmp/pgadmin4/web/pgadmin/utils/crypto.py",
line 31, in encrypt
cipher = AES.new(pad(key), AES.MODE_CFB, iv)
  File "/home/zangetsu/devel/tmp/pgadmin4/web/pgadmin/utils/crypto.py",
line 80, in pad
return str + ((32 - len(str) % 32) * padding_string)
TypeError: Can't convert 'bytes' object to str implicitly
2017-06-27 13:21:53,031: INFO werkzeug: 127.0.0.1 - - [27/Jun/2017
13:21:53] "POST /browser/server/obj/2/ HTTP/1.1" 410 -
2017-06-27 13:22:49,936: INFO werkzeug: * Detected change in
'/home/zangetsu/devel/tmp/pgadmin4/web/pgadmin/utils/crypto.py', reloading
2017-06-27 13:22:50,138: INFO werkzeug: * Restarting with reloader

So this is the error:
Can't convert 'bytes' object to str implicitly

To fix this on Python 3.5 I simply changed in
pgadmin4/web/pgadmin/utils/crypto.py file this line:
return str + ((32 - len(str) % 32) * padding_string)
to
return str + ((32 - len(str) % 32) * padding_string.decode())

Another solution could be to change whole str into bytes. Not sure what is
better, but now it works.


Re: crypto.py bug on server add form (button save) with python 3.5 - Can't convert 'bytes' object to str implicitly

2017-06-27 Thread Khushboo Vashi
Hi,

Can you send the patch for the same. I think this is the valid fix.

Thanks,
Khushboo

On Tue, Jun 27, 2017 at 3:02 PM, Ladislav Jech  wrote:

> I am running on following Gentoo system with Python 3.5 as default
> (although i have 2.7 and 3.4 available to switch as well).
>
> I compiled from source code via github:
> commit 15cb9fc35b41736a331a452b9303a79e8f13ee36 (HEAD -> master,
> origin/master, origin/HEAD)
>
> The error appears when I want to click on Save while adding new server to
> the list, I put few lines into the code to detect the times:
> 2017-06-27 13:21:48,329: DEBUG pgadmin: Not running under the desktop
> runtime, port: 5050
> Starting pgAdmin 4. Please navigate to http://127.0.0.1:5050 in your
> browser.
> str var python type is 
> str var object's type is str
> padding_string var python type is 
> padding_string var object's type is bytes
> 2017-06-27 13:21:53,028: ERROR pgadmin: Can't convert 'bytes' object to
> str implicitly
> Traceback (most recent call last):
>   File "/home/zangetsu/devel/tmp/pgadmin4/web/pgadmin/browser/
> server_groups/servers/__init__.py", line 619, in create
> password = encrypt(password, current_user.password)
>   File "/home/zangetsu/devel/tmp/pgadmin4/web/pgadmin/utils/crypto.py",
> line 31, in encrypt
> cipher = AES.new(pad(key), AES.MODE_CFB, iv)
>   File "/home/zangetsu/devel/tmp/pgadmin4/web/pgadmin/utils/crypto.py",
> line 80, in pad
> return str + ((32 - len(str) % 32) * padding_string)
> TypeError: Can't convert 'bytes' object to str implicitly
> 2017-06-27 13:21:53,031: INFO werkzeug: 127.0.0.1 - - [27/Jun/2017
> 13:21:53] "POST /browser/server/obj/2/ HTTP/1.1" 410 -
> 2017-06-27 13:22:49,936: INFO werkzeug: * Detected change in
> '/home/zangetsu/devel/tmp/pgadmin4/web/pgadmin/utils/crypto.py', reloading
> 2017-06-27 13:22:50,138: INFO werkzeug: * Restarting with reloader
>
> So this is the error:
> Can't convert 'bytes' object to str implicitly
>
> To fix this on Python 3.5 I simply changed in 
> pgadmin4/web/pgadmin/utils/crypto.py
> file this line:
> return str + ((32 - len(str) % 32) * padding_string)
> to
> return str + ((32 - len(str) % 32) * padding_string.decode())
>
> Another solution could be to change whole str into bytes. Not sure what is
> better, but now it works.
>


Re: crypto.py bug on server add form (button save) with python 3.5 - Can't convert 'bytes' object to str implicitly

2017-06-27 Thread Ladislav Jech
Hi,
It will be good if you support fully github or any GIT repository for
managing pull requests. Is there any or you wan't me to generate *.patch
file? I am new to pgadmin 4, so not sure how this works. Let me know.
Ladislav

2017-06-27 11:52 GMT+02:00 Khushboo Vashi :

> Hi,
>
> Can you send the patch for the same. I think this is the valid fix.
>
> Thanks,
> Khushboo
>
> On Tue, Jun 27, 2017 at 3:02 PM, Ladislav Jech 
> wrote:
>
>> I am running on following Gentoo system with Python 3.5 as default
>> (although i have 2.7 and 3.4 available to switch as well).
>>
>> I compiled from source code via github:
>> commit 15cb9fc35b41736a331a452b9303a79e8f13ee36 (HEAD -> master,
>> origin/master, origin/HEAD)
>>
>> The error appears when I want to click on Save while adding new server to
>> the list, I put few lines into the code to detect the times:
>> 2017-06-27 13:21:48,329: DEBUG pgadmin: Not running under the desktop
>> runtime, port: 5050
>> Starting pgAdmin 4. Please navigate to http://127.0.0.1:5050 in your
>> browser.
>> str var python type is 
>> str var object's type is str
>> padding_string var python type is 
>> padding_string var object's type is bytes
>> 2017-06-27 13:21:53,028: ERROR pgadmin: Can't convert 'bytes' object to
>> str implicitly
>> Traceback (most recent call last):
>>   File 
>> "/home/zangetsu/devel/tmp/pgadmin4/web/pgadmin/browser/server_groups/servers/__init__.py",
>> line 619, in create
>> password = encrypt(password, current_user.password)
>>   File "/home/zangetsu/devel/tmp/pgadmin4/web/pgadmin/utils/crypto.py",
>> line 31, in encrypt
>> cipher = AES.new(pad(key), AES.MODE_CFB, iv)
>>   File "/home/zangetsu/devel/tmp/pgadmin4/web/pgadmin/utils/crypto.py",
>> line 80, in pad
>> return str + ((32 - len(str) % 32) * padding_string)
>> TypeError: Can't convert 'bytes' object to str implicitly
>> 2017-06-27 13:21:53,031: INFO werkzeug: 127.0.0.1 - - [27/Jun/2017
>> 13:21:53] "POST /browser/server/obj/2/ HTTP/1.1" 410 -
>> 2017-06-27 13:22:49,936: INFO werkzeug: * Detected change in
>> '/home/zangetsu/devel/tmp/pgadmin4/web/pgadmin/utils/crypto.py',
>> reloading
>> 2017-06-27 13:22:50,138: INFO werkzeug: * Restarting with reloader
>>
>> So this is the error:
>> Can't convert 'bytes' object to str implicitly
>>
>> To fix this on Python 3.5 I simply changed in
>> pgadmin4/web/pgadmin/utils/crypto.py file this line:
>> return str + ((32 - len(str) % 32) * padding_string)
>> to
>> return str + ((32 - len(str) % 32) * padding_string.decode())
>>
>> Another solution could be to change whole str into bytes. Not sure what
>> is better, but now it works.
>>
>
>


pgAdmin 4 commit: Use on-demand loading for results in the query tool.

2017-06-27 Thread Dave Page
Use on-demand loading for results in the query tool. Fixes #2137

With a 27420 row query, pgAdmin III runs the query in 5.873s on my laptop. 
pgAdmin 4 now takes ~1s.

Branch
--
master

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

Modified Files
--
web/config.py  |   6 +
.../connect_to_server_feature_test.py  |   4 +
.../feature_tests/pg_datatype_validation_test.py   |  46 +-
web/pgadmin/feature_tests/query_tool_tests.py  | 734 
web/pgadmin/feature_tests/view_data_dml_queries.py |  25 +-
.../xss_checks_panels_and_query_tool_test.py   |  17 +-
.../xss_checks_pgadmin_debugger_test.py|   1 +
web/pgadmin/static/bundle/slickgrid.js |   1 +
web/pgadmin/static/js/selection/column_selector.js |  22 +-
web/pgadmin/static/js/selection/copy_data.js   |   6 +-
web/pgadmin/static/js/selection/grid_selector.js   |  31 +-
.../js/selection/range_boundary_navigator.js   |   4 +-
web/pgadmin/static/js/selection/row_selector.js|   3 +-
web/pgadmin/static/js/selection/set_staged_rows.js |  41 +-
.../static/js/slickgrid/slick.pgadmin.editors.js   |  34 +-
web/pgadmin/tools/sqleditor/__init__.py| 321 ++---
web/pgadmin/tools/sqleditor/command.py | 137 ++--
.../tools/sqleditor/static/css/sqleditor.css   |  11 +-
.../sqleditor/templates/sqleditor/js/sqleditor.js  | 762 +++--
web/pgadmin/utils/driver/abstract.py   |  14 +-
web/pgadmin/utils/driver/psycopg2/__init__.py  |  86 ++-
web/regression/feature_utils/pgadmin_page.py   |  33 +-
.../javascript/selection/copy_data_spec.js |  24 +-
.../selection/range_boundary_navigator_spec.js |  22 +-
.../javascript/selection/row_selector_spec.js  |  12 +-
.../javascript/selection/set_staged_rows_spec.js   | 373 +-
.../selection/xcell_selection_model_spec.js|   9 +-
.../handle_query_output_keyboard_event_spec.js |  23 +-
28 files changed, 1934 insertions(+), 868 deletions(-)



Re: [pgadmin-hackers] Re: Server side cursor limitations for on demand loading of data in query tool [RM2137] [pgAdmin4]

2017-06-27 Thread Dave Page
Thanks - patch committed!

Awsome job :-)

On Tue, Jun 27, 2017 at 3:26 AM, Harshal Dhumal <
harshal.dhu...@enterprisedb.com> wrote:

> Hi,
>
> Please find rebased patch.
>
> --
> *Harshal Dhumal*
> *Sr. Software Engineer*
>
> EnterpriseDB India: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
> On Mon, Jun 26, 2017 at 5:24 PM, Harshal Dhumal <
> harshal.dhu...@enterprisedb.com> wrote:
>
>> yes i'm working on that only :)
>>
>>
>> --
>> *Harshal Dhumal*
>> *Sr. Software Engineer*
>>
>> EnterpriseDB India: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>>
>> On Mon, Jun 26, 2017 at 5:22 PM, Dave Page  wrote:
>>
>>> I'm sorry, it needs rebasing again. If you can do it quickly, I'll
>>> make sure it's the next patch I work on in that area.
>>>
>>> Thanks.
>>>
>>> On Mon, Jun 26, 2017 at 5:16 AM, Harshal Dhumal
>>>  wrote:
>>> > Hi Dave,
>>> >
>>> > Please find updated rebased patch for RM2137
>>> >
>>> > On Fri, Jun 23, 2017 at 9:00 PM, Dave Page  wrote:
>>> >>
>>> >> Hi Harshal,
>>> >>
>>> >> When can we expect an updated version of this patch? I think it's
>>> >> important to get this into the next release.
>>> >>
>>> >> Thanks!
>>> >>
>>> >> On Fri, Jun 16, 2017 at 10:55 AM, Dave Page 
>>> wrote:
>>> >> > Hi,
>>> >> >
>>> >> > That's better - the failures are far less random now :-). I got the
>>> >> > following two though, on both PG and EPAS 9.5:
>>> >> >
>>> >> > 
>>> ==
>>> >> > ERROR: runTest
>>> >> > (pgadmin.feature_tests.query_tool_tests.QueryToolFeatureTest)
>>> >> > Query tool feature test
>>> >> > 
>>> --
>>> >> > Traceback (most recent call last):
>>> >> >   File
>>> >> > "/Users/dpage/git/pgadmin4/web/pgadmin/feature_tests/query_t
>>> ool_tests.py",
>>> >> > line 95, in runTest
>>> >> > self._query_tool_explain_analyze_buffers()
>>> >> >   File
>>> >> > "/Users/dpage/git/pgadmin4/web/pgadmin/feature_tests/query_t
>>> ool_tests.py",
>>> >> > line 443, in _query_tool_explain_analyze_buffers
>>> >> > canvas.find_element_by_xpath("//*[contains(string(), 'Shared
>>> Read
>>> >> > Blocks')]")
>>> >> >   File
>>> >> > "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packa
>>> ges/selenium/webdriver/remote/webelement.py",
>>> >> > line 260, in find_element_by_xpath
>>> >> > return self.find_element(by=By.XPATH, value=xpath)
>>> >> >   File
>>> >> > "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packa
>>> ges/selenium/webdriver/remote/webelement.py",
>>> >> > line 508, in find_element
>>> >> > {"using": by, "value": value})['value']
>>> >> >   File
>>> >> > "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packa
>>> ges/selenium/webdriver/remote/webelement.py",
>>> >> > line 491, in _execute
>>> >> > return self._parent.execute(command, params)
>>> >> >   File
>>> >> > "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packa
>>> ges/selenium/webdriver/remote/webdriver.py",
>>> >> > line 238, in execute
>>> >> > self.error_handler.check_response(response)
>>> >> >   File
>>> >> > "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packa
>>> ges/selenium/webdriver/remote/errorhandler.py",
>>> >> > line 193, in check_response
>>> >> > raise exception_class(message, screen, stacktrace)
>>> >> > NoSuchElementException: Message: no such element: Unable to locate
>>> >> > element: {"method":"xpath","selector":"//*[contains(string(),
>>> 'Shared
>>> >> > Read Blocks')]"}
>>> >> >   (Session info: chrome=58.0.3029.110)
>>> >> >   (Driver info: chromedriver=2.29.461585
>>> >> > (0be2cd95f834e9ee7c46bcc7cf405b483f5ae83b),platform=Mac OS X
>>> 10.12.3
>>> >> > x86_64)
>>> >> >
>>> >> >
>>> >> > 
>>> ==
>>> >> > ERROR: runTest
>>> >> > (pgadmin.feature_tests.view_data_dml_queries.CheckForViewDataTest)
>>> >> > Validate Insert, Update operations in View data with given test data
>>> >> > 
>>> --
>>> >> > Traceback (most recent call last):
>>> >> >   File
>>> >> > "/Users/dpage/git/pgadmin4/web/pgadmin/feature_tests/view_da
>>> ta_dml_queries.py",
>>> >> > line 104, in runTest
>>> >> > self._add_row()
>>> >> >   File
>>> >> > "/Users/dpage/git/pgadmin4/web/pgadmin/feature_tests/view_da
>>> ta_dml_queries.py",
>>> >> > line 255, in _add_row
>>> >> > self._update_cell(cell_xpath, config_data[str(idx)])
>>> >> >   File
>>> >> > "/Users/dpage/git/pgadmin4/web/pgadmin/feature_tests/view_da
>>> ta_dml_queries.py",
>>> >> > line 164, in _update_cell
>>> >> > cell_el = self.page.find_by_xpath(xpath)
>>> >> >   File
>>> >> > "/Users/dpage/git/pgadmin4/web/regression/feature_utils/pgad
>>> min_page.py",
>>> >> > line 122, in find_by_xpath
>>> >> > return self.wait_for_element(lambda driver:
>>> >> > driver.find_element_by_xpath(xpath))
>>> >> >   File
>>> 

Re: [pgadmin-hackers] Re: Server side cursor limitations for on demand loading of data in query tool [RM2137] [pgAdmin4]

2017-06-27 Thread Ashesh Vashi
On Tue, Jun 27, 2017 at 6:33 PM, Dave Page  wrote:

> Thanks - patch committed!
>
> Awsome job :-)
>
Woohoo!

-- Thanks & Regards,
Ashesh Vashi

>
> On Tue, Jun 27, 2017 at 3:26 AM, Harshal Dhumal <
> harshal.dhu...@enterprisedb.com> wrote:
>
>> Hi,
>>
>> Please find rebased patch.
>>
>> --
>> *Harshal Dhumal*
>> *Sr. Software Engineer*
>>
>> EnterpriseDB India: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>>
>> On Mon, Jun 26, 2017 at 5:24 PM, Harshal Dhumal <
>> harshal.dhu...@enterprisedb.com> wrote:
>>
>>> yes i'm working on that only :)
>>>
>>>
>>> --
>>> *Harshal Dhumal*
>>> *Sr. Software Engineer*
>>>
>>> EnterpriseDB India: http://www.enterprisedb.com
>>> The Enterprise PostgreSQL Company
>>>
>>> On Mon, Jun 26, 2017 at 5:22 PM, Dave Page  wrote:
>>>
 I'm sorry, it needs rebasing again. If you can do it quickly, I'll
 make sure it's the next patch I work on in that area.

 Thanks.

 On Mon, Jun 26, 2017 at 5:16 AM, Harshal Dhumal
  wrote:
 > Hi Dave,
 >
 > Please find updated rebased patch for RM2137
 >
 > On Fri, Jun 23, 2017 at 9:00 PM, Dave Page  wrote:
 >>
 >> Hi Harshal,
 >>
 >> When can we expect an updated version of this patch? I think it's
 >> important to get this into the next release.
 >>
 >> Thanks!
 >>
 >> On Fri, Jun 16, 2017 at 10:55 AM, Dave Page 
 wrote:
 >> > Hi,
 >> >
 >> > That's better - the failures are far less random now :-). I got the
 >> > following two though, on both PG and EPAS 9.5:
 >> >
 >> > 
 ==
 >> > ERROR: runTest
 >> > (pgadmin.feature_tests.query_tool_tests.QueryToolFeatureTest)
 >> > Query tool feature test
 >> > 
 --
 >> > Traceback (most recent call last):
 >> >   File
 >> > "/Users/dpage/git/pgadmin4/web/pgadmin/feature_tests/query_t
 ool_tests.py",
 >> > line 95, in runTest
 >> > self._query_tool_explain_analyze_buffers()
 >> >   File
 >> > "/Users/dpage/git/pgadmin4/web/pgadmin/feature_tests/query_t
 ool_tests.py",
 >> > line 443, in _query_tool_explain_analyze_buffers
 >> > canvas.find_element_by_xpath("//*[contains(string(), 'Shared
 Read
 >> > Blocks')]")
 >> >   File
 >> > "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packa
 ges/selenium/webdriver/remote/webelement.py",
 >> > line 260, in find_element_by_xpath
 >> > return self.find_element(by=By.XPATH, value=xpath)
 >> >   File
 >> > "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packa
 ges/selenium/webdriver/remote/webelement.py",
 >> > line 508, in find_element
 >> > {"using": by, "value": value})['value']
 >> >   File
 >> > "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packa
 ges/selenium/webdriver/remote/webelement.py",
 >> > line 491, in _execute
 >> > return self._parent.execute(command, params)
 >> >   File
 >> > "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packa
 ges/selenium/webdriver/remote/webdriver.py",
 >> > line 238, in execute
 >> > self.error_handler.check_response(response)
 >> >   File
 >> > "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packa
 ges/selenium/webdriver/remote/errorhandler.py",
 >> > line 193, in check_response
 >> > raise exception_class(message, screen, stacktrace)
 >> > NoSuchElementException: Message: no such element: Unable to locate
 >> > element: {"method":"xpath","selector":"//*[contains(string(),
 'Shared
 >> > Read Blocks')]"}
 >> >   (Session info: chrome=58.0.3029.110)
 >> >   (Driver info: chromedriver=2.29.461585
 >> > (0be2cd95f834e9ee7c46bcc7cf405b483f5ae83b),platform=Mac OS X
 10.12.3
 >> > x86_64)
 >> >
 >> >
 >> > 
 ==
 >> > ERROR: runTest
 >> > (pgadmin.feature_tests.view_data_dml_queries.CheckForViewDataTest)
 >> > Validate Insert, Update operations in View data with given test
 data
 >> > 
 --
 >> > Traceback (most recent call last):
 >> >   File
 >> > "/Users/dpage/git/pgadmin4/web/pgadmin/feature_tests/view_da
 ta_dml_queries.py",
 >> > line 104, in runTest
 >> > self._add_row()
 >> >   File
 >> > "/Users/dpage/git/pgadmin4/web/pgadmin/feature_tests/view_da
 ta_dml_queries.py",
 >> > line 255, in _add_row
 >> > self._update_cell(cell_xpath, config_data[str(idx)])
 >> >   File
 >> > "/Users/dpage/git/pgadmin4/web/pgadmin/feature_tests/view_da
 ta_dml_queries.py",
 >> > line 164, in _update_cell
 >> > cell_el = self.page.find_by_xpath(xpath)
 >> >   File

Re: [pgadmin-hackers][patch] History Detail Pane

2017-06-27 Thread Dave Page
Can you rebase this patch please?

Thankfully I think we're basically at the end of our changes in this area!

On Mon, Jun 26, 2017 at 10:08 AM, Joao Pedro De Almeida Pereira <
jdealmeidapere...@pivotal.io> wrote:

> Hi Surinder,
>
> You can find our answers inline and attached the patch with the change of
> scrolls from "scroll" to "auto"
>
> On Mon, Jun 26, 2017 at 4:47 AM, Surinder Kumar <
> surinder.ku...@enterprisedb.com> wrote:
>
>> Hi
>> On Fri, Jun 23, 2017 at 11:39 PM, George Gelashvili <
>> ggelashv...@pivotal.io> wrote:
>>
>>> On Fri, Jun 23, 2017 at 11:24 AM, Surinder Kumar <
>>> surinder.ku...@enterprisedb.com> wrote:
>>>
 Hi

 Review comments:

 ​1. ​
 Can we set "message"(in message detail) style property scroll to
 ​'​
 auto
 ​'​
  instead of
 ​'​
 scroll
 ​'​
  ?

>>>
>>> Could you elaborate why 'auto' is what we want?
>>>
>> ​The scroll bars should appear only when content is beyond the
>> width/height of container.​ Now with 'scroll', the border layout around
>> container appears irrespective of content width/height. If we set 'auto',
>> it won't appear.
>>
>
> We changed that in the attached patch. The scroll bars will now appear
> when the text exceeds the window.
>
>
>>> ​2. CSS property flex is supported for IE >= 9 as per reference
> 
> ​. I tested this patch on IE and layout is broken.​
>
>  Anyways IE-9/10 are outdated and no longer supported by Microsoft,
 the only supported browsers are IE-11+.

>>>
>>> Does this patch work in supported IEs?
>>>
>> ​I use Windows 7 which has IE9,10, but if we can fix it for IE9,10 we
>> should fix. Majority of people are still using IE9,10.​
>>
>
> We based almost 100% of this patch on Flexbox. In order to use another
> structure, we would have to rewrite the html blocks (the majority of the
> UI). If the community believes that is important to keep giving support to
> Browsers that are no longer supported then we can use a library like
> modernizr  to try to support all the existing
> browser. Nevertheless we believe that this should be done in a future patch.
>
>
>>> 3. ​Can the CSS styles in ‘history_detail_message.jsx’ moved out in a
 separate stylesheet file
 ​ as inline styles in html are never recommended.​

>>>
>>> We've been trying to use inline styles rather than classes for our react
>>> jsx code, as this keeps element behavior declarative. This includes both
>>> functionality and appearance.
>>> So far the pattern has been to extract styles used by more than one
>>> component to jsx/styles.
>>>
>> ​Can we use classes and then write css around classes thus preserving
>> element behaviour declarative ?​
>>
>
> We believe that this should be a conversation to have next Friday in the
> Hackers Community Forum. In the meanwhile we hope this is not a blocker to
> the merge of this patch.
>
>
>>
>>> ​4. In 'codemirror.jsx', setInterval is used to bind
 hydrateWhenBecomesVisible function after every 100ms. Can setTimeout ​be
 used as it needs to bind only once ?
 Also if setInterval is used, in componentWillUnmount clearInterval(...) 
 should
 be implemented.

>>>
>>> We actually need to poll, as otherwise the codemirror element will
>>> render with its last state (so, incorrect query history)
>>>
>>> 5. The text like 'Rows Affected' or 'Duration' should be wrapped in
 'gettext' for translation?
>>>
>>>
>>> We are working on using translations in React components. This needs
>>> additional effort and we'll send this in a separate patch.
>>>
>>> Thanks
>>> Shruti and George
>>>
>>
>>
> Thanks,
> Joao and Shruti
>



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

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


pgAdmin 4 commit: Allow the user to close the dashboard panel. Fixes #2

2017-06-27 Thread Dave Page
Allow the user to close the dashboard panel. Fixes #2506

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=a87ee6d059e478a9ed6bea4fa628e93e1ce46c50
Author: Khushboo Vashi 

Modified Files
--
web/pgadmin/browser/static/js/panel.js | 38 +-
.../browser/templates/browser/js/browser.js| 24 --
web/pgadmin/dashboard/__init__.py  |  8 +++--
.../dashboard/templates/dashboard/js/dashboard.js  | 10 +-
.../datagrid/templates/datagrid/js/datagrid.js |  4 +--
.../debugger/templates/debugger/js/debugger_ui.js  |  2 +-
web/pgadmin/utils/menu.py  |  4 ++-
7 files changed, 71 insertions(+), 19 deletions(-)



Re: [pgAdmin4][Patch]: Feature #2506 - Allow the dashboard panel to be closed

2017-06-27 Thread Dave Page
Thanks, patch applied.

On Tue, Jun 27, 2017 at 2:58 AM, Khushboo Vashi <
khushboo.va...@enterprisedb.com> wrote:

> Hi,
>
> Please find the attached updated patch.
>
> Thanks,
> Khushboo
>
> On Mon, Jun 26, 2017 at 5:08 PM, Dave Page  wrote:
>
>> Hi
>>
>> Looks good, except that when I close the dashboard panel, it continues
>> to run the queries to update the graphs until I change the selected
>> treeview node. Can we stop it immediately?
>>
>> Fixed
>
>> On Mon, Jun 26, 2017 at 1:56 AM, Khushboo Vashi
>>  wrote:
>> > Hi,
>> >
>> > Please find the attached patch for the feature #2506: Allow the
>> dashboard
>> > panel to be closed.
>> >
>> > Thanks,
>> > Khushboo
>>
>>
>>
>> --
>> Dave Page
>> Blog: http://pgsnake.blogspot.com
>> Twitter: @pgsnake
>>
>> EnterpriseDB UK: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>>
>
>


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

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


[pgAdmin4][Patch] To add preferences for brace matching and auto brace closing

2017-06-27 Thread Murtuza Zabuawala
Hi,

Please find patch to add preferences for brace matching and auto brace
closing in SQL editor.
RM#2513

--
Regards,
Murtuza Zabuawala
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
diff --git a/web/pgadmin/browser/__init__.py b/web/pgadmin/browser/__init__.py
index c6c5545..77e052f 100644
--- a/web/pgadmin/browser/__init__.py
+++ b/web/pgadmin/browser/__init__.py
@@ -549,6 +549,12 @@ def browser_js():
 editor_wrap_code_pref = prefs.preference('wrap_code')
 editor_wrap_code = editor_wrap_code_pref.get()
 
+brace_matching_pref = prefs.preference('brace_matching')
+brace_matching = brace_matching_pref.get()
+
+insert_pair_brackets_perf = prefs.preference('insert_pair_brackets')
+insert_pair_brackets = insert_pair_brackets_perf.get()
+
 for submodule in current_blueprint.submodules:
 snippets.extend(submodule.jssnippets)
 return make_response(
@@ -561,6 +567,8 @@ def browser_js():
 editor_tab_size=editor_tab_size,
 editor_use_spaces=editor_use_spaces,
 editor_wrap_code=editor_wrap_code,
+editor_brace_matching=brace_matching,
+editor_insert_pair_brackets=insert_pair_brackets,
 _=gettext
 ),
 200, {'Content-Type': 'application/x-javascript'})
diff --git a/web/pgadmin/browser/templates/browser/js/browser.js 
b/web/pgadmin/browser/templates/browser/js/browser.js
index 4494e7a..e587348 100644
--- a/web/pgadmin/browser/templates/browser/js/browser.js
+++ b/web/pgadmin/browser/templates/browser/js/browser.js
@@ -7,7 +7,8 @@ define(
 'pgadmin.alertifyjs', 'pgadmin.browser.messages',
 'pgadmin.browser.menu', 'pgadmin.browser.panel',
 'pgadmin.browser.error', 'pgadmin.browser.frame',
-'pgadmin.browser.node', 'pgadmin.browser.collection'
+'pgadmin.browser.node', 'pgadmin.browser.collection',
+'codemirror/addon/edit/matchbrackets', 
'codemirror/addon/edit/closebrackets'
   ], function(
 gettext, url_for, require, $, _, S, Bootstrap, pgAdmin, Alertify,
 CodeMirror, checkNodeVisibility
@@ -384,7 +385,9 @@ define(
 readOnly: true,
 extraKeys: pgAdmin.Browser.editor_shortcut_keys,
 tabSize: pgAdmin.Browser.editor_options.tabSize,
-lineWrapping: pgAdmin.Browser.editor_options.wrapCode
+lineWrapping: pgAdmin.Browser.editor_options.wrapCode,
+autoCloseBrackets: 
pgAdmin.Browser.editor_options.insert_pair_brackets,
+matchBrackets: pgAdmin.Browser.editor_options.brace_matching
   });
 
   setTimeout(function() {
@@ -1830,7 +1833,9 @@ define(
 },
 editor_options: {
   tabSize: '{{ editor_tab_size }}',
-  wrapCode: '{{ editor_wrap_code }}' == 'True'
+  wrapCode: '{{ editor_wrap_code }}' == 'True',
+  insert_pair_brackets: '{{ editor_insert_pair_brackets }}' == 'True',
+  brace_matching: '{{ editor_brace_matching }}' == 'True'
 }
 
   });
diff --git a/web/pgadmin/static/css/codemirror.overrides.css 
b/web/pgadmin/static/css/codemirror.overrides.css
new file mode 100644
index 000..b486ee4
--- /dev/null
+++ b/web/pgadmin/static/css/codemirror.overrides.css
@@ -0,0 +1,5 @@
+/* To override inbuilt Green color for matchingbracket */
+.cm-s-default .CodeMirror-matchingbracket {
+color: #33 !important;
+background-color: #e8e8e8 !important;
+}
\ No newline at end of file
diff --git a/web/pgadmin/static/js/backform.pgadmin.js 
b/web/pgadmin/static/js/backform.pgadmin.js
index a82205e..27d5b4c 100644
--- a/web/pgadmin/static/js/backform.pgadmin.js
+++ b/web/pgadmin/static/js/backform.pgadmin.js
@@ -5,7 +5,8 @@
 define([
   'sources/gettext', 'underscore', 'underscore.string', 'jquery',
   'backbone', 'backform', 'backgrid', 'codemirror', 'pgadmin.backgrid',
-  'codemirror/mode/sql/sql', 'select2'
+  'codemirror/mode/sql/sql', 'select2', 
'codemirror/addon/edit/matchbrackets',
+  'codemirror/addon/edit/closebrackets'
   ],
  function(gettext, _, S, $, Backbone, Backform, Backgrid, CodeMirror) {
   // Export global even in AMD case in case this script is loaded with
@@ -1405,7 +1406,9 @@
 readOnly: true,
 extraKeys: pgAdmin.Browser.editor_shortcut_keys,
 tabSize: pgAdmin.Browser.editor_options.tabSize,
-lineWrapping: pgAdmin.Browser.editor_options.wrapCode
+lineWrapping: pgAdmin.Browser.editor_options.wrapCode,
+autoCloseBrackets: pgAdmin.Browser.editor_options.insert_pair_brackets,
+matchBrackets: pgAdmin.Browser.editor_options.brace_matching
   });
 
   /*
@@ -2014,10 +2017,12 @@
   self.sqlCtrl = CodeMirror.fromTextArea(
 (self.$el.find("textarea")[0]), {
 lineNumbers: true,
-mode: "text/x-sql",
+mode: "text/x-pgsql",
 extraKeys: pgAdmin.Browser.editor_shortcut_keys,
 tabSize: pgAdmin.Browser.editor_options.tabSize,
-lineWrapp

Jenkins build is back to normal : pgadmin4-master-python26 #320

2017-06-27 Thread pgAdmin 4 Jenkins
See 





pgAdmin 4 commit: Add preferences to enable brace matching and brace cl

2017-06-27 Thread Dave Page
Add preferences to enable brace matching and brace closing in the SQL editors. 
Fixes #2513

Branch
--
master

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

Modified Files
--
web/pgadmin/browser/__init__.py |  8 
web/pgadmin/browser/templates/browser/js/browser.js | 11 ---
web/pgadmin/static/js/backform.pgadmin.js   | 13 +
web/pgadmin/templates/base.html |  1 +
.../tools/datagrid/templates/datagrid/js/datagrid.js| 10 ++
.../tools/debugger/templates/debugger/js/direct.js  |  8 ++--
web/pgadmin/tools/sqleditor/__init__.py | 17 -
.../tools/sqleditor/templates/sqleditor/js/sqleditor.js | 12 
8 files changed, 62 insertions(+), 18 deletions(-)



Re: [pgAdmin4][Patch] To add preferences for brace matching and auto brace closing

2017-06-27 Thread Dave Page
Thanks - patch applied with some minor tweaks to enable both options by
default and adjust the help wording.

However, I realised right as I committed it, that you haven't updated the
docs. Can you please update the screenshots affected and add the two new
options to the docs please?

Thanks.

On Tue, Jun 27, 2017 at 9:21 AM, Murtuza Zabuawala <
murtuza.zabuaw...@enterprisedb.com> wrote:

> Hi,
>
> Please find patch to add preferences for brace matching and auto brace
> closing in SQL editor.
> RM#2513
>
> --
> 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 add preferences for brace matching and auto brace closing

2017-06-27 Thread Murtuza Zabuawala
Sure Dave, I'll do the needful.

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

On Tue, Jun 27, 2017 at 7:29 PM, Dave Page  wrote:

> Thanks - patch applied with some minor tweaks to enable both options by
> default and adjust the help wording.
>
> However, I realised right as I committed it, that you haven't updated the
> docs. Can you please update the screenshots affected and add the two new
> options to the docs please?
>
> Thanks.
>
> On Tue, Jun 27, 2017 at 9:21 AM, Murtuza Zabuawala  enterprisedb.com> wrote:
>
>> Hi,
>>
>> Please find patch to add preferences for brace matching and auto brace
>> closing in SQL editor.
>> RM#2513
>>
>> --
>> 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]: Feature #2506 - Allow the dashboard panel to be closed

2017-06-27 Thread Dave Page
Hi

I've had to revert this. Whilst it seems to work, after showing/hiding the
dashboard, I later find that when I completely reload the app, it fails,
leaving just the object menu present. I haven't come up with a concrete
case to reproduce it. In the console, I see:


wcDocker.min.js:38 Uncaught TypeError: Cannot read property '__save' of
null at e.save (wcDocker.min.js:38) at Object.save_current_layout (
browser.js:340) at e.handleVisibility (panel.js:156) at e.__trigger (
wcDocker.min.js:34) at e.trigger (wcDocker.min.js:38) at e.clear (
wcDocker.min.js:38) at Object.init (browser.js:386) at (index):278 at
Object.execCb (require.min.js:29) at Z.check (require.min.js:18)

On Tue, Jun 27, 2017 at 9:21 AM, Dave Page  wrote:

> Thanks, patch applied.
>
> On Tue, Jun 27, 2017 at 2:58 AM, Khushboo Vashi <
> khushboo.va...@enterprisedb.com> wrote:
>
>> Hi,
>>
>> Please find the attached updated patch.
>>
>> Thanks,
>> Khushboo
>>
>> On Mon, Jun 26, 2017 at 5:08 PM, Dave Page  wrote:
>>
>>> Hi
>>>
>>> Looks good, except that when I close the dashboard panel, it continues
>>> to run the queries to update the graphs until I change the selected
>>> treeview node. Can we stop it immediately?
>>>
>>> Fixed
>>
>>> On Mon, Jun 26, 2017 at 1:56 AM, Khushboo Vashi
>>>  wrote:
>>> > Hi,
>>> >
>>> > Please find the attached patch for the feature #2506: Allow the
>>> dashboard
>>> > panel to be closed.
>>> >
>>> > Thanks,
>>> > Khushboo
>>>
>>>
>>>
>>> --
>>> Dave Page
>>> Blog: http://pgsnake.blogspot.com
>>> Twitter: @pgsnake
>>>
>>> EnterpriseDB UK: http://www.enterprisedb.com
>>> The Enterprise PostgreSQL Company
>>>
>>
>>
>
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>



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

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


pgAdmin 4 commit: Revert "Allow the user to close the dashboard panel.

2017-06-27 Thread Dave Page
Revert "Allow the user to close the dashboard panel. Fixes #2506"

This reverts commit a87ee6d059e478a9ed6bea4fa628e93e1ce46c50.

Branch
--
master

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

Modified Files
--
web/pgadmin/browser/static/js/panel.js | 38 +-
.../browser/templates/browser/js/browser.js| 24 ++
web/pgadmin/dashboard/__init__.py  |  8 ++---
.../dashboard/templates/dashboard/js/dashboard.js  | 10 +-
.../datagrid/templates/datagrid/js/datagrid.js |  4 +--
.../debugger/templates/debugger/js/debugger_ui.js  |  2 +-
web/pgadmin/utils/menu.py  |  4 +--
7 files changed, 19 insertions(+), 71 deletions(-)



pgAdmin 4 commit: Add stylesheet to override brace matching styles, mis

2017-06-27 Thread Dave Page
Add stylesheet to override brace matching styles, missed from the feature 
commit.

Branch
--
master

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

Modified Files
--
web/pgadmin/static/css/codemirror.overrides.css | 5 +
1 file changed, 5 insertions(+)



pgAdmin 4 commit: Overhaul the query history tab to allow browsing of t

2017-06-27 Thread Dave Page
Overhaul the query history tab to allow browsing of the history and full query 
text. Fixes #2282

Patch by Joao and the team at Pivotal.

Branch
--
master

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

Modified Files
--
web/package.json   | 1 +
.../feature_tests/query_tool_journey_test.py   |10 +-
web/pgadmin/static/css/bootstrap.overrides.css |58 -
web/pgadmin/static/css/codemirror.overrides.css|66 +
web/pgadmin/static/css/pgadmin.css |32 +
web/pgadmin/static/js/history/index.js | 4 +-
.../static/jsx/history/detail/code_mirror.jsx  |61 +
.../jsx/history/detail/history_detail_message.jsx  |60 +
.../jsx/history/detail/history_detail_metadata.jsx |54 +
.../jsx/history/detail/history_detail_query.jsx|33 +
.../history/entry/query_history_error_entry.jsx|20 +
.../history/entry/query_history_selected_entry.jsx |21 +
.../entry/query_history_selected_error_entry.jsx   |22 +
.../history/entry/query_history_vanilla_entry.jsx  |47 +
web/pgadmin/static/jsx/history/query_history.jsx   |75 +-
.../static/jsx/history/query_history_detail.jsx|75 +
.../static/jsx/history/query_history_entry.jsx |99 +-
web/pgadmin/static/jsx/react_shapes.jsx|31 +
web/pgadmin/static/jsx/styles/header_label.js  |14 +
.../static/jsx/styles/history_entry_styles.js  |57 +
web/pgadmin/static/jsx/styles/non_selectable.js|18 +
.../vendor/codemirror/addon/comment/comment.js |32 +-
.../vendor/codemirror/addon/display/panel.js   |13 +-
.../vendor/codemirror/addon/display/rulers.js  |38 +-
.../vendor/codemirror/addon/edit/closebrackets.js  |15 +-
.../vendor/codemirror/addon/edit/continuelist.js   | 8 +-
.../vendor/codemirror/addon/edit/matchbrackets.js  | 4 +-
.../vendor/codemirror/addon/fold/brace-fold.js |16 +-
.../vendor/codemirror/addon/fold/comment-fold.js   | 2 +-
.../vendor/codemirror/addon/fold/foldcode.js   | 5 +-
.../vendor/codemirror/addon/fold/foldgutter.js | 2 +-
.../vendor/codemirror/addon/fold/indent-fold.js|34 +-
.../vendor/codemirror/addon/fold/xml-fold.js   |14 +-
.../codemirror/addon/hint/javascript-hint.js   |11 +-
.../vendor/codemirror/addon/hint/show-hint.css | 2 -
.../vendor/codemirror/addon/hint/show-hint.js  | 6 +-
.../vendor/codemirror/addon/hint/sql-hint.js   |71 +-
.../static/vendor/codemirror/addon/lint/lint.css   | 4 +-
.../static/vendor/codemirror/addon/lint/lint.js| 9 +-
.../vendor/codemirror/addon/lint/yaml-lint.js  |11 +-
.../static/vendor/codemirror/addon/merge/merge.js  |   380 +-
.../static/vendor/codemirror/addon/mode/overlay.js | 9 +-
.../codemirror/addon/scroll/annotatescrollbar.js   | 6 +-
.../codemirror/addon/scroll/scrollpastend.js   | 2 +
.../codemirror/addon/scroll/simplescrollbars.js|15 +-
.../codemirror/addon/search/match-highlighter.js   |25 +-
.../vendor/codemirror/addon/search/search.js   |41 +-
.../vendor/codemirror/addon/search/searchcursor.js |   396 +-
.../codemirror/addon/selection/active-line.js  |24 +-
.../codemirror/addon/selection/mark-selection.js   | 5 +-
.../vendor/codemirror/addon/wrap/hardwrap.js   | 4 +-
.../static/vendor/codemirror/codemirror.css|34 +-
.../static/vendor/codemirror/lib/codemirror.js | 17817 ++-
.../static/vendor/codemirror/mode/sql/sql.js   |88 +-
web/pgadmin/templates/base.html| 1 +
.../sqleditor/templates/sqleditor/js/sqleditor.js  |16 +-
web/regression/feature_utils/app_starter.py| 1 -
web/regression/feature_utils/pgadmin_page.py   | 2 +-
web/regression/javascript/code_mirror_spec.jsx |68 +
.../javascript/history/history_collection_spec.js  | 4 -
.../history/query_history_entry_spec.jsx   |50 -
.../javascript/history/query_history_spec.jsx  |   136 +-
web/yarn.lock  |45 +-
63 files changed, 10996 insertions(+), 9328 deletions(-)



Re: [pgadmin-hackers][patch] History Detail Pane

2017-06-27 Thread Dave Page
Thanks - patch applied (just in time for Raffi's & my talk)!

On Tue, Jun 27, 2017 at 10:05 AM, Joao Pedro De Almeida Pereira <
jdealmeidapere...@pivotal.io> wrote:

> Yep,
> please see attached
>
> On Tue, Jun 27, 2017 at 9:11 AM, Dave Page  wrote:
>
>> Can you rebase this patch please?
>>
>> Thankfully I think we're basically at the end of our changes in this area!
>>
>> On Mon, Jun 26, 2017 at 10:08 AM, Joao Pedro De Almeida Pereira <
>> jdealmeidapere...@pivotal.io> wrote:
>>
>>> Hi Surinder,
>>>
>>> You can find our answers inline and attached the patch with the change
>>> of scrolls from "scroll" to "auto"
>>>
>>> On Mon, Jun 26, 2017 at 4:47 AM, Surinder Kumar <
>>> surinder.ku...@enterprisedb.com> wrote:
>>>
 Hi
 On Fri, Jun 23, 2017 at 11:39 PM, George Gelashvili <
 ggelashv...@pivotal.io> wrote:

> On Fri, Jun 23, 2017 at 11:24 AM, Surinder Kumar <
> surinder.ku...@enterprisedb.com> wrote:
>
>> Hi
>>
>> Review comments:
>>
>> ​1. ​
>> Can we set "message"(in message detail) style property scroll to
>> ​'​
>> auto
>> ​'​
>>  instead of
>> ​'​
>> scroll
>> ​'​
>>  ?
>>
>
> Could you elaborate why 'auto' is what we want?
>
 ​The scroll bars should appear only when content is beyond the
 width/height of container.​ Now with 'scroll', the border layout around
 container appears irrespective of content width/height. If we set 'auto',
 it won't appear.

>>>
>>> We changed that in the attached patch. The scroll bars will now appear
>>> when the text exceeds the window.
>>>
>>>
> ​2. CSS property flex is supported for IE >= 9 as per reference
>>> 
>>> ​. I tested this patch on IE and layout is broken.​
>>>
>>>  Anyways IE-9/10 are outdated and no longer supported by Microsoft,
>> the only supported browsers are IE-11+.
>>
>
> Does this patch work in supported IEs?
>
 ​I use Windows 7 which has IE9,10, but if we can fix it for IE9,10 we
 should fix. Majority of people are still using IE9,10.​

>>>
>>> We based almost 100% of this patch on Flexbox. In order to use another
>>> structure, we would have to rewrite the html blocks (the majority of the
>>> UI). If the community believes that is important to keep giving support to
>>> Browsers that are no longer supported then we can use a library like
>>> modernizr  to try to support all the existing
>>> browser. Nevertheless we believe that this should be done in a future patch.
>>>
>>>
> 3. ​Can the CSS styles in ‘history_detail_message.jsx’ moved out in a
>> separate stylesheet file
>> ​ as inline styles in html are never recommended.​
>>
>
> We've been trying to use inline styles rather than classes for our
> react jsx code, as this keeps element behavior declarative. This includes
> both functionality and appearance.
> So far the pattern has been to extract styles used by more than one
> component to jsx/styles.
>
 ​Can we use classes and then write css around classes thus preserving
 element behaviour declarative ?​

>>>
>>> We believe that this should be a conversation to have next Friday in the
>>> Hackers Community Forum. In the meanwhile we hope this is not a blocker to
>>> the merge of this patch.
>>>
>>>

> ​4. In 'codemirror.jsx', setInterval is used to bind
>> hydrateWhenBecomesVisible function after every 100ms. Can setTimeout ​be
>> used as it needs to bind only once ?
>> Also if setInterval is used, in componentWillUnmount
>> clearInterval(...) should be implemented.
>>
>
> We actually need to poll, as otherwise the codemirror element will
> render with its last state (so, incorrect query history)
>
> 5. The text like 'Rows Affected' or 'Duration' should be wrapped in
>> 'gettext' for translation?
>
>
> We are working on using translations in React components. This needs
> additional effort and we'll send this in a separate patch.
>
> Thanks
> Shruti and George
>


>>> Thanks,
>>> Joao and Shruti
>>>
>>
>>
>>
>> --
>> 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


Build failed in Jenkins: pgadmin4-master-python36 #200

2017-06-27 Thread pgAdmin 4 Jenkins
See 


Changes:

[Dave Page] Revert "Allow the user to close the dashboard panel. Fixes #2506"

[Dave Page] Add stylesheet to override brace matching styles, missed from the

[Dave Page] Overhaul the query history tab to allow browsing of the history and 
full

--
[...truncated 289.03 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_dependencies_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.JavascriptBundlerTestCase)
scenario name: JavascriptBundlerTestCase ... ok
runTest 
(pgadmin.utils.tests.test_versioned_template_loader.TestVersionedTemplateLoader)
Render a template when called ... ok
runTest 
(pgadmin.utils.tests.test_versioned_template_loader.TestVersionedTemplateLoader)
Render a version 9.1 template when it is present ... ok
runTest 
(pgadmin.utils.tests.test_versioned_template_loader.TestVersionedTemplateLoader)
Render a version 9.2 template when request for a higher version ... ok
runTest 
(pgadmin.utils.tests.test_versioned_template_loader.TestVersionedTemplateLoader)
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.TestVersionedTemplateLoader)
Raise error when version is smaller than available templates ... ok
runTest 
(regression.python_test_utils.sql_template_test_base.SQLTemplateTestBase)
parent test class ... ok

--
Ran 163 tests in 25.447s

OK

==
Test Result Summary

Re: [pgadmin-hackers] Re: Server side cursor limitations for on demand loading of data in query tool [RM2137] [pgAdmin4]

2017-06-27 Thread Khushboo Vashi
On 27 Jun 2017 18:33, "Dave Page"  wrote:

Thanks - patch committed!

Awsome job :-)

Gr8. Finally no more rebase request for Harshal. :)

On Tue, Jun 27, 2017 at 3:26 AM, Harshal Dhumal <
harshal.dhu...@enterprisedb.com> wrote:

> Hi,
>
> Please find rebased patch.
>
> --
> *Harshal Dhumal*
> *Sr. Software Engineer*
>
> EnterpriseDB India: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
> On Mon, Jun 26, 2017 at 5:24 PM, Harshal Dhumal <
> harshal.dhu...@enterprisedb.com> wrote:
>
>> yes i'm working on that only :)
>>
>>
>> --
>> *Harshal Dhumal*
>> *Sr. Software Engineer*
>>
>> EnterpriseDB India: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>>
>> On Mon, Jun 26, 2017 at 5:22 PM, Dave Page  wrote:
>>
>>> I'm sorry, it needs rebasing again. If you can do it quickly, I'll
>>> make sure it's the next patch I work on in that area.
>>>
>>> Thanks.
>>>
>>> On Mon, Jun 26, 2017 at 5:16 AM, Harshal Dhumal
>>>  wrote:
>>> > Hi Dave,
>>> >
>>> > Please find updated rebased patch for RM2137
>>> >
>>> > On Fri, Jun 23, 2017 at 9:00 PM, Dave Page  wrote:
>>> >>
>>> >> Hi Harshal,
>>> >>
>>> >> When can we expect an updated version of this patch? I think it's
>>> >> important to get this into the next release.
>>> >>
>>> >> Thanks!
>>> >>
>>> >> On Fri, Jun 16, 2017 at 10:55 AM, Dave Page 
>>> wrote:
>>> >> > Hi,
>>> >> >
>>> >> > That's better - the failures are far less random now :-). I got the
>>> >> > following two though, on both PG and EPAS 9.5:
>>> >> >
>>> >> > 
>>> ==
>>> >> > ERROR: runTest
>>> >> > (pgadmin.feature_tests.query_tool_tests.QueryToolFeatureTest)
>>> >> > Query tool feature test
>>> >> > 
>>> --
>>> >> > Traceback (most recent call last):
>>> >> >   File
>>> >> > "/Users/dpage/git/pgadmin4/web/pgadmin/feature_tests/query_t
>>> ool_tests.py",
>>> >> > line 95, in runTest
>>> >> > self._query_tool_explain_analyze_buffers()
>>> >> >   File
>>> >> > "/Users/dpage/git/pgadmin4/web/pgadmin/feature_tests/query_t
>>> ool_tests.py",
>>> >> > line 443, in _query_tool_explain_analyze_buffers
>>> >> > canvas.find_element_by_xpath("//*[contains(string(), 'Shared
>>> Read
>>> >> > Blocks')]")
>>> >> >   File
>>> >> > "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packa
>>> ges/selenium/webdriver/remote/webelement.py",
>>> >> > line 260, in find_element_by_xpath
>>> >> > return self.find_element(by=By.XPATH, value=xpath)
>>> >> >   File
>>> >> > "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packa
>>> ges/selenium/webdriver/remote/webelement.py",
>>> >> > line 508, in find_element
>>> >> > {"using": by, "value": value})['value']
>>> >> >   File
>>> >> > "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packa
>>> ges/selenium/webdriver/remote/webelement.py",
>>> >> > line 491, in _execute
>>> >> > return self._parent.execute(command, params)
>>> >> >   File
>>> >> > "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packa
>>> ges/selenium/webdriver/remote/webdriver.py",
>>> >> > line 238, in execute
>>> >> > self.error_handler.check_response(response)
>>> >> >   File
>>> >> > "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packa
>>> ges/selenium/webdriver/remote/errorhandler.py",
>>> >> > line 193, in check_response
>>> >> > raise exception_class(message, screen, stacktrace)
>>> >> > NoSuchElementException: Message: no such element: Unable to locate
>>> >> > element: {"method":"xpath","selector":"//*[contains(string(),
>>> 'Shared
>>> >> > Read Blocks')]"}
>>> >> >   (Session info: chrome=58.0.3029.110)
>>> >> >   (Driver info: chromedriver=2.29.461585
>>> >> > (0be2cd95f834e9ee7c46bcc7cf405b483f5ae83b),platform=Mac OS X
>>> 10.12.3
>>> >> > x86_64)
>>> >> >
>>> >> >
>>> >> > 
>>> ==
>>> >> > ERROR: runTest
>>> >> > (pgadmin.feature_tests.view_data_dml_queries.CheckForViewDataTest)
>>> >> > Validate Insert, Update operations in View data with given test data
>>> >> > 
>>> --
>>> >> > Traceback (most recent call last):
>>> >> >   File
>>> >> > "/Users/dpage/git/pgadmin4/web/pgadmin/feature_tests/view_da
>>> ta_dml_queries.py",
>>> >> > line 104, in runTest
>>> >> > self._add_row()
>>> >> >   File
>>> >> > "/Users/dpage/git/pgadmin4/web/pgadmin/feature_tests/view_da
>>> ta_dml_queries.py",
>>> >> > line 255, in _add_row
>>> >> > self._update_cell(cell_xpath, config_data[str(idx)])
>>> >> >   File
>>> >> > "/Users/dpage/git/pgadmin4/web/pgadmin/feature_tests/view_da
>>> ta_dml_queries.py",
>>> >> > line 164, in _update_cell
>>> >> > cell_el = self.page.find_by_xpath(xpath)
>>> >> >   File
>>> >> > "/Users/dpage/git/pgadmin4/web/regression/feature_utils/pgad
>>> min_page.py",
>>> >> > line 122, in find_by_xpath
>>> >> > return self.wa

Re: [pgadmin-hackers] Re: Server side cursor limitations for on demand loading of data in query tool [RM2137] [pgAdmin4]

2017-06-27 Thread Robert Eckhardt
On Tue, Jun 27, 2017 at 12:16 PM, Khushboo Vashi <
khushboo.va...@enterprisedb.com> wrote:

>
>
> On 27 Jun 2017 18:33, "Dave Page"  wrote:
>
> Thanks - patch committed!
>
> Awsome job :-)
>
> Gr8. Finally no more rebase request for Harshal. :)
>

+1


> On Tue, Jun 27, 2017 at 3:26 AM, Harshal Dhumal <
> harshal.dhu...@enterprisedb.com> wrote:
>
>> Hi,
>>
>> Please find rebased patch.
>>
>> --
>> *Harshal Dhumal*
>> *Sr. Software Engineer*
>>
>> EnterpriseDB India: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>>
>> On Mon, Jun 26, 2017 at 5:24 PM, Harshal Dhumal <
>> harshal.dhu...@enterprisedb.com> wrote:
>>
>>> yes i'm working on that only :)
>>>
>>>
>>> --
>>> *Harshal Dhumal*
>>> *Sr. Software Engineer*
>>>
>>> EnterpriseDB India: http://www.enterprisedb.com
>>> The Enterprise PostgreSQL Company
>>>
>>> On Mon, Jun 26, 2017 at 5:22 PM, Dave Page  wrote:
>>>
 I'm sorry, it needs rebasing again. If you can do it quickly, I'll
 make sure it's the next patch I work on in that area.

 Thanks.

 On Mon, Jun 26, 2017 at 5:16 AM, Harshal Dhumal
  wrote:
 > Hi Dave,
 >
 > Please find updated rebased patch for RM2137
 >
 > On Fri, Jun 23, 2017 at 9:00 PM, Dave Page  wrote:
 >>
 >> Hi Harshal,
 >>
 >> When can we expect an updated version of this patch? I think it's
 >> important to get this into the next release.
 >>
 >> Thanks!
 >>
 >> On Fri, Jun 16, 2017 at 10:55 AM, Dave Page 
 wrote:
 >> > Hi,
 >> >
 >> > That's better - the failures are far less random now :-). I got the
 >> > following two though, on both PG and EPAS 9.5:
 >> >
 >> > 
 ==
 >> > ERROR: runTest
 >> > (pgadmin.feature_tests.query_tool_tests.QueryToolFeatureTest)
 >> > Query tool feature test
 >> > 
 --
 >> > Traceback (most recent call last):
 >> >   File
 >> > "/Users/dpage/git/pgadmin4/web/pgadmin/feature_tests/query_t
 ool_tests.py",
 >> > line 95, in runTest
 >> > self._query_tool_explain_analyze_buffers()
 >> >   File
 >> > "/Users/dpage/git/pgadmin4/web/pgadmin/feature_tests/query_t
 ool_tests.py",
 >> > line 443, in _query_tool_explain_analyze_buffers
 >> > canvas.find_element_by_xpath("//*[contains(string(), 'Shared
 Read
 >> > Blocks')]")
 >> >   File
 >> > "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packa
 ges/selenium/webdriver/remote/webelement.py",
 >> > line 260, in find_element_by_xpath
 >> > return self.find_element(by=By.XPATH, value=xpath)
 >> >   File
 >> > "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packa
 ges/selenium/webdriver/remote/webelement.py",
 >> > line 508, in find_element
 >> > {"using": by, "value": value})['value']
 >> >   File
 >> > "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packa
 ges/selenium/webdriver/remote/webelement.py",
 >> > line 491, in _execute
 >> > return self._parent.execute(command, params)
 >> >   File
 >> > "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packa
 ges/selenium/webdriver/remote/webdriver.py",
 >> > line 238, in execute
 >> > self.error_handler.check_response(response)
 >> >   File
 >> > "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packa
 ges/selenium/webdriver/remote/errorhandler.py",
 >> > line 193, in check_response
 >> > raise exception_class(message, screen, stacktrace)
 >> > NoSuchElementException: Message: no such element: Unable to locate
 >> > element: {"method":"xpath","selector":"//*[contains(string(),
 'Shared
 >> > Read Blocks')]"}
 >> >   (Session info: chrome=58.0.3029.110)
 >> >   (Driver info: chromedriver=2.29.461585
 >> > (0be2cd95f834e9ee7c46bcc7cf405b483f5ae83b),platform=Mac OS X
 10.12.3
 >> > x86_64)
 >> >
 >> >
 >> > 
 ==
 >> > ERROR: runTest
 >> > (pgadmin.feature_tests.view_data_dml_queries.CheckForViewDataTest)
 >> > Validate Insert, Update operations in View data with given test
 data
 >> > 
 --
 >> > Traceback (most recent call last):
 >> >   File
 >> > "/Users/dpage/git/pgadmin4/web/pgadmin/feature_tests/view_da
 ta_dml_queries.py",
 >> > line 104, in runTest
 >> > self._add_row()
 >> >   File
 >> > "/Users/dpage/git/pgadmin4/web/pgadmin/feature_tests/view_da
 ta_dml_queries.py",
 >> > line 255, in _add_row
 >> > self._update_cell(cell_xpath, config_data[str(idx)])
 >> >   File
 >> > "/Users/dpage/git/pgadmin4/web/pgadmin/feature_tests/view_da
 ta_dml_queries.py",
>>

Re: [pgadmin-hackers][patch] History Detail Pane

2017-06-27 Thread Harshal Dhumal
Hi,

New history pane is really nice and informative than existing one.
I'm just thinking about one minor improvement we can make, to allow history
tab to respond to up and down arrow keys so that user can easily switch
between executed queries without using mouse.


Thanks,

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

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

On Tue, Jun 27, 2017 at 8:26 PM, Dave Page  wrote:

> Thanks - patch applied (just in time for Raffi's & my talk)!
>
> On Tue, Jun 27, 2017 at 10:05 AM, Joao Pedro De Almeida Pereira <
> jdealmeidapere...@pivotal.io> wrote:
>
>> Yep,
>> please see attached
>>
>> On Tue, Jun 27, 2017 at 9:11 AM, Dave Page  wrote:
>>
>>> Can you rebase this patch please?
>>>
>>> Thankfully I think we're basically at the end of our changes in this
>>> area!
>>>
>>> On Mon, Jun 26, 2017 at 10:08 AM, Joao Pedro De Almeida Pereira <
>>> jdealmeidapere...@pivotal.io> wrote:
>>>
 Hi Surinder,

 You can find our answers inline and attached the patch with the change
 of scrolls from "scroll" to "auto"

 On Mon, Jun 26, 2017 at 4:47 AM, Surinder Kumar <
 surinder.ku...@enterprisedb.com> wrote:

> Hi
> On Fri, Jun 23, 2017 at 11:39 PM, George Gelashvili <
> ggelashv...@pivotal.io> wrote:
>
>> On Fri, Jun 23, 2017 at 11:24 AM, Surinder Kumar <
>> surinder.ku...@enterprisedb.com> wrote:
>>
>>> Hi
>>>
>>> Review comments:
>>>
>>> ​1. ​
>>> Can we set "message"(in message detail) style property scroll to
>>> ​'​
>>> auto
>>> ​'​
>>>  instead of
>>> ​'​
>>> scroll
>>> ​'​
>>>  ?
>>>
>>
>> Could you elaborate why 'auto' is what we want?
>>
> ​The scroll bars should appear only when content is beyond the
> width/height of container.​ Now with 'scroll', the border layout around
> container appears irrespective of content width/height. If we set 'auto',
> it won't appear.
>

 We changed that in the attached patch. The scroll bars will now appear
 when the text exceeds the window.


>> ​2. CSS property flex is supported for IE >= 9 as per reference
 
 ​. I tested this patch on IE and layout is broken.​

  Anyways IE-9/10 are outdated and no longer supported by
>>> Microsoft, the only supported browsers are IE-11+.
>>>
>>
>> Does this patch work in supported IEs?
>>
> ​I use Windows 7 which has IE9,10, but if we can fix it for IE9,10 we
> should fix. Majority of people are still using IE9,10.​
>

 We based almost 100% of this patch on Flexbox. In order to use another
 structure, we would have to rewrite the html blocks (the majority of the
 UI). If the community believes that is important to keep giving support to
 Browsers that are no longer supported then we can use a library like
 modernizr  to try to support all the existing
 browser. Nevertheless we believe that this should be done in a future 
 patch.


>> 3. ​Can the CSS styles in ‘history_detail_message.jsx’ moved out in
>>> a separate stylesheet file
>>> ​ as inline styles in html are never recommended.​
>>>
>>
>> We've been trying to use inline styles rather than classes for our
>> react jsx code, as this keeps element behavior declarative. This includes
>> both functionality and appearance.
>> So far the pattern has been to extract styles used by more than one
>> component to jsx/styles.
>>
> ​Can we use classes and then write css around classes thus preserving
> element behaviour declarative ?​
>

 We believe that this should be a conversation to have next Friday in
 the Hackers Community Forum. In the meanwhile we hope this is not a blocker
 to the merge of this patch.


>
>> ​4. In 'codemirror.jsx', setInterval is used to bind
>>> hydrateWhenBecomesVisible function after every 100ms. Can setTimeout ​be
>>> used as it needs to bind only once ?
>>> Also if setInterval is used, in componentWillUnmount
>>> clearInterval(...) should be implemented.
>>>
>>
>> We actually need to poll, as otherwise the codemirror element will
>> render with its last state (so, incorrect query history)
>>
>> 5. The text like 'Rows Affected' or 'Duration' should be wrapped in
>>> 'gettext' for translation?
>>
>>
>> We are working on using translations in React components. This needs
>> additional effort and we'll send this in a separate patch.
>>
>> Thanks
>> Shruti and George
>>
>
>
 Thanks,
 Joao and Shruti

>>>
>>>
>>>
>>> --
>>> Dave Page
>>> Blog: http://pgsnake.blogspot.com
>>> Twitter: @pgsnake
>>>
>>> EnterpriseDB UK: http://w

Re: [pgadmin-hackers][patch] History Detail Pane

2017-06-27 Thread Robert Eckhardt
Harshal,

Thanks for taking a look. That exact feature should be in our next patch
along with a few style changes.

-- Rob

On Tue, Jun 27, 2017 at 2:03 PM, Harshal Dhumal <
harshal.dhu...@enterprisedb.com> wrote:

> Hi,
>
> New history pane is really nice and informative than existing one.
> I'm just thinking about one minor improvement we can make, to allow
> history tab to respond to up and down arrow keys so that user can easily
> switch between executed queries without using mouse.
>
>
> Thanks,
>
> --
> *Harshal Dhumal*
> *Sr. Software Engineer*
>
> EnterpriseDB India: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
> On Tue, Jun 27, 2017 at 8:26 PM, Dave Page  wrote:
>
>> Thanks - patch applied (just in time for Raffi's & my talk)!
>>
>> On Tue, Jun 27, 2017 at 10:05 AM, Joao Pedro De Almeida Pereira <
>> jdealmeidapere...@pivotal.io> wrote:
>>
>>> Yep,
>>> please see attached
>>>
>>> On Tue, Jun 27, 2017 at 9:11 AM, Dave Page  wrote:
>>>
 Can you rebase this patch please?

 Thankfully I think we're basically at the end of our changes in this
 area!

 On Mon, Jun 26, 2017 at 10:08 AM, Joao Pedro De Almeida Pereira <
 jdealmeidapere...@pivotal.io> wrote:

> Hi Surinder,
>
> You can find our answers inline and attached the patch with the change
> of scrolls from "scroll" to "auto"
>
> On Mon, Jun 26, 2017 at 4:47 AM, Surinder Kumar <
> surinder.ku...@enterprisedb.com> wrote:
>
>> Hi
>> On Fri, Jun 23, 2017 at 11:39 PM, George Gelashvili <
>> ggelashv...@pivotal.io> wrote:
>>
>>> On Fri, Jun 23, 2017 at 11:24 AM, Surinder Kumar <
>>> surinder.ku...@enterprisedb.com> wrote:
>>>
 Hi

 Review comments:

 ​1. ​
 Can we set "message"(in message detail) style property scroll to
 ​'​
 auto
 ​'​
  instead of
 ​'​
 scroll
 ​'​
  ?

>>>
>>> Could you elaborate why 'auto' is what we want?
>>>
>> ​The scroll bars should appear only when content is beyond the
>> width/height of container.​ Now with 'scroll', the border layout around
>> container appears irrespective of content width/height. If we set 'auto',
>> it won't appear.
>>
>
> We changed that in the attached patch. The scroll bars will now appear
> when the text exceeds the window.
>
>
>>> ​2. CSS property flex is supported for IE >= 9 as per reference
> 
> ​. I tested this patch on IE and layout is broken.​
>
>  Anyways IE-9/10 are outdated and no longer supported by
 Microsoft, the only supported browsers are IE-11+.

>>>
>>> Does this patch work in supported IEs?
>>>
>> ​I use Windows 7 which has IE9,10, but if we can fix it for IE9,10 we
>> should fix. Majority of people are still using IE9,10.​
>>
>
> We based almost 100% of this patch on Flexbox. In order to use another
> structure, we would have to rewrite the html blocks (the majority of the
> UI). If the community believes that is important to keep giving support to
> Browsers that are no longer supported then we can use a library like
> modernizr  to try to support all the existing
> browser. Nevertheless we believe that this should be done in a future 
> patch.
>
>
>>> 3. ​Can the CSS styles in ‘history_detail_message.jsx’ moved out in
 a separate stylesheet file
 ​ as inline styles in html are never recommended.​

>>>
>>> We've been trying to use inline styles rather than classes for our
>>> react jsx code, as this keeps element behavior declarative. This 
>>> includes
>>> both functionality and appearance.
>>> So far the pattern has been to extract styles used by more than one
>>> component to jsx/styles.
>>>
>> ​Can we use classes and then write css around classes thus preserving
>> element behaviour declarative ?​
>>
>
> We believe that this should be a conversation to have next Friday in
> the Hackers Community Forum. In the meanwhile we hope this is not a 
> blocker
> to the merge of this patch.
>
>
>>
>>> ​4. In 'codemirror.jsx', setInterval is used to bind
 hydrateWhenBecomesVisible function after every 100ms. Can setTimeout 
 ​be
 used as it needs to bind only once ?
 Also if setInterval is used, in componentWillUnmount
 clearInterval(...) should be implemented.

>>>
>>> We actually need to poll, as otherwise the codemirror element will
>>> render with its last state (so, incorrect query history)
>>>
>>> 5. The text like 'Rows Affected' or 'Duration' should be wrapped in
 'gettext' for translation

Re: [pgAdmin4][Patch] To fix the issue in Debugger module

2017-06-27 Thread Dave Page
Thanks, patch applied.

On Tue, Jun 27, 2017 at 4:21 AM, Murtuza Zabuawala <
murtuza.zabuaw...@enterprisedb.com> wrote:

> Hi Dave
>
> Please find updated patch,
>
> On Fri, Jun 23, 2017 at 7:09 PM, Dave Page  wrote:
>
>> Hi
>>
>> I'm unable to properly test this, as the debugger doesn't even seem to
>> launch for a non-superuser. I just get a white tab, and a whole lot of
>> polling indefinitely. Can you debug if you're not a superuser, but you
>> own the function?
>>
>> I tested this scenario both ways,
> 1) Direct debugging: I was able to debug function, when debugger library
> is loaded via shared preload libraries and also when it is not loaded.
> 2) Indirect debugging: I was not able to debug.
> So, I have added the validation in both Server and Client side, Now we
> will not show the option for the same if user is non-super user.
>
> Looking at the patch itself, I wonder if the logic is still a little
>> off. You need to be a superuser to use indirect debugging (because of
>> the DOS potential), so shouldn't the superuser check be changed to "if
>> !superuser then throw error"? As it is, if you're not superuser then
>> it just skips the check for the plugin, which seems like it'll never
>> end well.
>>
>> Fixed.
>
>>
>> On Fri, Jun 23, 2017 at 1:35 PM, Murtuza Zabuawala
>>  wrote:
>> > Hi Dave,
>> >
>> > Please find updated patch.
>> >
>> > --
>> > Regards,
>> > Murtuza Zabuawala
>> > EnterpriseDB: http://www.enterprisedb.com
>> > The Enterprise PostgreSQL Company
>> >
>> > On Fri, Jun 23, 2017 at 2:38 PM, Murtuza Zabuawala
>> >  wrote:
>> >>
>> >> Yes, I'm looking into it, I will send updated patch.
>> >>
>> >> --
>> >> Regards,
>> >> Murtuza Zabuawala
>> >> EnterpriseDB: http://www.enterprisedb.com
>> >> The Enterprise PostgreSQL Company
>> >>
>> >> On Fri, Jun 23, 2017 at 2:32 PM, Dave Page  wrote:
>> >>>
>> >>> On Fri, Jun 23, 2017 at 9:56 AM, Murtuza Zabuawala
>> >>>  wrote:
>> >>> > Yes Dave,
>> >>> >
>> >>> > You are right, I tested and found that indirect debugging is not
>> >>> > working.
>> >>> > But otherwise for direct debugging it works properly.
>> >>>
>> >>> Does the patch take that into account, or are you modifying it?
>> >>>
>> >>> > On Fri, Jun 23, 2017 at 1:20 PM, Dave Page 
>> wrote:
>> >>> >>
>> >>> >> On Fri, Jun 23, 2017 at 7:16 AM, Murtuza Zabuawala
>> >>> >>  wrote:
>> >>> >> > Hi,
>> >>> >> >
>> >>> >> > PFA patch to fix the issue in Debugger module where it was
>> unable to
>> >>> >> > start
>> >>> >> > debugging if 'plugin_debugger' can not found in
>> >>> >> > shared_preload_libraries.
>> >>> >> > RM#2162
>> >>> >> >
>> >>> >> > Original patch by: Kit Yam Tse
>> >>> >> > (who reported the issue)
>> >>> >> >
>> >>> >> > I just re-based it against current code.
>> >>> >>
>> >>> >> Isn't that code required? We do need plugin_debugger to be present
>> for
>> >>> >> global (indirect) debugging to work. I suppose it may not be
>> required
>> >>> >> for direct debugging, but I haven't tested that.
>> >>> >>
>> >>> >>
>> >>> >> --
>> >>> >> Dave Page
>> >>> >> Blog: http://pgsnake.blogspot.com
>> >>> >> Twitter: @pgsnake
>> >>> >>
>> >>> >> EnterpriseDB UK: http://www.enterprisedb.com
>> >>> >> The Enterprise PostgreSQL Company
>> >>> >
>> >>> >
>> >>>
>> >>>
>> >>>
>> >>> --
>> >>> Dave Page
>> >>> Blog: http://pgsnake.blogspot.com
>> >>> Twitter: @pgsnake
>> >>>
>> >>> EnterpriseDB UK: http://www.enterprisedb.com
>> >>> The Enterprise PostgreSQL Company
>> >>
>> >>
>> >
>>
>>
>>
>> --
>> Dave Page
>> Blog: http://pgsnake.blogspot.com
>> Twitter: @pgsnake
>>
>> EnterpriseDB UK: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>>
>
>


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

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


pgAdmin 4 commit: Allow non-superusers to debug their own functions and

2017-06-27 Thread Dave Page
Allow non-superusers to debug their own functions and prevent them from setting 
global breakpoints. Fixes #2162

Based on a patch from Kit Yam Tse

Branch
--
master

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

Modified Files
--
web/pgadmin/tools/debugger/__init__.py | 40 --
.../debugger/templates/debugger/js/debugger.js | 40 +-
2 files changed, 53 insertions(+), 27 deletions(-)



pgAdmin 4 commit: Update preferences docs.

2017-06-27 Thread Dave Page
Update preferences docs.

Branch
--
master

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

Modified Files
--
docs/en_US/images/preferences_sql_options.png | Bin 49360 -> 232229 bytes
docs/en_US/preferences.rst|  24 +++-
2 files changed, 15 insertions(+), 9 deletions(-)



pgAdmin 4 commit: Fix image size.

2017-06-27 Thread Dave Page
Fix image size.

Branch
--
master

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

Modified Files
--
docs/en_US/images/server_advanced.png | Bin 75902 -> 41923 bytes
1 file changed, 0 insertions(+), 0 deletions(-)



Re: [pgAdmin4][Patch] To add preferences for brace matching and auto brace closing

2017-06-27 Thread Dave Page
Thanks, applied.

On Tue, Jun 27, 2017 at 2:00 PM, Murtuza Zabuawala <
murtuza.zabuaw...@enterprisedb.com> wrote:

> Hi Dave,
>
> PFA patch for doc & screenshot.
>
> --
> Regards,
> Murtuza Zabuawala
> EnterpriseDB: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
> On Tue, Jun 27, 2017 at 7:43 PM, Murtuza Zabuawala  enterprisedb.com> wrote:
>
>> Sure Dave, I'll do the needful.
>>
>> --
>> Regards,
>> Murtuza Zabuawala
>> EnterpriseDB: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>>
>> On Tue, Jun 27, 2017 at 7:29 PM, Dave Page  wrote:
>>
>>> Thanks - patch applied with some minor tweaks to enable both options by
>>> default and adjust the help wording.
>>>
>>> However, I realised right as I committed it, that you haven't updated
>>> the docs. Can you please update the screenshots affected and add the two
>>> new options to the docs please?
>>>
>>> Thanks.
>>>
>>> On Tue, Jun 27, 2017 at 9:21 AM, Murtuza Zabuawala <
>>> murtuza.zabuaw...@enterprisedb.com> wrote:
>>>
 Hi,

 Please find patch to add preferences for brace matching and auto brace
 closing in SQL editor.
 RM#2513

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


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

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


Re: [pgadmin-hackers] Re: Server side cursor limitations for on demand loading of data in query tool [RM2137] [pgAdmin4]

2017-06-27 Thread Robert Eckhardt
On Tue, Jun 27, 2017 at 5:03 PM, Joao Pedro De Almeida Pereira <
jdealmeidapere...@pivotal.io> wrote:

> Hello Hackers,
>
> When we started the app we noticed some change in the front end.
>
> The line numbers in the Editor:
> - We noticed a bug with the numbers where at 1 rows, the numbers would
> be cut off.
> - When the row is selected the color of the text should be white
> - Centering the number column would differentiate it from the rest of the
> table and prevent any confusion
>
>
Do we want line numbers? I'm of mixed opinion. On the one hand it implies
and ordered set of results when Postgres inherently doesn't order results.
On the other hand it nicely tells you where you are in the results set if
you are scrolling around.

-- Rob


Re: [pgadmin-hackers] Re: Server side cursor limitations for on demand loading of data in query tool [RM2137] [pgAdmin4]

2017-06-27 Thread Dave Page


> On 27 Jun 2017, at 17:18, Robert Eckhardt  wrote:
> 
> 
> 
>> On Tue, Jun 27, 2017 at 5:03 PM, Joao Pedro De Almeida Pereira 
>>  wrote:
>> Hello Hackers,
>> 
>> When we started the app we noticed some change in the front end.
>> 
>> The line numbers in the Editor: 
>> - We noticed a bug with the numbers where at 1 rows, the numbers would 
>> be cut off.
>> - When the row is selected the color of the text should be white 
>> - Centering the number column would differentiate it from the rest of the 
>> table and prevent any confusion
>> 
> 
> Do we want line numbers? I'm of mixed opinion. On the one hand it implies and 
> ordered set of results when Postgres inherently doesn't order results. On the 
> other hand it nicely tells you where you are in the results set if you are 
> scrolling around. 

Yes, they are incredibly useful.

Jenkins build is back to normal : pgadmin4-master-python36 #201

2017-06-27 Thread pgAdmin 4 Jenkins
See 





Re: [pgadmin-hackers][patch] History Detail Pane

2017-06-27 Thread Khushboo Vashi
On Tue, Jun 27, 2017 at 8:26 PM, Dave Page  wrote:

> Thanks - patch applied (just in time for Raffi's & my talk)!
>
> The history tab looks really very good.

> On Tue, Jun 27, 2017 at 10:05 AM, Joao Pedro De Almeida Pereira <
> jdealmeidapere...@pivotal.io> wrote:
>
>> Yep,
>> please see attached
>>
>> On Tue, Jun 27, 2017 at 9:11 AM, Dave Page  wrote:
>>
>>> Can you rebase this patch please?
>>>
>>> Thankfully I think we're basically at the end of our changes in this
>>> area!
>>>
>>> On Mon, Jun 26, 2017 at 10:08 AM, Joao Pedro De Almeida Pereira <
>>> jdealmeidapere...@pivotal.io> wrote:
>>>
 Hi Surinder,

 You can find our answers inline and attached the patch with the change
 of scrolls from "scroll" to "auto"

 On Mon, Jun 26, 2017 at 4:47 AM, Surinder Kumar <
 surinder.ku...@enterprisedb.com> wrote:

> Hi
> On Fri, Jun 23, 2017 at 11:39 PM, George Gelashvili <
> ggelashv...@pivotal.io> wrote:
>
>> On Fri, Jun 23, 2017 at 11:24 AM, Surinder Kumar <
>> surinder.ku...@enterprisedb.com> wrote:
>>
>>> Hi
>>>
>>> Review comments:
>>>
>>> ​1. ​
>>> Can we set "message"(in message detail) style property scroll to
>>> ​'​
>>> auto
>>> ​'​
>>>  instead of
>>> ​'​
>>> scroll
>>> ​'​
>>>  ?
>>>
>>
>> Could you elaborate why 'auto' is what we want?
>>
> ​The scroll bars should appear only when content is beyond the
> width/height of container.​ Now with 'scroll', the border layout around
> container appears irrespective of content width/height. If we set 'auto',
> it won't appear.
>

 We changed that in the attached patch. The scroll bars will now appear
 when the text exceeds the window.


>> ​2. CSS property flex is supported for IE >= 9 as per reference
 
 ​. I tested this patch on IE and layout is broken.​

  Anyways IE-9/10 are outdated and no longer supported by
>>> Microsoft, the only supported browsers are IE-11+.
>>>
>>
>> Does this patch work in supported IEs?
>>
> ​I use Windows 7 which has IE9,10, but if we can fix it for IE9,10 we
> should fix. Majority of people are still using IE9,10.​
>

 We based almost 100% of this patch on Flexbox. In order to use another
 structure, we would have to rewrite the html blocks (the majority of the
 UI). If the community believes that is important to keep giving support to
 Browsers that are no longer supported then we can use a library like
 modernizr  to try to support all the existing
 browser. Nevertheless we believe that this should be done in a future 
 patch.


>> 3. ​Can the CSS styles in ‘history_detail_message.jsx’ moved out in
>>> a separate stylesheet file
>>> ​ as inline styles in html are never recommended.​
>>>
>>
>> We've been trying to use inline styles rather than classes for our
>> react jsx code, as this keeps element behavior declarative. This includes
>> both functionality and appearance.
>> So far the pattern has been to extract styles used by more than one
>> component to jsx/styles.
>>
> ​Can we use classes and then write css around classes thus preserving
> element behaviour declarative ?​
>

 We believe that this should be a conversation to have next Friday in
 the Hackers Community Forum. In the meanwhile we hope this is not a blocker
 to the merge of this patch.


>
>> ​4. In 'codemirror.jsx', setInterval is used to bind
>>> hydrateWhenBecomesVisible function after every 100ms. Can setTimeout ​be
>>> used as it needs to bind only once ?
>>> Also if setInterval is used, in componentWillUnmount
>>> clearInterval(...) should be implemented.
>>>
>>
>> We actually need to poll, as otherwise the codemirror element will
>> render with its last state (so, incorrect query history)
>>
>> 5. The text like 'Rows Affected' or 'Duration' should be wrapped in
>>> 'gettext' for translation?
>>
>>
>> We are working on using translations in React components. This needs
>> additional effort and we'll send this in a separate patch.
>>
>> Thanks
>> Shruti and George
>>
>
>
 Thanks,
 Joao and Shruti

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


Re: [pgAdmin4][Patch]: Feature #2506 - Allow the dashboard panel to be closed

2017-06-27 Thread Khushboo Vashi
Hi Dave,

On Tue, Jun 27, 2017 at 8:08 PM, Dave Page  wrote:

> Hi
>
> I've had to revert this. Whilst it seems to work, after showing/hiding the
> dashboard, I later find that when I completely reload the app, it fails,
> leaving just the object menu present. I haven't come up with a concrete
> case to reproduce it. In the console, I see:
>
>
> wcDocker.min.js:38 Uncaught TypeError: Cannot read property '__save' of
> null at e.save (wcDocker.min.js:38) at Object.save_current_layout (
> browser.js:340) at e.handleVisibility (panel.js:156) at e.__trigger (
> wcDocker.min.js:34) at e.trigger (wcDocker.min.js:38) at e.clear (
> wcDocker.min.js:38) at Object.init (browser.js:386) at (index):278 at
> Object.execCb (require.min.js:29) at Z.check (require.min.js:18)
>
> I couldn't reproduce this issue. I have tried many things to reproduce it
but not succeeded. I also switched server_mode but no luck.
I think there should be any specific condition that fails this but have no
clue.

I have rebased this patch and attached.


> On Tue, Jun 27, 2017 at 9:21 AM, Dave Page  wrote:
>
>> Thanks, patch applied.
>>
>> On Tue, Jun 27, 2017 at 2:58 AM, Khushboo Vashi <
>> khushboo.va...@enterprisedb.com> wrote:
>>
>>> Hi,
>>>
>>> Please find the attached updated patch.
>>>
>>> Thanks,
>>> Khushboo
>>>
>>> On Mon, Jun 26, 2017 at 5:08 PM, Dave Page  wrote:
>>>
 Hi

 Looks good, except that when I close the dashboard panel, it continues
 to run the queries to update the graphs until I change the selected
 treeview node. Can we stop it immediately?

 Fixed
>>>
 On Mon, Jun 26, 2017 at 1:56 AM, Khushboo Vashi
  wrote:
 > Hi,
 >
 > Please find the attached patch for the feature #2506: Allow the
 dashboard
 > panel to be closed.
 >
 > Thanks,
 > Khushboo



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

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

>>>
>>>
>>
>>
>> --
>> Dave Page
>> Blog: http://pgsnake.blogspot.com
>> Twitter: @pgsnake
>>
>> EnterpriseDB UK: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>>
>
>
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
diff --git a/web/pgadmin/browser/static/js/panel.js b/web/pgadmin/browser/static/js/panel.js
index 71d2c68..ce21f0d 100644
--- a/web/pgadmin/browser/static/js/panel.js
+++ b/web/pgadmin/browser/static/js/panel.js
@@ -7,7 +7,8 @@ function(_, pgAdmin) {
   pgAdmin.Browser.Panel = function(options) {
 var defaults = [
   'name', 'title', 'width', 'height', 'showTitle', 'isCloseable',
-  'isPrivate', 'content', 'icon', 'events', 'onCreate', 'elContainer'
+  'isPrivate', 'content', 'icon', 'events', 'onCreate', 'elContainer',
+  'canHide', 'limit'
 ];
 _.extend(this, _.pick(options, defaults));
   }
@@ -25,12 +26,14 @@ function(_, pgAdmin) {
 panel: null,
 onCreate: null,
 elContainer: false,
+limit: null,
 load: function(docker, title) {
   var that = this;
   if (!that.panel) {
 docker.registerPanelType(that.name, {
   title: that.title,
   isPrivate: that.isPrivate,
+  limit: that.limit,
   onCreate: function(myPanel) {
 $(myPanel).data('pgAdminName', that.name);
 myPanel.initSize(that.width, that.height);
@@ -85,6 +88,14 @@ function(_, pgAdmin) {
   });
   that.resizedContainer.apply(myPanel);
 }
+
+// Bind events only if they are configurable
+if (that.canHide) {
+  _.each([wcDocker.EVENT.CLOSED, wcDocker.EVENT.VISIBILITY_CHANGED],
+function(ev) {
+  myPanel.on(ev, that.handleVisibility.bind(myPanel, ev));
+});
+}
   }
 });
   }
@@ -134,7 +145,32 @@ function(_, pgAdmin) {
   100
 );
   }
+},
+handleVisibility: function(eventName) {
+  // Currently this function only works with dashboard panel but
+  // as per need it can be extended
+  if (this._type != 'dashboard')
+return;
+
+  if (eventName == 'panelClosed') {
+pgBrowser.save_current_layout(pgBrowser);
+pgAdmin.Dashboard.toggleVisibility(false);
+  }
+  else if (eventName == 'panelVisibilityChanged') {
+if (pgBrowser.tree) {
+  pgBrowser.save_current_layout(pgBrowser);
+  var selectedNode = pgBrowser.tree.selected();
+  // Discontinue this event after first time visible
+  this.off(wcDocker.EVENT.VISIBILITY_CHANGED);
+  if (!_.isUndefined(pgAdmin.Dashboard))
+pgAdmin.Dashboard.toggleVisibility(true);
+  // Explicitly trigger tree selected event when we add the tab.
+  pgBrowser.Events.trigger('pgadmin-browser

Re: crypto.py bug on server add form (button save) with python 3.5 - Can't convert 'bytes' object to str implicitly

2017-06-27 Thread Khushboo Vashi
Hi,

Please find the attached patch which will fix the password
encryption/decryption for python3.
I have modified the fix suggested by Ladislav to work with both python2 and
python3.

Thanks,
Khushboo

On Tue, Jun 27, 2017 at 4:41 PM, Ladislav Jech  wrote:

> Hi,
> It will be good if you support fully github or any GIT repository for
> managing pull requests. Is there any or you wan't me to generate *.patch
> file? I am new to pgadmin 4, so not sure how this works. Let me know.
> Ladislav
>
> 2017-06-27 11:52 GMT+02:00 Khushboo Vashi  >:
>
>> Hi,
>>
>> Can you send the patch for the same. I think this is the valid fix.
>>
>> Thanks,
>> Khushboo
>>
>> On Tue, Jun 27, 2017 at 3:02 PM, Ladislav Jech 
>> wrote:
>>
>>> I am running on following Gentoo system with Python 3.5 as default
>>> (although i have 2.7 and 3.4 available to switch as well).
>>>
>>> I compiled from source code via github:
>>> commit 15cb9fc35b41736a331a452b9303a79e8f13ee36 (HEAD -> master,
>>> origin/master, origin/HEAD)
>>>
>>> The error appears when I want to click on Save while adding new server
>>> to the list, I put few lines into the code to detect the times:
>>> 2017-06-27 13:21:48,329: DEBUG pgadmin: Not running under the desktop
>>> runtime, port: 5050
>>> Starting pgAdmin 4. Please navigate to http://127.0.0.1:5050 in your
>>> browser.
>>> str var python type is 
>>> str var object's type is str
>>> padding_string var python type is 
>>> padding_string var object's type is bytes
>>> 2017-06-27 13:21:53,028: ERROR pgadmin: Can't convert 'bytes' object to
>>> str implicitly
>>> Traceback (most recent call last):
>>>   File 
>>> "/home/zangetsu/devel/tmp/pgadmin4/web/pgadmin/browser/server_groups/servers/__init__.py",
>>> line 619, in create
>>> password = encrypt(password, current_user.password)
>>>   File "/home/zangetsu/devel/tmp/pgadmin4/web/pgadmin/utils/crypto.py",
>>> line 31, in encrypt
>>> cipher = AES.new(pad(key), AES.MODE_CFB, iv)
>>>   File "/home/zangetsu/devel/tmp/pgadmin4/web/pgadmin/utils/crypto.py",
>>> line 80, in pad
>>> return str + ((32 - len(str) % 32) * padding_string)
>>> TypeError: Can't convert 'bytes' object to str implicitly
>>> 2017-06-27 13:21:53,031: INFO werkzeug: 127.0.0.1 - - [27/Jun/2017
>>> 13:21:53] "POST /browser/server/obj/2/ HTTP/1.1" 410 -
>>> 2017-06-27 13:22:49,936: INFO werkzeug: * Detected change in
>>> '/home/zangetsu/devel/tmp/pgadmin4/web/pgadmin/utils/crypto.py',
>>> reloading
>>> 2017-06-27 13:22:50,138: INFO werkzeug: * Restarting with reloader
>>>
>>> So this is the error:
>>> Can't convert 'bytes' object to str implicitly
>>>
>>> To fix this on Python 3.5 I simply changed in
>>> pgadmin4/web/pgadmin/utils/crypto.py file this line:
>>> return str + ((32 - len(str) % 32) * padding_string)
>>> to
>>> return str + ((32 - len(str) % 32) * padding_string.decode())
>>>
>>> Another solution could be to change whole str into bytes. Not sure what
>>> is better, but now it works.
>>>
>>
>>
>
diff --git a/web/pgadmin/utils/crypto.py b/web/pgadmin/utils/crypto.py
index 5d8bb50..1c16e6d 100644
--- a/web/pgadmin/utils/crypto.py
+++ b/web/pgadmin/utils/crypto.py
@@ -71,6 +71,10 @@ def pad(str):
 if str_len == 16 or str_len == 24 or str_len == 32:
 return str
 
+# Convert bytes to string (python3)
+if not hasattr(str, 'decode'):
+padding_string = padding_string.decode()
+
 # Add padding to make key 32 bytes long
 return str + ((32 - len(str) % 32) * padding_string)