Re: [RM2074][[RM2080]][pgAdmin4] handle large bytea and bytea[] data in datagrid

2017-07-18 Thread Harshal Dhumal
Hi Dave,


On Mon, Jul 17, 2017 at 9:33 PM, Dave Page  wrote:

> Hi
>
> On Mon, Jul 17, 2017 at 1:09 PM, Harshal Dhumal <
> harshal.dhu...@enterprisedb.com> wrote:
>
>> Hi,
>>
>> Please find updated patch. Now placeholder string for bytea and bytea[]
>> data will only appear in datagrid (view all/1000/500 rows). If user
>> executes query using Query tool then placeholder won't appear (similar to
>>  pgAdminIII behaviour)
>>
>
> I'm getting the following error when testing this:
>

I ran all feature test cases 5-6 times and each time they ran successfully.
May be this is occasional failure which we get after running test cases for
many times.

Please let me know if you are getting this failure consistently at your end.



>
> ==
> ERROR: runTest (pgadmin.feature_tests.view_data_dml_queries.
> CheckForViewDataTest)
> Validate Insert, Update operations in View/Edit data with given test data
> --
> Traceback (most recent call last):
>   File 
> "/Users/dpage/git/pgadmin4/web/pgadmin/feature_tests/view_data_dml_queries.py",
> line 104, in runTest
> self._add_row()
>   File 
> "/Users/dpage/git/pgadmin4/web/pgadmin/feature_tests/view_data_dml_queries.py",
> line 264, in _add_row
> self._update_cell(cell_xpath, config_data[str(idx)])
>   File 
> "/Users/dpage/git/pgadmin4/web/pgadmin/feature_tests/view_data_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/pgadmin_page.py",
> line 148, in find_by_xpath
> return self.wait_for_element(lambda driver:
> driver.find_element_by_xpath(xpath))
>   File 
> "/Users/dpage/git/pgadmin4/web/regression/feature_utils/pgadmin_page.py",
> line 231, in wait_for_element
> return self._wait_for("element to exist", element_if_it_exists)
>   File 
> "/Users/dpage/git/pgadmin4/web/regression/feature_utils/pgadmin_page.py",
> line 281, in _wait_for
> "Timed out waiting for " + waiting_for_message)
>   File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-
> packages/selenium/webdriver/support/wait.py", line 71, in until
> value = method(self._driver)
>   File 
> "/Users/dpage/git/pgadmin4/web/regression/feature_utils/pgadmin_page.py",
> line 226, in element_if_it_exists
> if element.is_displayed() and element.is_enabled():
>   File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-
> packages/selenium/webdriver/remote/webelement.py", line 157, in is_enabled
> return self._execute(Command.IS_ELEMENT_ENABLED)['value']
>   File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-
> packages/selenium/webdriver/remote/webelement.py", line 491, in _execute
> return self._parent.execute(command, params)
>   File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-
> packages/selenium/webdriver/remote/webdriver.py", line 238, in execute
> self.error_handler.check_response(response)
>   File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-
> packages/selenium/webdriver/remote/errorhandler.py", line 193, in
> check_response
> raise exception_class(message, screen, stacktrace)
> StaleElementReferenceException: Message: stale element reference: element
> is not attached to the page document
>   (Session info: chrome=59.0.3071.115)
>   (Driver info: chromedriver=2.29.461585 
> (0be2cd95f834e9ee7c46bcc7cf405b483f5ae83b),platform=Mac
> OS X 10.12.5 x86_64)
>
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>


Re: [RM2074][[RM2080]][pgAdmin4] handle large bytea and bytea[] data in datagrid

2017-07-18 Thread Dave Page
On Tue, Jul 18, 2017 at 8:26 AM, Harshal Dhumal <
harshal.dhu...@enterprisedb.com> wrote:

> Hi Dave,
>
>
> On Mon, Jul 17, 2017 at 9:33 PM, Dave Page  wrote:
>
>> Hi
>>
>> On Mon, Jul 17, 2017 at 1:09 PM, Harshal Dhumal <
>> harshal.dhu...@enterprisedb.com> wrote:
>>
>>> Hi,
>>>
>>> Please find updated patch. Now placeholder string for bytea and bytea[]
>>> data will only appear in datagrid (view all/1000/500 rows). If user
>>> executes query using Query tool then placeholder won't appear (similar to
>>>  pgAdminIII behaviour)
>>>
>>
>> I'm getting the following error when testing this:
>>
>
> I ran all feature test cases 5-6 times and each time they ran successfully.
> May be this is occasional failure which we get after running test cases
> for many times.
>
> Please let me know if you are getting this failure consistently at your
> end.
>

I ran it twice and it failed twice. I can't keep running tests over and
over again as they take quite a while to run and I can't use my machine for
anything else at the same time as occasionally the test browser will grab
focus.

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

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


[PATCH] Persist opened nodes in tree

2017-07-18 Thread Versus Void
This will restore tree structure on load like in good old pgadmin3.



[PATCH] Persist opened nodes in tree

2017-07-18 Thread Versus Void
---
 web/pgadmin/browser/__init__.py|  13 +-
 .../browser/static/vendor/jStorage/jstorage.js | 996 +
 .../browser/static/vendor/jStorage/jstorage.min.js |  16 +
 .../browser/templates/browser/js/browser.js|   6 +-
 4 files changed, 1029 insertions(+), 2 deletions(-)
 create mode 100644 web/pgadmin/browser/static/vendor/jStorage/jstorage.js
 create mode 100644 web/pgadmin/browser/static/vendor/jStorage/jstorage.min.js

diff --git a/web/pgadmin/browser/__init__.py b/web/pgadmin/browser/__init__.py
index 77e052f0..ecf3afba 100644
--- a/web/pgadmin/browser/__init__.py
+++ b/web/pgadmin/browser/__init__.py
@@ -100,13 +100,24 @@ class BrowserModule(PgAdminModule):
 'preloaded': True
 })
 scripts.append({
+'name': 'jStorage',
+'path': url_for(
+'browser.static',
+filename='vendor/jStorage/jstorage' if
+current_app.debug else 'vendor/jStorage/jstorage.min'
+),
+'deps': ['jquery'],
+'exports': 'jStorage',
+'preloaded': True
+})
+scripts.append({
 'name': 'jquery.acitree',
 'path': url_for(
 'browser.static',
 filename='vendor/aciTree/jquery.aciTree' if
 current_app.debug else 'vendor/aciTree/jquery.aciTree.min'
 ),
-'deps': ['jquery', 'jquery.aciplugin'],
+'deps': ['jquery', 'jquery.aciplugin', 'jStorage'],
 'exports': 'aciPluginClass.plugins.aciTree',
 'preloaded': True
 })
diff --git a/web/pgadmin/browser/static/vendor/jStorage/jstorage.js 
b/web/pgadmin/browser/static/vendor/jStorage/jstorage.js
new file mode 100644
index ..1ac8fccc
--- /dev/null
+++ b/web/pgadmin/browser/static/vendor/jStorage/jstorage.js
@@ -0,0 +1,996 @@
+/*
+ * - JSTORAGE -
+ * Simple local storage wrapper to save data on the browser side, supporting
+ * all major browsers - IE6+, Firefox2+, Safari4+, Chrome4+ and Opera 10.5+
+ *
+ * Author: Andris Reinman, andris.rein...@gmail.com
+ * Project homepage: www.jstorage.info
+ *
+ * Licensed under Unlicense:
+ *
+ * This is free and unencumbered software released into the public domain.
+ *
+ * Anyone is free to copy, modify, publish, use, compile, sell, or
+ * distribute this software, either in source code form or as a compiled
+ * binary, for any purpose, commercial or non-commercial, and by any
+ * means.
+ *
+ * In jurisdictions that recognize copyright laws, the author or authors
+ * of this software dedicate any and all copyright interest in the
+ * software to the public domain. We make this dedication for the benefit
+ * of the public at large and to the detriment of our heirs and
+ * successors. We intend this dedication to be an overt act of
+ * relinquishment in perpetuity of all present and future rights to this
+ * software under copyright law.
+ *
+ * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * For more information, please refer to 
+ */
+
+/* global ActiveXObject: false */
+/* jshint browser: true */
+
+(function() {
+'use strict';
+
+var
+/* jStorage version */
+JSTORAGE_VERSION = '0.4.12',
+
+/* detect a dollar object or create one if not found */
+$ = window.jQuery || window.$ || (window.$ = {}),
+
+/* check for a JSON handling support */
+JSON = {
+parse: window.JSON && (window.JSON.parse || window.JSON.decode) ||
+String.prototype.evalJSON && function(str) {
+return String(str).evalJSON();
+} ||
+$.parseJSON ||
+$.evalJSON,
+stringify: Object.toJSON ||
+window.JSON && (window.JSON.stringify || window.JSON.encode) ||
+$.toJSON
+};
+
+// Break if no JSON support was found
+if (typeof JSON.parse !== 'function' || typeof JSON.stringify !== 
'function') {
+throw new Error('No JSON support found, include 
//cdnjs.cloudflare.com/ajax/libs/json2/20110223/json2.js to page');
+}
+
+var
+/* This is the object, that holds the cached values */
+_storage = {
+__jstorage_meta: {
+CRC32: {}
+}
+},
+
+/* Actual browser storage (localStorage or globalStorage['domain']) */
+_storage_service = {
+jStorage: '{}'
+},
+
+

Re: [pgadmin-hackers] 10k Tables and more

2017-07-18 Thread Dave Page
Hi

On Mon, Jul 17, 2017 at 7:08 PM, Joao De Almeida Pereira <
jdealmeidapere...@pivotal.io> wrote:

> Hi Hackers,
> We were looking at a schema that had 10k+ tables on it and we noticed a
> substantial decrease of performance while loading the tables and after they
> are loaded and we try to scroll over them.
>

Not overly surprising.


>
> After some search on the web we found a post of the ACITree maintainer
> here
> 
> and he states that the library was not meant to handle that amount of data.
>
>> Still, with whatever optimizations I'll be able to implement, 10k items
>> seem allot on one level. On a slow hardware you'll still have to wait
>> enough to get them created, scrolling will also be a problem ... I think.
>
>
> Is it a common scenario to have an extremely large number of tables?
>

Not really.


> We wanted to bring up this issue to solicit ideas for ways to improve the
> performance of large lists of tables in the ACITree.
>

We discussed replacing ACITree in the past. That's still an option of
course, though I've yet to find anything better.

A more generic solution might be to group tables if there are more than N -
e.g. add an extra level into the hierarchy dynamically splitting them up
into groups (which would probably also have to be dynamically defined to
allow for non-ascii naming) like A-D, E-H etc.

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

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


Re: [PATCH] Persist opened nodes in tree

2017-07-18 Thread Dave Page
Hi

This would be a welcome feature addition, but why not store the treeview
state in the configuration database? I'd prefer not to add another storage
mechanism without a very compelling reason.

If you need info on how it works, please feel free to ask questions.

Thanks.

On Tue, Jul 18, 2017 at 9:42 AM, Versus Void  wrote:

> ---
>  web/pgadmin/browser/__init__.py|  13 +-
>  .../browser/static/vendor/jStorage/jstorage.js | 996
> +
>  .../browser/static/vendor/jStorage/jstorage.min.js |  16 +
>  .../browser/templates/browser/js/browser.js|   6 +-
>  4 files changed, 1029 insertions(+), 2 deletions(-)
>  create mode 100644 web/pgadmin/browser/static/vendor/jStorage/jstorage.js
>  create mode 100644 web/pgadmin/browser/static/
> vendor/jStorage/jstorage.min.js
>
> diff --git a/web/pgadmin/browser/__init__.py
> b/web/pgadmin/browser/__init__.py
> index 77e052f0..ecf3afba 100644
> --- a/web/pgadmin/browser/__init__.py
> +++ b/web/pgadmin/browser/__init__.py
> @@ -100,13 +100,24 @@ class BrowserModule(PgAdminModule):
>  'preloaded': True
>  })
>  scripts.append({
> +'name': 'jStorage',
> +'path': url_for(
> +'browser.static',
> +filename='vendor/jStorage/jstorage' if
> +current_app.debug else 'vendor/jStorage/jstorage.min'
> +),
> +'deps': ['jquery'],
> +'exports': 'jStorage',
> +'preloaded': True
> +})
> +scripts.append({
>  'name': 'jquery.acitree',
>  'path': url_for(
>  'browser.static',
>  filename='vendor/aciTree/jquery.aciTree' if
>  current_app.debug else 'vendor/aciTree/jquery.
> aciTree.min'
>  ),
> -'deps': ['jquery', 'jquery.aciplugin'],
> +'deps': ['jquery', 'jquery.aciplugin', 'jStorage'],
>  'exports': 'aciPluginClass.plugins.aciTree',
>  'preloaded': True
>  })
> diff --git a/web/pgadmin/browser/static/vendor/jStorage/jstorage.js
> b/web/pgadmin/browser/static/vendor/jStorage/jstorage.js
> new file mode 100644
> index ..1ac8fccc
> --- /dev/null
> +++ b/web/pgadmin/browser/static/vendor/jStorage/jstorage.js
> @@ -0,0 +1,996 @@
> +/*
> + * - JSTORAGE --
> ---
> + * Simple local storage wrapper to save data on the browser side,
> supporting
> + * all major browsers - IE6+, Firefox2+, Safari4+, Chrome4+ and Opera
> 10.5+
> + *
> + * Author: Andris Reinman, andris.rein...@gmail.com
> + * Project homepage: www.jstorage.info
> + *
> + * Licensed under Unlicense:
> + *
> + * This is free and unencumbered software released into the public domain.
> + *
> + * Anyone is free to copy, modify, publish, use, compile, sell, or
> + * distribute this software, either in source code form or as a compiled
> + * binary, for any purpose, commercial or non-commercial, and by any
> + * means.
> + *
> + * In jurisdictions that recognize copyright laws, the author or authors
> + * of this software dedicate any and all copyright interest in the
> + * software to the public domain. We make this dedication for the benefit
> + * of the public at large and to the detriment of our heirs and
> + * successors. We intend this dedication to be an overt act of
> + * relinquishment in perpetuity of all present and future rights to this
> + * software under copyright law.
> + *
> + * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
> + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
> + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
> + * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
> + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
> + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
> + * OTHER DEALINGS IN THE SOFTWARE.
> + *
> + * For more information, please refer to 
> + */
> +
> +/* global ActiveXObject: false */
> +/* jshint browser: true */
> +
> +(function() {
> +'use strict';
> +
> +var
> +/* jStorage version */
> +JSTORAGE_VERSION = '0.4.12',
> +
> +/* detect a dollar object or create one if not found */
> +$ = window.jQuery || window.$ || (window.$ = {}),
> +
> +/* check for a JSON handling support */
> +JSON = {
> +parse: window.JSON && (window.JSON.parse ||
> window.JSON.decode) ||
> +String.prototype.evalJSON && function(str) {
> +return String(str).evalJSON();
> +} ||
> +$.parseJSON ||
> +$.evalJSON,
> +stringify: Object.toJSON ||
> +window.JSON && (window.JSON.stringify ||
> window.JSON.encode) ||
> +$.toJSON
> +};
> +
> +// Break if no JSON support 

Re: Testing out font changes in query editor tool

2017-07-18 Thread Dave Page
Done. Same location.

On Mon, Jul 17, 2017 at 7:58 PM, Shirley Wang  wrote:

> Thank you! We also realized it would be easier on people to have both Mac
> and Windows test builds from the same url above. If it's not too difficult,
> would you also be able to add that as well?
>
> On Mon, Jul 17, 2017 at 5:55 AM Dave Page  wrote:
>
>> On Fri, Jul 14, 2017 at 5:06 AM, Murtuza Zabuawala > enterprisedb.com> wrote:
>>
>>> Hi Shirley,
>>>
>>> It's easy on the eyes :)
>>>
>>
>> Agreed.
>>
>> As requested, there's a test build for Windows at
>> https://developer.pgadmin.org/~dpage/query_tool_font_test/
>>
>> --
>> 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][pgaweb][Patch] Add style guide to pga website

2017-07-18 Thread Dave Page
On Mon, Jul 17, 2017 at 7:51 PM, Joao De Almeida Pereira <
jdealmeidapere...@pivotal.io> wrote:

> Hello Hackers,
>
> With this patch we added the style guide to the current pgAdmin website.
> It is not 100% migrated yet, but we already have the Alerts and colors.
>
>
Thanks - applied with some minor styling and layout changes. Please check I
didn't break anything.

You obviously miss-spelt "colour", but I let that slide :-p

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

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


Re: [pgadmin-hackers][pgaweb][Patch] Add style guide to pga website

2017-07-18 Thread Robert Eckhardt
Looks good.

I assumed American spelling, should we use proper English spelling? Our
prodigious use of the 'z' (pronounced zee) definitely improves our scrabble
scores.

-- Rob

On Tue, Jul 18, 2017 at 7:54 AM, Dave Page  wrote:

>
>
> On Mon, Jul 17, 2017 at 7:51 PM, Joao De Almeida Pereira <
> jdealmeidapere...@pivotal.io> wrote:
>
>> Hello Hackers,
>>
>> With this patch we added the style guide to the current pgAdmin website.
>> It is not 100% migrated yet, but we already have the Alerts and colors.
>>
>>
> Thanks - applied with some minor styling and layout changes. Please check
> I didn't break anything.
>
> You obviously miss-spelt "colour", but I let that slide :-p
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>


Re: [pgadmin-hackers][pgaweb][Patch] Add style guide to pga website

2017-07-18 Thread Dave Page
On Tue, Jul 18, 2017 at 1:15 PM, Robert Eckhardt 
wrote:

> Looks good.
>

Thanks. I just noticed though, that we're trying to link to github.css, and
failing. Was that intended to be in the same directory as all the scss?


>
> I assumed American spelling, should we use proper English spelling? Our
> prodigious use of the 'z' (pronounced zee) definitely improves our scrabble
> scores.
>

That's a definite benefit. I tend to try to use en_GB by default, partly
because I'm, well, English, and partly because I like to wind up people who
think the only English is en_US (of which there are a surprisingly large
amount).


>
> -- Rob
>
> On Tue, Jul 18, 2017 at 7:54 AM, Dave Page  wrote:
>
>>
>>
>> On Mon, Jul 17, 2017 at 7:51 PM, Joao De Almeida Pereira <
>> jdealmeidapere...@pivotal.io> wrote:
>>
>>> Hello Hackers,
>>>
>>> With this patch we added the style guide to the current pgAdmin website.
>>> It is not 100% migrated yet, but we already have the Alerts and colors.
>>>
>>>
>> Thanks - applied with some minor styling and layout changes. Please check
>> I didn't break anything.
>>
>> You obviously miss-spelt "colour", but I let that slide :-p
>>
>> --
>> 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: Testing out font changes in query editor tool

2017-07-18 Thread Shirley Wang
Thank you!

On Tue, Jul 18, 2017 at 7:03 AM Dave Page  wrote:

> Done. Same location.
>
> On Mon, Jul 17, 2017 at 7:58 PM, Shirley Wang  wrote:
>
>> Thank you! We also realized it would be easier on people to have both Mac
>> and Windows test builds from the same url above. If it's not too difficult,
>> would you also be able to add that as well?
>>
>> On Mon, Jul 17, 2017 at 5:55 AM Dave Page  wrote:
>>
>>> On Fri, Jul 14, 2017 at 5:06 AM, Murtuza Zabuawala <
>>> murtuza.zabuaw...@enterprisedb.com> wrote:
>>>
 Hi Shirley,

 It's easy on the eyes :)

>>>
>>> Agreed.
>>>
>>> As requested, there's a test build for Windows at
>>> https://developer.pgadmin.org/~dpage/query_tool_font_test/
>>>
>>> --
>>> 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: [RM2074][[RM2080]][pgAdmin4] handle large bytea and bytea[] data in datagrid

2017-07-18 Thread Harshal Dhumal
Hi Dave,

On Tue, Jul 18, 2017 at 1:24 PM, Dave Page  wrote:

>
>
> On Tue, Jul 18, 2017 at 8:26 AM, Harshal Dhumal <
> harshal.dhu...@enterprisedb.com> wrote:
>
>> Hi Dave,
>>
>>
>> On Mon, Jul 17, 2017 at 9:33 PM, Dave Page  wrote:
>>
>>> Hi
>>>
>>> On Mon, Jul 17, 2017 at 1:09 PM, Harshal Dhumal <
>>> harshal.dhu...@enterprisedb.com> wrote:
>>>
 Hi,

 Please find updated patch. Now placeholder string for bytea and bytea[]
 data will only appear in datagrid (view all/1000/500 rows). If user
 executes query using Query tool then placeholder won't appear (similar to
  pgAdminIII behaviour)

>>>
>>> I'm getting the following error when testing this:
>>>
>>
>> I ran all feature test cases 5-6 times and each time they ran
>> successfully.
>> May be this is occasional failure which we get after running test cases
>> for many times.
>>
>> Please let me know if you are getting this failure consistently at your
>> end.
>>
>
> I ran it twice and it failed twice. I can't keep running tests over and
> over again as they take quite a while to run and I can't use my machine for
> anything else at the same time as occasionally the test browser will grab
> focus.
>

Please find updated patch.
I have slightly modified feature test case for 'view data dml queries'
(though I wasn't getting failure as mentioned).


>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
diff --git a/web/pgadmin/feature_tests/view_data_dml_queries.py b/web/pgadmin/feature_tests/view_data_dml_queries.py
index 6454a3e..3a14e47 100644
--- a/web/pgadmin/feature_tests/view_data_dml_queries.py
+++ b/web/pgadmin/feature_tests/view_data_dml_queries.py
@@ -100,6 +100,7 @@ CREATE TABLE public.defaults
 # Open Object -> View/Edit data
 self._view_data_grid()
 
+self.page.wait_for_query_tool_loading_indicator_to_disappear()
 # Run test to insert a new row in table with default values
 self._add_row()
 self._verify_row_data(True)
@@ -158,6 +159,7 @@ CREATE TABLE public.defaults
 Returns: None
 
 """
+
 self.wait.until(EC.visibility_of_element_located(
 (By.XPATH, xpath)), CheckForViewDataTest.TIMEOUT_STRING
 )
@@ -195,6 +197,8 @@ CREATE TABLE public.defaults
 self.page.toggle_open_tree_item(self.server['name'])
 self.page.toggle_open_tree_item('Databases')
 self.page.toggle_open_tree_item('acceptance_test_db')
+# wait until all database dependant modules/js are loaded.
+time.sleep(5)
 self.page.toggle_open_tree_item('Schemas')
 self.page.toggle_open_tree_item('public')
 self.page.toggle_open_tree_item('Tables')
@@ -261,6 +265,7 @@ CREATE TABLE public.defaults
 cell_xpath = CheckForViewDataTest._get_cell_xpath(
 'r'+str(idx), 1
 )
+time.sleep(0.4)
 self._update_cell(cell_xpath, config_data[str(idx)])
 
 self.page.find_by_id("btn-save").click()  # Save data
diff --git a/web/pgadmin/tools/datagrid/__init__.py b/web/pgadmin/tools/datagrid/__init__.py
index 95c83dd..08b01ab 100644
--- a/web/pgadmin/tools/datagrid/__init__.py
+++ b/web/pgadmin/tools/datagrid/__init__.py
@@ -117,7 +117,8 @@ def initialize_datagrid(cmd_type, obj_type, sid, did, obj_id):
 conn_id = str(random.randint(1, 999))
 try:
 manager = get_driver(PG_DEFAULT_DRIVER).connection_manager(sid)
-conn = manager.connection(did=did, conn_id=conn_id)
+conn = manager.connection(did=did, conn_id=conn_id,
+  use_binary_placeholder=True)
 except Exception as e:
 return internal_server_error(errormsg=str(e))
 
diff --git a/web/pgadmin/tools/sqleditor/templates/sqleditor/js/sqleditor.js b/web/pgadmin/tools/sqleditor/templates/sqleditor/js/sqleditor.js
index 72904a9..ce65f6f 100644
--- a/web/pgadmin/tools/sqleditor/templates/sqleditor/js/sqleditor.js
+++ b/web/pgadmin/tools/sqleditor/templates/sqleditor/js/sqleditor.js
@@ -578,6 +578,7 @@ define([
   name: c.label,
   display_name: c.display_name,
   column_type: c.column_type,
+  column_type_internal: c.column_type_internal,
   not_null: c.not_null,
   has_default_val: c.has_default_val
 };
@@ -744,6 +745,11 @@ define([
 // Listener function which will be called before user updates existing cell
 // This will be used to collect primary key for that row
 grid.onBeforeEditCell.subscribe(function (e, args) {
+if (args.column.column_type_internal == 'bytea' ||
+args.column.column_type_internal == 'bytea[]') {
+  return false;
+}
+
 var before_data = args.item;
 
 // If newly added row is saved but grid is not refreshed,
@@ -2000,9 +2006,9 @@ def

Re: [pgadmin-hackers][pgaweb][Patch] Add style guide to pga website

2017-07-18 Thread Joao De Almeida Pereira
Hello Dave,

We changed the name of the file and changed the import, this way it should
be able to import it correctly.

Thanks
Sarah & Joao

On Tue, Jul 18, 2017 at 8:20 AM, Dave Page  wrote:

>
>
> On Tue, Jul 18, 2017 at 1:15 PM, Robert Eckhardt 
> wrote:
>
>> Looks good.
>>
>
> Thanks. I just noticed though, that we're trying to link to github.css,
> and failing. Was that intended to be in the same directory as all the scss?
>
>
>>
>> I assumed American spelling, should we use proper English spelling? Our
>> prodigious use of the 'z' (pronounced zee) definitely improves our scrabble
>> scores.
>>
>
> That's a definite benefit. I tend to try to use en_GB by default, partly
> because I'm, well, English, and partly because I like to wind up people who
> think the only English is en_US (of which there are a surprisingly large
> amount).
>
>
>>
>> -- Rob
>>
>> On Tue, Jul 18, 2017 at 7:54 AM, Dave Page  wrote:
>>
>>>
>>>
>>> On Mon, Jul 17, 2017 at 7:51 PM, Joao De Almeida Pereira <
>>> jdealmeidapere...@pivotal.io> wrote:
>>>
 Hello Hackers,

 With this patch we added the style guide to the current pgAdmin
 website. It is not 100% migrated yet, but we already have the Alerts and
 colors.


>>> Thanks - applied with some minor styling and layout changes. Please
>>> check I didn't break anything.
>>>
>>> You obviously miss-spelt "colour", but I let that slide :-p
>>>
>>> --
>>> 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/pgaweb/static/css/styleguide.scss 
b/pgaweb/static/css/styleguide.scss
index 84238b4..4201c75 100644
--- a/pgaweb/static/css/styleguide.scss
+++ b/pgaweb/static/css/styleguide.scss
@@ -21,7 +21,7 @@
 @import "styleguide/colorsgrey";
 @import "styleguide/typography";
 @import "styleguide/alert";
-@import "styleguide/github.css";
+@import "styleguide/github";
 
 .page-container {
   .navbar {
diff --git a/pgaweb/static/css/styleguide/github.css 
b/pgaweb/static/css/styleguide/_github.scss
similarity index 100%
rename from pgaweb/static/css/styleguide/github.css
rename to pgaweb/static/css/styleguide/_github.scss


Re: [pgadmin-hackers][pgaweb][Patch] Add style guide to pga website

2017-07-18 Thread Dave Page
Thanks, applied.

On Tue, Jul 18, 2017 at 2:45 PM, Joao De Almeida Pereira <
jdealmeidapere...@pivotal.io> wrote:

> Hello Dave,
>
> We changed the name of the file and changed the import, this way it should
> be able to import it correctly.
>
> Thanks
> Sarah & Joao
>
> On Tue, Jul 18, 2017 at 8:20 AM, Dave Page  wrote:
>
>>
>>
>> On Tue, Jul 18, 2017 at 1:15 PM, Robert Eckhardt 
>> wrote:
>>
>>> Looks good.
>>>
>>
>> Thanks. I just noticed though, that we're trying to link to github.css,
>> and failing. Was that intended to be in the same directory as all the scss?
>>
>>
>>>
>>> I assumed American spelling, should we use proper English spelling? Our
>>> prodigious use of the 'z' (pronounced zee) definitely improves our scrabble
>>> scores.
>>>
>>
>> That's a definite benefit. I tend to try to use en_GB by default, partly
>> because I'm, well, English, and partly because I like to wind up people who
>> think the only English is en_US (of which there are a surprisingly large
>> amount).
>>
>>
>>>
>>> -- Rob
>>>
>>> On Tue, Jul 18, 2017 at 7:54 AM, Dave Page  wrote:
>>>


 On Mon, Jul 17, 2017 at 7:51 PM, Joao De Almeida Pereira <
 jdealmeidapere...@pivotal.io> wrote:

> Hello Hackers,
>
> With this patch we added the style guide to the current pgAdmin
> website. It is not 100% migrated yet, but we already have the Alerts and
> colors.
>
>
 Thanks - applied with some minor styling and layout changes. Please
 check I didn't break anything.

 You obviously miss-spelt "colour", but I let that slide :-p

 --
 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: Webpack all the things! Fixes #2135

2017-07-18 Thread Dave Page
Webpack all the things! Fixes #2135

This significantly speeds up loading of the application; in an average of 3 
tests, v1.6
loaded in 11.5s in the runtime on a Mac, whilst the webpacked version of the 
code
loaded in 5.53s.

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=4a91bcde303bd3d5d2bd2e2f20cd7046585eba06
Author: Surinder Kumar 

Modified Files
--
web/package.json   |48 +-
web/pgadmin/about/__init__.py  | 4 +-
web/pgadmin/about/templates/about/about.js |12 +-
web/pgadmin/browser/__init__.py| 8 +-
.../databases/languages/static/js/language.js  | 2 +-
.../schemas/collations/static/js/collation.js  | 4 +-
.../databases/schemas/domains/static/js/domain.js  | 4 +-
.../foreign_tables/static/js/foreign-table.js  |14 +-
.../static/js/fts_configuration.js |11 +-
.../fts_dictionaries/static/js/fts_dictionary.js   | 4 +-
.../schemas/fts_parser/static/js/fts_parser.js | 5 +-
.../fts_templates/static/js/fts_template.js| 4 +-
.../schemas/functions/static/js/function.js|14 +-
.../schemas/functions/static/js/procedure.js   | 2 +-
.../functions/static/js/trigger_function.js| 8 +-
.../schemas/sequences/static/js/sequence.js| 6 +-
.../servers/databases/schemas/static/js/schema.js  |11 +-
.../check_constraint/js/check_constraint.js| 2 +-
.../js/exclusion_constraint.js |10 +-
.../templates/foreign_key/js/foreign_key.js|11 +-
.../templates/constraints/js/constraints.js| 4 +-
.../tables/indexes/templates/index/js/index.js | 4 +-
.../tables/rules/templates/rules/js/rules.js   |12 +-
.../schemas/tables/static/js/partition.utils.js|16 +-
.../databases/schemas/tables/static/js/table.js|10 +-
.../databases/schemas/types/static/js/type.js  | 9 +-
.../databases/schemas/views/static/js/mview.js | 4 +-
.../databases/schemas/views/static/js/view.js  | 7 +-
.../servers/databases/static/js/database.js| 2 +-
.../server_groups/servers/static/js/privilege.js   |32 +-
.../server_groups/servers/static/js/server.js  | 4 +-
.../server_groups/servers/static/js/variable.js|44 +-
.../server_groups/static/js/server-group.js| 2 +-
web/pgadmin/browser/static/js/datamodel.js |20 +-
web/pgadmin/browser/static/js/node.ui.js   |10 +-
web/pgadmin/browser/static/js/wizard.js|13 +-
.../browser/static/vendor/aciTree/css/aciTree.css  |   549 -
.../static/vendor/aciTree/image/drag-drop-rtl.png  |   Bin 982 -> 0 bytes
.../static/vendor/aciTree/image/drag-drop.png  |   Bin 908 -> 0 bytes
.../browser/static/vendor/aciTree/image/eyes.png   |   Bin 10753 -> 0 bytes
.../static/vendor/aciTree/image/load-node.gif  |   Bin 1728 -> 0 bytes
.../static/vendor/aciTree/image/load-root.gif  |   Bin 8778 -> 0 bytes
.../vendor/aciTree/image/tree-arrow-big-rtl.png|   Bin 3939 -> 0 bytes
.../static/vendor/aciTree/image/tree-arrow-big.png |   Bin 3797 -> 0 bytes
.../vendor/aciTree/image/tree-arrow-small-rtl.png  |   Bin 2797 -> 0 bytes
.../vendor/aciTree/image/tree-arrow-small.png  |   Bin 2548 -> 0 bytes
.../static/vendor/aciTree/image/tree-big-rtl.png   |   Bin 3821 -> 0 bytes
.../static/vendor/aciTree/image/tree-big.png   |   Bin 3644 -> 0 bytes
.../static/vendor/aciTree/image/tree-branch.png|   Bin 235 -> 0 bytes
.../vendor/aciTree/image/tree-check-big-rtl.png|   Bin 8134 -> 0 bytes
.../static/vendor/aciTree/image/tree-check-big.png |   Bin 7816 -> 0 bytes
.../vendor/aciTree/image/tree-check-small-rtl.png  |   Bin 4044 -> 0 bytes
.../vendor/aciTree/image/tree-check-small.png  |   Bin 3687 -> 0 bytes
.../static/vendor/aciTree/image/tree-small-rtl.png |   Bin 2351 -> 0 bytes
.../static/vendor/aciTree/image/tree-small.png |   Bin 2320 -> 0 bytes
.../vendor/aciTree/jquery.aciFragment.min.js   |15 -
.../static/vendor/aciTree/jquery.aciPlugin.min.js  |12 -
.../vendor/aciTree/jquery.aciSortable.min.js   |13 -
.../vendor/aciTree/jquery.aciTree.checkbox.js  |   483 -
.../static/vendor/aciTree/jquery.aciTree.column.js |   250 -
.../static/vendor/aciTree/jquery.aciTree.core.js   |  2544 --
.../static/vendor/aciTree/jquery.aciTree.debug.js  |87 -
.../static/vendor/aciTree/jquery.aciTree.dom.js|   660 -
.../vendor/aciTree/jquery.aciTree.editable.js  |   294 -
.../static/vendor/aciTree/jquery.aciTree.hash.js   |   170 -
.../static/vendor/aciTree/jquery.aciTree.js|  6985 -
.../static/vendor/aciTree/jquery.aciTree.min.js|44 -
.../vendor/aciTree/jquery.aciTree.persist.js   |   290 -
.../static/vendor/aciTree/jquery.aciTree.radio.js  |   471 -
.../vendor/aciTree/jquery.aciTree.selectable.js|   739 -
.../vendor/ac

pgAdmin 4 commit: Add missing new files from the previous commit. Ooops

2017-07-18 Thread Dave Page
Add missing new files from the previous commit. Ooops.

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=6396b8ce1801ebb9b00013b5115ea7851ca094a7
Author: Surinder Kumar 

Modified Files
--
.../index_constraint/static/js/primary_key.js  | 539 +
.../static/js/unique_constraint.js | 529 
web/pgadmin/browser/templates/browser/js/utils.js  |  88 
web/pgadmin/static/bundle/app.js   |  23 +
web/pgadmin/static/bundle/browser.js   |   5 +
web/pgadmin/static/bundle/codemirror.js|  18 +
web/pgadmin/static/css/lib.css |  37 ++
web/webpack.shim.js| 282 +++
8 files changed, 1521 insertions(+)



Re: [pgAdmin4]: Webpacking of static JS/CSS

2017-07-18 Thread Dave Page
Thanks - applied!

Awesome work - on an average of 3 tests on my Mac, load time reduced from
11.55s with v1.6 to 5.53s with GIT Head.

On Mon, Jul 17, 2017 at 5:57 PM, Surinder Kumar <
surinder.ku...@enterprisedb.com> wrote:

> Hi
>
> Now all test cases are executing.
> Please find updated patch.
>
> Thanks
> Surinder
>
> On Mon, Jul 17, 2017 at 6:57 PM, Surinder Kumar <
> surinder.ku...@enterprisedb.com> wrote:
>
>> On Mon, Jul 17, 2017 at 4:52 PM, Dave Page  wrote:
>>
>>> Hi
>>>
>>> No errors now, but do you know why JS tests are being skipped?
>>>
>> ​No errors/warning in console even after settings `logLevel:
>> config.LOG_DEBUG`. I am still debugging.
>>
>>>
>>> PhantomJS 2.1.1 (Mac OS X 0.0.0): Executed 4 of 216 (skipped 212)
>>> SUCCESS (0.085 secs / 0.046 secs)
>>>
>>> Thanks!
>>>
>>> On Mon, Jul 17, 2017 at 12:07 PM, Surinder Kumar <
>>> surinder.ku...@enterprisedb.com> wrote:
>>>
 ​Hi Dave,

 I didn't removed the vendor modules when i ran regression test cases,
 so modules were being referenced from vendor dir and passed for me.
 Now I have fixed path references and test cases are working.

 Please find attached patch.

 Thanks
 Surinder​

 On Mon, Jul 17, 2017 at 3:18 PM, Surinder Kumar <
 surinder.ku...@enterprisedb.com> wrote:

> Hi
>
> I'm currently working on first TODO: "Automatically handle static and
> template JS files"
>
> As discussed with Ashesh, currently the paths to module id are written
> manually in webpack.config.js, instead the path defined in moudle's `def
> get_own_javascript()`  should be used.
>
> So, we will be generating a paths.json file which will contain:
>
> 1. resolve > alias - path with reference to module id.(Static files)
>
> 2. externals - list of modules to be loaded dynamically on
> demand(Template files)
>
> 3. Shim module dependency
>
> 4. List of JS modules to be loaded in specified order.
>
> *Implementation:*
>
> To generate `paths.json` file, we will be using `Flask's test_client`
> to make an http request internally within the app context so we can call
> `current_app.javascripts` property and return the list of JS paths and
> write those into paths.json file and then use it in webpack.shim.js before
> the execution of `yarn run bundle` in `javascript_bundler.py`
>
> *For example:*
>
> @app.route('/get_script_paths')
> def get_script_paths():
> from flask import current_app
> from pgadmin.utils.ajax import make_json_response
>
> return make_json_response(data=current_app.javascripts)
>
> if config.DEBUG:
> with app.test_client() as client:
> import simplejson as json
> list_scripts = client.get('/get_script_paths')
> scripts = json.loads(list_scripts.data)
>
> javascriptBundler = JavascriptBundler()
> javascriptBundler.bundle(scripts['data'])
>
>
> This also needs little change in module dependency we defined using
> 'When': 'node_name' in `def get_own_javascripts(...)` method
> the module specified(name: module_name) is loaded when module given in
> `When` is expanded in node. Since we are using Webpack in which behaviour
> to load module is little different.
>
> Now in webpack we are using `imports-loader` to load specific modules.
> So this is how it should work.
>
> 1. First load all modules which do not have dependency on any node
> like 'about', 'dashboard',  'server-group', 'server' etc.
>
> 2. Load module such as `Databases` node first before its child nodes
> are loaded.
> Similarly load `Schemas` node before its child nodes are loaded as
> they are dependent on parent node.
>
> Thanks,
> Surinder
> On Wed, Jul 5, 2017 at 8:22 PM, Sarah McAlear 
> wrote:
>
>> Hello,
>>
>>
>>> *​Things to discuss:*
>>>
>>> How to differentiate between a static and template JS
>>> ​​
>>> .
>>>
>>
>> What is the advantage of webpacking templated JS? It seems as though
>> this creates a system in which the bundled dependencies have to refer 
>> back
>> to the backend to load the templates.
>>
> ​Templated JS will not be part of generated bundle JS, they will load
> externally( an extra request will be made to server For example:
> translations.js)
>
>>
>> If there is a performance win in packing templated JS then looking at
>> it makes sense.  Otherwise it may make sense to put off until it is clear
>> that the templated files should be dealt with by either de-templating 
>> them
>> or bundling them where there is a clear reason.
>>
> ​Template JS cannot be bundled, so i extract the  code from
> template files and put into a separate file - ABC.js (also moved template
> files to 

pgAdmin 4 commit: Support SSL in the regression tests. Fixes #2170

2017-07-18 Thread Dave Page
Support SSL in the regression tests. Fixes #2170

Branch
--
master

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

Modified Files
--
.../servers/databases/casts/tests/test_cast_add.py |  3 +-
.../databases/casts/tests/test_cast_delete.py  |  3 +-
.../servers/databases/casts/tests/test_cast_get.py |  3 +-
.../servers/databases/casts/tests/utils.py |  3 +-
.../databases/event_triggers/tests/utils.py|  6 +-
.../servers/databases/extensions/tests/utils.py|  9 ++-
.../foreign_servers/tests/utils.py |  6 +-
.../foreign_servers/user_mapping/tests/utils.py|  6 +-
.../databases/foreign_data_wrappers/tests/utils.py |  6 +-
.../servers/databases/languages/tests/utils.py |  9 ++-
.../schemas/collations/tests/test_collation_add.py |  3 +-
.../databases/schemas/collations/tests/utils.py|  6 +-
.../schemas/fts_configurations/tests/utils.py  |  6 +-
.../schemas/fts_dictionaries/tests/utils.py|  6 +-
.../databases/schemas/fts_parser/tests/utils.py|  6 +-
.../databases/schemas/fts_templates/tests/utils.py |  6 +-
.../databases/schemas/functions/tests/utils.py |  9 ++-
.../databases/schemas/packages/tests/utils.py  |  6 +-
.../databases/schemas/sequences/tests/utils.py |  6 +-
.../databases/schemas/tables/column/tests/utils.py |  6 +-
.../tables/constraints/foreign_key/tests/utils.py  |  6 +-
.../constraints/index_constraint/tests/utils.py|  6 +-
.../schemas/tables/indexes/tests/utils.py  |  6 +-
.../databases/schemas/tables/rules/tests/utils.py  |  6 +-
.../databases/schemas/tables/tests/utils.py|  9 ++-
.../schemas/tables/triggers/tests/utils.py |  6 +-
.../databases/schemas/tests/test_schema_put.py |  3 +-
.../servers/databases/schemas/tests/utils.py   |  3 +-
.../servers/databases/schemas/views/tests/utils.py |  6 +-
.../servers/databases/tests/test_db_delete.py  |  3 +-
.../tests/test_resource_groups_add.py  |  3 +-
.../tests/test_resource_groups_delete.py   |  3 +-
.../tests/test_resource_groups_put.py  |  3 +-
.../tests/tests_resource_groups_get.py |  3 +-
.../servers/resource_groups/tests/utils.py |  6 +-
.../servers/roles/tests/test_role_add.py   |  3 +-
.../servers/roles/tests/test_role_delete.py|  3 +-
.../servers/roles/tests/test_role_get.py   |  3 +-
.../servers/roles/tests/test_role_put.py   |  3 +-
.../server_groups/servers/roles/tests/utils.py |  6 +-
.../servers/tablespaces/tests/test_tbspc_add.py|  3 +-
.../servers/tablespaces/tests/test_tbspc_delete.py |  3 +-
.../servers/tablespaces/tests/test_tbspc_get.py|  3 +-
.../servers/tablespaces/tests/test_tbspc_put.py|  3 +-
.../servers/tablespaces/tests/utils.py |  6 +-
.../servers/tests/test_check_recovery.py   |  3 +-
.../servers/tests/test_check_ssl_connection.py | 39 +++
.../connect_to_server_feature_test.py  |  6 +-
.../copy_selected_query_results_feature_test.py|  6 +-
.../feature_tests/pg_datatype_validation_test.py   |  6 +-
web/pgadmin/feature_tests/query_tool_tests.py  |  6 +-
.../feature_tests/table_ddl_feature_test.py|  6 +-
web/pgadmin/feature_tests/view_data_dml_queries.py |  6 +-
.../xss_checks_panels_and_query_tool_test.py   |  6 +-
web/regression/python_test_utils/test_utils.py | 79 ++
55 files changed, 266 insertions(+), 119 deletions(-)



Re: [RM2544][pgAdmin4] Add SSL database connection support in Regression tests

2017-07-18 Thread Dave Page
Thanks, applied.

On Tue, Jul 18, 2017 at 6:30 AM, Murtuza Zabuawala <
murtuza.zabuaw...@enterprisedb.com> wrote:

> Hi Dave,
>
> Please find updated patch for the same.
>
>
> On Mon, Jul 17, 2017 at 8:59 PM, Dave Page  wrote:
>
>> Hi
>>
>> On Mon, Jul 17, 2017 at 2:59 PM, Murtuza Zabuawala <
>> murtuza.zabuaw...@enterprisedb.com> wrote:
>>
>>> Hi,
>>>
>>> PFA patch to add SSL support for database connection.
>>> RM#2170
>>>
>>> Included test to check if current connection is using SSL or not
>>>
>>
>> I think the SSL test needs a little work. Instead of:
>>
>>  Test for SSL connection check ... Traceback (most recent call last):
>>   File "/Users/dpage/git/pgadmin4/web/pgadmin/browser/server_groups
>> /servers/tests/test_check_ssl_connection.py", line 42, in runTest
>> self.server['sslmode']
>>   File 
>> "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/unittest/case.py",
>> line 408, in skipTest
>> raise SkipTest(reason)
>> SkipTest: Cannot run SSL connection check test with 'prefer' sslmode
>> skipped "Cannot run SSL connection check test with 'prefer' sslmode"
>>
>> I would expect to see:
>>
>> runTest (pgadmin.browser.server_groups.servers.tests.test_check_ssl_
>> connection.TestSSLConnectionCheck)
>> Test SSL Connection ... skipped "Cannot run SSL connection check test
>> with 'prefer' sslmode"
>> Thanks.
>>
>> --
>> Dave Page
>> Blog: http://pgsnake.blogspot.com
>> Twitter: @pgsnake
>>
>> EnterpriseDB UK: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>>
>
>


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

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


Jenkins build is back to normal : pgadmin4-master-python35 #244

2017-07-18 Thread pgAdmin 4 Jenkins
See 





Re: [PATCH] Persist opened nodes in tree

2017-07-18 Thread Sarah McAlear
Hello,

In order to save everything in the backend sqlite database, maybe a jQuery
plugin needs to be developed that has the same interface as jStorage and
that will do Ajax calls instead of using the Local Storage.
The only caveat for this is that it needs to be registered in window.
$.jStorage in order to replace the one in place.

João & Sarah



On Tue, Jul 18, 2017 at 5:30 AM, Dave Page  wrote:

> Hi
>
> This would be a welcome feature addition, but why not store the treeview
> state in the configuration database? I'd prefer not to add another storage
> mechanism without a very compelling reason.
>
> If you need info on how it works, please feel free to ask questions.
>
> Thanks.
>
> On Tue, Jul 18, 2017 at 9:42 AM, Versus Void  wrote:
>
>> ---
>>  web/pgadmin/browser/__init__.py|  13 +-
>>  .../browser/static/vendor/jStorage/jstorage.js | 996
>> +
>>  .../browser/static/vendor/jStorage/jstorage.min.js |  16 +
>>  .../browser/templates/browser/js/browser.js|   6 +-
>>  4 files changed, 1029 insertions(+), 2 deletions(-)
>>  create mode 100644 web/pgadmin/browser/static/ven
>> dor/jStorage/jstorage.js
>>  create mode 100644 web/pgadmin/browser/static/ven
>> dor/jStorage/jstorage.min.js
>>
>> diff --git a/web/pgadmin/browser/__init__.py
>> b/web/pgadmin/browser/__init__.py
>> index 77e052f0..ecf3afba 100644
>> --- a/web/pgadmin/browser/__init__.py
>> +++ b/web/pgadmin/browser/__init__.py
>> @@ -100,13 +100,24 @@ class BrowserModule(PgAdminModule):
>>  'preloaded': True
>>  })
>>  scripts.append({
>> +'name': 'jStorage',
>> +'path': url_for(
>> +'browser.static',
>> +filename='vendor/jStorage/jstorage' if
>> +current_app.debug else 'vendor/jStorage/jstorage.min'
>> +),
>> +'deps': ['jquery'],
>> +'exports': 'jStorage',
>> +'preloaded': True
>> +})
>> +scripts.append({
>>  'name': 'jquery.acitree',
>>  'path': url_for(
>>  'browser.static',
>>  filename='vendor/aciTree/jquery.aciTree' if
>>  current_app.debug else 'vendor/aciTree/jquery.aciTree
>> .min'
>>  ),
>> -'deps': ['jquery', 'jquery.aciplugin'],
>> +'deps': ['jquery', 'jquery.aciplugin', 'jStorage'],
>>  'exports': 'aciPluginClass.plugins.aciTree',
>>  'preloaded': True
>>  })
>> diff --git a/web/pgadmin/browser/static/vendor/jStorage/jstorage.js
>> b/web/pgadmin/browser/static/vendor/jStorage/jstorage.js
>> new file mode 100644
>> index ..1ac8fccc
>> --- /dev/null
>> +++ b/web/pgadmin/browser/static/vendor/jStorage/jstorage.js
>> @@ -0,0 +1,996 @@
>> +/*
>> + * - JSTORAGE --
>> ---
>> + * Simple local storage wrapper to save data on the browser side,
>> supporting
>> + * all major browsers - IE6+, Firefox2+, Safari4+, Chrome4+ and Opera
>> 10.5+
>> + *
>> + * Author: Andris Reinman, andris.rein...@gmail.com
>> + * Project homepage: www.jstorage.info
>> + *
>> + * Licensed under Unlicense:
>> + *
>> + * This is free and unencumbered software released into the public
>> domain.
>> + *
>> + * Anyone is free to copy, modify, publish, use, compile, sell, or
>> + * distribute this software, either in source code form or as a compiled
>> + * binary, for any purpose, commercial or non-commercial, and by any
>> + * means.
>> + *
>> + * In jurisdictions that recognize copyright laws, the author or authors
>> + * of this software dedicate any and all copyright interest in the
>> + * software to the public domain. We make this dedication for the benefit
>> + * of the public at large and to the detriment of our heirs and
>> + * successors. We intend this dedication to be an overt act of
>> + * relinquishment in perpetuity of all present and future rights to this
>> + * software under copyright law.
>> + *
>> + * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
>> + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
>> + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
>> + * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
>> + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
>> + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
>> + * OTHER DEALINGS IN THE SOFTWARE.
>> + *
>> + * For more information, please refer to 
>> + */
>> +
>> +/* global ActiveXObject: false */
>> +/* jshint browser: true */
>> +
>> +(function() {
>> +'use strict';
>> +
>> +var
>> +/* jStorage version */
>> +JSTORAGE_VERSION = '0.4.12',
>> +
>> +/* detect a dollar object or create one if not found */
>> +$ = window.jQuery || window.$ || (window.$ = {}),
>> +
>> +/* check for a JSON han

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

2017-07-18 Thread Murtuza Zabuawala
Hi Shirley,

On Tue, Jul 18, 2017 at 1:21 AM, Shirley Wang  wrote:

> Hi!
>
> I can't seem to get the patch to completely work on my computer, only the
> close icon shows up plus the dialog and success/error messages, but here
> are some comments:
>
> Because  we are just cancelling the active running query, so if the start
of the session is 'Active' when you cancel it will simply goto 'Idle' stat.

> +1 to Dave's comment about refreshing after the cancel operation
>
> I'll fix this.

> - We're working on a patch for updating alerts in the Dashboard tab which
> updates the grays in the Database activities panel and changes the border
> around the refresh button and search bar to 1px. This hasn't been submitted
> yet but just a heads up as you work on the alignment.
>
> - Something to consider is how a super user will identify which session
> should be closed. Is that information there?
>
> I think super user can cancel everything except main connection session &
as Dave mentioned in previous email that background workers in PG10.

> - Are there sessions that should never be closed? If so, do they also need
> close buttons? (Probably not, because that will lead the user to an error
> message, which is not fun)
>
> In Backgrid, we can not exclude specific column from certain rows if it
renders in one row then it will render for every row in the grid, What we
can do is, it will throw an error when user is not eligible to cancel the
active running query.

> - Perhaps this is a good feature to review with Chethana! :)
>
> On Mon, Jul 17, 2017 at 5:37 AM Murtuza Zabuawala  enterprisedb.com> wrote:
>
>> On Mon, Jul 17, 2017 at 3:01 PM, Dave Page  wrote:
>>
>>> Hi
>>>
>>> On Thu, Jul 13, 2017 at 2:53 PM, Murtuza Zabuawala >> enterprisedb.com> wrote:
>>>
 hiHi,

 PFA patch to add functionality which will allow super user to cancel
 long running queries from dashboard.
 RM#1812

 *Steps used to test:*
 1) Open psql session, Connect to 'test' database on respective server
 2) Execute "select pg_sleep(1000);"
 3) Open pgAdmin4
 4) Connect to respective server
 5) Click on Dashboard
 6) Check "Sessions" tab under "Server activity" section then look for
 active sessions for test database.
 7) Click on cancel button and cancel the active session
 8) Check psql session now, you will see "ERROR:  canceling statement
 due to user request"

 Some comments:
>>>
>>> - The action here is to cancel the active query in the backend, not the
>>> session - so messages etc. should say things like "Cancel Active Query?"
>>>
>>>
>> - The grid should refresh following the cancel operation.
>>>
>>> - Can you fix the vertical alignment while you're working on this? The
>>> new button really makes the poor alignment stand out.
>>>
>>> - This should not be superuser only - regular users should be able to
>>> cancel their own queries.
>>>
>>> - On PG10, background workers are also shown in the dashboard. Should we
>>> prevent attempts to cancel their work (they'll fail anyway I believe).
>>>
>>> Thanks!
>>>
>>>
>> Sure, I'll work on these comments & send updated patch.
>>
>>> --
>>> Dave Page
>>> Blog: http://pgsnake.blogspot.com
>>> Twitter: @pgsnake
>>>
>>> EnterpriseDB UK: http://www.enterprisedb.com
>>> The Enterprise PostgreSQL Company
>>>
>>


Re: [pgAdmin4]: Webpacking of static JS/CSS

2017-07-18 Thread Khushboo Vashi
On Tue, Jul 18, 2017 at 7:46 PM, Dave Page  wrote:

> Thanks - applied!
>
> Awesome work - on an average of 3 tests on my Mac, load time reduced from
> 11.55s with v1.6 to 5.53s with GIT Head.
>
> Surinder, great work...


> On Mon, Jul 17, 2017 at 5:57 PM, Surinder Kumar <
> surinder.ku...@enterprisedb.com> wrote:
>
>> Hi
>>
>> Now all test cases are executing.
>> Please find updated patch.
>>
>> Thanks
>> Surinder
>>
>> On Mon, Jul 17, 2017 at 6:57 PM, Surinder Kumar <
>> surinder.ku...@enterprisedb.com> wrote:
>>
>>> On Mon, Jul 17, 2017 at 4:52 PM, Dave Page  wrote:
>>>
 Hi

 No errors now, but do you know why JS tests are being skipped?

>>> ​No errors/warning in console even after settings `logLevel:
>>> config.LOG_DEBUG`. I am still debugging.
>>>

 PhantomJS 2.1.1 (Mac OS X 0.0.0): Executed 4 of 216 (skipped 212)
 SUCCESS (0.085 secs / 0.046 secs)

 Thanks!

 On Mon, Jul 17, 2017 at 12:07 PM, Surinder Kumar <
 surinder.ku...@enterprisedb.com> wrote:

> ​Hi Dave,
>
> I didn't removed the vendor modules when i ran regression test cases,
> so modules were being referenced from vendor dir and passed for me.
> Now I have fixed path references and test cases are working.
>
> Please find attached patch.
>
> Thanks
> Surinder​
>
> On Mon, Jul 17, 2017 at 3:18 PM, Surinder Kumar <
> surinder.ku...@enterprisedb.com> wrote:
>
>> Hi
>>
>> I'm currently working on first TODO: "Automatically handle static and
>> template JS files"
>>
>> As discussed with Ashesh, currently the paths to module id are
>> written manually in webpack.config.js, instead the path defined in 
>> moudle's
>> `def get_own_javascript()`  should be used.
>>
>> So, we will be generating a paths.json file which will contain:
>>
>> 1. resolve > alias - path with reference to module id.(Static files)
>>
>> 2. externals - list of modules to be loaded dynamically on
>> demand(Template files)
>>
>> 3. Shim module dependency
>>
>> 4. List of JS modules to be loaded in specified order.
>>
>> *Implementation:*
>>
>> To generate `paths.json` file, we will be using `Flask's test_client`
>> to make an http request internally within the app context so we can call
>> `current_app.javascripts` property and return the list of JS paths and
>> write those into paths.json file and then use it in webpack.shim.js 
>> before
>> the execution of `yarn run bundle` in `javascript_bundler.py`
>>
>> *For example:*
>>
>> @app.route('/get_script_paths')
>> def get_script_paths():
>> from flask import current_app
>> from pgadmin.utils.ajax import make_json_response
>>
>> return make_json_response(data=current_app.javascripts)
>>
>> if config.DEBUG:
>> with app.test_client() as client:
>> import simplejson as json
>> list_scripts = client.get('/get_script_paths')
>> scripts = json.loads(list_scripts.data)
>>
>> javascriptBundler = JavascriptBundler()
>> javascriptBundler.bundle(scripts['data'])
>>
>>
>> This also needs little change in module dependency we defined using
>> 'When': 'node_name' in `def get_own_javascripts(...)` method
>> the module specified(name: module_name) is loaded when module given
>> in `When` is expanded in node. Since we are using Webpack in which
>> behaviour to load module is little different.
>>
>> Now in webpack we are using `imports-loader` to load specific
>> modules. So this is how it should work.
>>
>> 1. First load all modules which do not have dependency on any node
>> like 'about', 'dashboard',  'server-group', 'server' etc.
>>
>> 2. Load module such as `Databases` node first before its child nodes
>> are loaded.
>> Similarly load `Schemas` node before its child nodes are loaded as
>> they are dependent on parent node.
>>
>> Thanks,
>> Surinder
>> On Wed, Jul 5, 2017 at 8:22 PM, Sarah McAlear 
>> wrote:
>>
>>> Hello,
>>>
>>>
 *​Things to discuss:*

 How to differentiate between a static and template JS
 ​​
 .

>>>
>>> What is the advantage of webpacking templated JS? It seems as though
>>> this creates a system in which the bundled dependencies have to refer 
>>> back
>>> to the backend to load the templates.
>>>
>> ​Templated JS will not be part of generated bundle JS, they will load
>> externally( an extra request will be made to server For example:
>> translations.js)
>>
>>>
>>> If there is a performance win in packing templated JS then looking
>>> at it makes sense.  Otherwise it may make sense to put off until it is
>>> clear that the templated files should be dealt with by either 
>

Build failed in Jenkins: pgadmin4-master-python34 #235

2017-07-18 Thread pgAdmin 4 Jenkins
See 


Changes:

[Dave Page] Webpack all the things! Fixes #2135

[Dave Page] Add missing new files from the previous commit. Ooops.

[Dave Page] Support SSL in the regression tests. Fixes #2170

--
[...truncated 572.62 KB...]
Detach partition from existing list 
partitioned table,
Create partitions of existing list 
partitioned table,
Create partitions of existing range 
partitioned table)
TableAddTestCase (Create List partitioned table with 2 
partitions,
Create Range partitioned table with 2 
partitions)
SynonymAddTestCase (Default Node URL)
PackageGetTestCase (Fetch Package Node URL)
ResourceGroupsDeleteTestCase (Delete resource groups)
ResourceGroupsPutTestCase (Put resource groups)
PackageAddTestCase (Fetch Package Node URL)

PostgreSQL 9.6:

157 tests passed
0 tests failed
15 tests skipped:
PackageDeleteTestCase (Fetch Package Node URL)
SynonymPutTestCase (Fetch synonym Node URL)
SynonymDeleteTestCase (Fetch synonym Node URL)
TestSSLConnection (Test for SSL connection)
SynonymGetTestCase (Fetch synonym Node URL)
PackagePutTestCase (Fetch Package Node URL)
ResourceGroupsAddTestCase (Add resource groups)
ResourceGroupsGetTestCase (Get resource groups)
TableUpdateTestCase (Attach partition to existing range 
partitioned table,
Attach partition to existing list 
partitioned table,
Detach partition from existing range 
partitioned table,
Detach partition from existing list 
partitioned table,
Create partitions of existing list 
partitioned table,
Create partitions of existing range 
partitioned table)
TableAddTestCase (Create List partitioned table with 2 
partitions,
Create Range partitioned table with 2 
partitions)
SynonymAddTestCase (Default Node URL)
PackageGetTestCase (Fetch Package Node URL)
ResourceGroupsDeleteTestCase (Delete resource groups)
ResourceGroupsPutTestCase (Put resource groups)
PackageAddTestCase (Fetch Package Node URL)

EDB Postgres AS 9.5:

169 tests passed
0 tests failed
3 tests skipped:
TestSSLConnection (Test for SSL connection)
TableAddTestCase (Create List partitioned table with 2 
partitions,
Create Range partitioned table with 2 
partitions)
TableUpdateTestCase (Attach partition to existing range 
partitioned table,
Attach partition to existing list 
partitioned table,
Detach partition from existing range 
partitioned table,
Detach partition from existing list 
partitioned table,
Create partitions of existing list 
partitioned table,
Create partitions of existing range 
partitioned table)

EDB Postgres AS 9.4:

169 tests passed
0 tests failed
3 tests skipped:
TestSSLConnection (Test for SSL connection)
TableAddTestCase (Create List partitioned table with 2 
partitions,
Create Range partitioned table with 2 
partitions)
TableUpdateTestCase (Attach partition to existing range 
partitioned table,
Attach partition to existing list 
partitioned table,
Detach partition from existing range 
partitioned table,
Detach partition from existing list 
partitioned table,
Create partitions of existing list 
partitioned table,
Create partitions of existing range 
partitioned table)

PostgreSQL 9.2:

149 tests passed
0 tests failed
23 tests skipped:
PackageGetTestCase (Fetch Package Node URL)
ViewsDeleteTestCase (Delete materialized view under schema node)
SynonymGetTestCase (Fetch synonym Node URL)
ResourceGroupsGetTestCase (Get resource groups)
TableUpdateTestCase (Attach partition to existing range 

Re: [RM2074][[RM2080]][pgAdmin4] handle large bytea and bytea[] data in datagrid

2017-07-18 Thread Dave Page
On Tue, Jul 18, 2017 at 2:40 PM, Harshal Dhumal <
harshal.dhu...@enterprisedb.com> wrote:

> Hi Dave,
>
> On Tue, Jul 18, 2017 at 1:24 PM, Dave Page  wrote:
>
>>
>>
>> On Tue, Jul 18, 2017 at 8:26 AM, Harshal Dhumal <
>> harshal.dhu...@enterprisedb.com> wrote:
>>
>>> Hi Dave,
>>>
>>>
>>> On Mon, Jul 17, 2017 at 9:33 PM, Dave Page  wrote:
>>>
 Hi

 On Mon, Jul 17, 2017 at 1:09 PM, Harshal Dhumal <
 harshal.dhu...@enterprisedb.com> wrote:

> Hi,
>
> Please find updated patch. Now placeholder string for bytea and
> bytea[] data will only appear in datagrid (view all/1000/500 rows). If 
> user
> executes query using Query tool then placeholder won't appear (similar to
>  pgAdminIII behaviour)
>

 I'm getting the following error when testing this:

>>>
>>> I ran all feature test cases 5-6 times and each time they ran
>>> successfully.
>>> May be this is occasional failure which we get after running test cases
>>> for many times.
>>>
>>> Please let me know if you are getting this failure consistently at your
>>> end.
>>>
>>
>> I ran it twice and it failed twice. I can't keep running tests over and
>> over again as they take quite a while to run and I can't use my machine for
>> anything else at the same time as occasionally the test browser will grab
>> focus.
>>
>
> Please find updated patch.
> I have slightly modified feature test case for 'view data dml queries'
> (though I wasn't getting failure as mentioned).
>
>
Thanks, that passes.

Now I've played with it though, I think that the query tool should also
hide the binary data.  I don't see a good reason to see it in one place but
not another - ultimately it's still not human readable.

Also, we need to make it look like the [null] placeholder I think; e.g. use
[ ] instead of < > and give it a lighter colour.


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

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


Re: [pgAdmin4]: Webpacking of static JS/CSS

2017-07-18 Thread Surinder Kumar
Hi

1. As Slickgrid has dependency of `jQuery-ui`, it was missed. now added.
2. Column sorting for collection nodes sometimes failing when clicked on
different collection nodes.

Please find attached patch.

Thanks
Surinder

On Tue, Jul 18, 2017 at 8:20 PM, Khushboo Vashi <
khushboo.va...@enterprisedb.com> wrote:

>
>
> On Tue, Jul 18, 2017 at 7:46 PM, Dave Page  wrote:
>
>> Thanks - applied!
>>
>> Awesome work - on an average of 3 tests on my Mac, load time reduced from
>> 11.55s with v1.6 to 5.53s with GIT Head.
>>
> ​Thanks to all​

>
>> Surinder, great work...
>
>
>> On Mon, Jul 17, 2017 at 5:57 PM, Surinder Kumar <
>> surinder.ku...@enterprisedb.com> wrote:
>>
>>> Hi
>>>
>>> Now all test cases are executing.
>>> Please find updated patch.
>>>
>>> Thanks
>>> Surinder
>>>
>>> On Mon, Jul 17, 2017 at 6:57 PM, Surinder Kumar <
>>> surinder.ku...@enterprisedb.com> wrote:
>>>
 On Mon, Jul 17, 2017 at 4:52 PM, Dave Page  wrote:

> Hi
>
> No errors now, but do you know why JS tests are being skipped?
>
 ​No errors/warning in console even after settings `logLevel:
 config.LOG_DEBUG`. I am still debugging.

>
> PhantomJS 2.1.1 (Mac OS X 0.0.0): Executed 4 of 216 (skipped 212)
> SUCCESS (0.085 secs / 0.046 secs)
>
> Thanks!
>
> On Mon, Jul 17, 2017 at 12:07 PM, Surinder Kumar <
> surinder.ku...@enterprisedb.com> wrote:
>
>> ​Hi Dave,
>>
>> I didn't removed the vendor modules when i ran regression test cases,
>> so modules were being referenced from vendor dir and passed for me.
>> Now I have fixed path references and test cases are working.
>>
>> Please find attached patch.
>>
>> Thanks
>> Surinder​
>>
>> On Mon, Jul 17, 2017 at 3:18 PM, Surinder Kumar <
>> surinder.ku...@enterprisedb.com> wrote:
>>
>>> Hi
>>>
>>> I'm currently working on first TODO: "Automatically handle static
>>> and template JS files"
>>>
>>> As discussed with Ashesh, currently the paths to module id are
>>> written manually in webpack.config.js, instead the path defined in 
>>> moudle's
>>> `def get_own_javascript()`  should be used.
>>>
>>> So, we will be generating a paths.json file which will contain:
>>>
>>> 1. resolve > alias - path with reference to module id.(Static files)
>>>
>>> 2. externals - list of modules to be loaded dynamically on
>>> demand(Template files)
>>>
>>> 3. Shim module dependency
>>>
>>> 4. List of JS modules to be loaded in specified order.
>>>
>>> *Implementation:*
>>>
>>> To generate `paths.json` file, we will be using `Flask's
>>> test_client` to make an http request internally within the app context 
>>> so
>>> we can call `current_app.javascripts` property and return the list of JS
>>> paths and write those into paths.json file and then use it in
>>> webpack.shim.js before the execution of `yarn run bundle` in
>>> `javascript_bundler.py`
>>>
>>> *For example:*
>>>
>>> @app.route('/get_script_paths')
>>> def get_script_paths():
>>> from flask import current_app
>>> from pgadmin.utils.ajax import make_json_response
>>>
>>> return make_json_response(data=current_app.javascripts)
>>>
>>> if config.DEBUG:
>>> with app.test_client() as client:
>>> import simplejson as json
>>> list_scripts = client.get('/get_script_paths')
>>> scripts = json.loads(list_scripts.data)
>>>
>>> javascriptBundler = JavascriptBundler()
>>> javascriptBundler.bundle(scripts['data'])
>>>
>>>
>>> This also needs little change in module dependency we defined using
>>> 'When': 'node_name' in `def get_own_javascripts(...)` method
>>> the module specified(name: module_name) is loaded when module given
>>> in `When` is expanded in node. Since we are using Webpack in which
>>> behaviour to load module is little different.
>>>
>>> Now in webpack we are using `imports-loader` to load specific
>>> modules. So this is how it should work.
>>>
>>> 1. First load all modules which do not have dependency on any node
>>> like 'about', 'dashboard',  'server-group', 'server' etc.
>>>
>>> 2. Load module such as `Databases` node first before its child nodes
>>> are loaded.
>>> Similarly load `Schemas` node before its child nodes are loaded as
>>> they are dependent on parent node.
>>>
>>> Thanks,
>>> Surinder
>>> On Wed, Jul 5, 2017 at 8:22 PM, Sarah McAlear 
>>> wrote:
>>>
 Hello,


> *​Things to discuss:*
>
> How to differentiate between a static and template JS
> ​​
> .
>

 What is the advantage of webpacking templated JS? It seems as
 though this creates a system in which the bundled dependencies have to
>>>

pgAdmin 4 commit: Add a missing dependency.

2017-07-18 Thread Dave Page
Add a missing dependency.

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=659aeeb58e6a91f67b546e1d3fa06735cf453c68
Author: Surinder Kumar 

Modified Files
--
web/pgadmin/static/bundle/slickgrid.js | 1 +
1 file changed, 1 insertion(+)



pgAdmin 4 commit: Resolve an issue where collection nodes sometimes wou

2017-07-18 Thread Dave Page
Resolve an issue where collection nodes sometimes wouldn't sort properly.

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=b90d368ee7bf8a029378cd70f577e24e05e1c13f
Author: Surinder Kumar 

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



Re: [pgAdmin4]: Webpacking of static JS/CSS

2017-07-18 Thread Dave Page
Thanks, applied.

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

> Hi
>
> 1. As Slickgrid has dependency of `jQuery-ui`, it was missed. now added.
> 2. Column sorting for collection nodes sometimes failing when clicked on
> different collection nodes.
>
> Please find attached patch.
>
> Thanks
> Surinder
>
> On Tue, Jul 18, 2017 at 8:20 PM, Khushboo Vashi <
> khushboo.va...@enterprisedb.com> wrote:
>
>>
>>
>> On Tue, Jul 18, 2017 at 7:46 PM, Dave Page  wrote:
>>
>>> Thanks - applied!
>>>
>>> Awesome work - on an average of 3 tests on my Mac, load time reduced
>>> from 11.55s with v1.6 to 5.53s with GIT Head.
>>>
>> ​Thanks to all​
>
>>
>>> Surinder, great work...
>>
>>
>>> On Mon, Jul 17, 2017 at 5:57 PM, Surinder Kumar <
>>> surinder.ku...@enterprisedb.com> wrote:
>>>
 Hi

 Now all test cases are executing.
 Please find updated patch.

 Thanks
 Surinder

 On Mon, Jul 17, 2017 at 6:57 PM, Surinder Kumar <
 surinder.ku...@enterprisedb.com> wrote:

> On Mon, Jul 17, 2017 at 4:52 PM, Dave Page  wrote:
>
>> Hi
>>
>> No errors now, but do you know why JS tests are being skipped?
>>
> ​No errors/warning in console even after settings `logLevel:
> config.LOG_DEBUG`. I am still debugging.
>
>>
>> PhantomJS 2.1.1 (Mac OS X 0.0.0): Executed 4 of 216 (skipped 212)
>> SUCCESS (0.085 secs / 0.046 secs)
>>
>> Thanks!
>>
>> On Mon, Jul 17, 2017 at 12:07 PM, Surinder Kumar <
>> surinder.ku...@enterprisedb.com> wrote:
>>
>>> ​Hi Dave,
>>>
>>> I didn't removed the vendor modules when i ran regression test
>>> cases, so modules were being referenced from vendor dir and passed for 
>>> me.
>>> Now I have fixed path references and test cases are working.
>>>
>>> Please find attached patch.
>>>
>>> Thanks
>>> Surinder​
>>>
>>> On Mon, Jul 17, 2017 at 3:18 PM, Surinder Kumar <
>>> surinder.ku...@enterprisedb.com> wrote:
>>>
 Hi

 I'm currently working on first TODO: "Automatically handle static
 and template JS files"

 As discussed with Ashesh, currently the paths to module id are
 written manually in webpack.config.js, instead the path defined in 
 moudle's
 `def get_own_javascript()`  should be used.

 So, we will be generating a paths.json file which will contain:

 1. resolve > alias - path with reference to module id.(Static files)

 2. externals - list of modules to be loaded dynamically on
 demand(Template files)

 3. Shim module dependency

 4. List of JS modules to be loaded in specified order.

 *Implementation:*

 To generate `paths.json` file, we will be using `Flask's
 test_client` to make an http request internally within the app context 
 so
 we can call `current_app.javascripts` property and return the list of 
 JS
 paths and write those into paths.json file and then use it in
 webpack.shim.js before the execution of `yarn run bundle` in
 `javascript_bundler.py`

 *For example:*

 @app.route('/get_script_paths')
 def get_script_paths():
 from flask import current_app
 from pgadmin.utils.ajax import make_json_response

 return make_json_response(data=current_app.javascripts)

 if config.DEBUG:
 with app.test_client() as client:
 import simplejson as json
 list_scripts = client.get('/get_script_paths')
 scripts = json.loads(list_scripts.data)

 javascriptBundler = JavascriptBundler()
 javascriptBundler.bundle(scripts['data'])


 This also needs little change in module dependency we defined using
 'When': 'node_name' in `def get_own_javascripts(...)` method
 the module specified(name: module_name) is loaded when module given
 in `When` is expanded in node. Since we are using Webpack in which
 behaviour to load module is little different.

 Now in webpack we are using `imports-loader` to load specific
 modules. So this is how it should work.

 1. First load all modules which do not have dependency on any node
 like 'about', 'dashboard',  'server-group', 'server' etc.

 2. Load module such as `Databases` node first before its child
 nodes are loaded.
 Similarly load `Schemas` node before its child nodes are loaded as
 they are dependent on parent node.

 Thanks,
 Surinder
 On Wed, Jul 5, 2017 at 8:22 PM, Sarah McAlear 
 wrote:

> Hello,
>
>
>> *​Thin

Re: [pgAdmin4]: Webpacking of static JS/CSS

2017-07-18 Thread Murtuza Zabuawala
Great job Surinder, Load time ~2 sec on browser :)

[image: Inline image 1]


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

On Tue, Jul 18, 2017 at 9:01 PM, Dave Page  wrote:

> Thanks, applied.
>
> On Tue, Jul 18, 2017 at 4:12 PM, Surinder Kumar <
> surinder.ku...@enterprisedb.com> wrote:
>
>> Hi
>>
>> 1. As Slickgrid has dependency of `jQuery-ui`, it was missed. now added.
>> 2. Column sorting for collection nodes sometimes failing when clicked on
>> different collection nodes.
>>
>> Please find attached patch.
>>
>> Thanks
>> Surinder
>>
>> On Tue, Jul 18, 2017 at 8:20 PM, Khushboo Vashi <
>> khushboo.va...@enterprisedb.com> wrote:
>>
>>>
>>>
>>> On Tue, Jul 18, 2017 at 7:46 PM, Dave Page  wrote:
>>>
 Thanks - applied!

 Awesome work - on an average of 3 tests on my Mac, load time reduced
 from 11.55s with v1.6 to 5.53s with GIT Head.

>>> ​Thanks to all​
>>
>>>
 Surinder, great work...
>>>
>>>
 On Mon, Jul 17, 2017 at 5:57 PM, Surinder Kumar <
 surinder.ku...@enterprisedb.com> wrote:

> Hi
>
> Now all test cases are executing.
> Please find updated patch.
>
> Thanks
> Surinder
>
> On Mon, Jul 17, 2017 at 6:57 PM, Surinder Kumar <
> surinder.ku...@enterprisedb.com> wrote:
>
>> On Mon, Jul 17, 2017 at 4:52 PM, Dave Page  wrote:
>>
>>> Hi
>>>
>>> No errors now, but do you know why JS tests are being skipped?
>>>
>> ​No errors/warning in console even after settings `logLevel:
>> config.LOG_DEBUG`. I am still debugging.
>>
>>>
>>> PhantomJS 2.1.1 (Mac OS X 0.0.0): Executed 4 of 216 (skipped 212)
>>> SUCCESS (0.085 secs / 0.046 secs)
>>>
>>> Thanks!
>>>
>>> On Mon, Jul 17, 2017 at 12:07 PM, Surinder Kumar <
>>> surinder.ku...@enterprisedb.com> wrote:
>>>
 ​Hi Dave,

 I didn't removed the vendor modules when i ran regression test
 cases, so modules were being referenced from vendor dir and passed for 
 me.
 Now I have fixed path references and test cases are working.

 Please find attached patch.

 Thanks
 Surinder​

 On Mon, Jul 17, 2017 at 3:18 PM, Surinder Kumar <
 surinder.ku...@enterprisedb.com> wrote:

> Hi
>
> I'm currently working on first TODO: "Automatically handle static
> and template JS files"
>
> As discussed with Ashesh, currently the paths to module id are
> written manually in webpack.config.js, instead the path defined in 
> moudle's
> `def get_own_javascript()`  should be used.
>
> So, we will be generating a paths.json file which will contain:
>
> 1. resolve > alias - path with reference to module id.(Static
> files)
>
> 2. externals - list of modules to be loaded dynamically on
> demand(Template files)
>
> 3. Shim module dependency
>
> 4. List of JS modules to be loaded in specified order.
>
> *Implementation:*
>
> To generate `paths.json` file, we will be using `Flask's
> test_client` to make an http request internally within the app 
> context so
> we can call `current_app.javascripts` property and return the list of 
> JS
> paths and write those into paths.json file and then use it in
> webpack.shim.js before the execution of `yarn run bundle` in
> `javascript_bundler.py`
>
> *For example:*
>
> @app.route('/get_script_paths')
> def get_script_paths():
> from flask import current_app
> from pgadmin.utils.ajax import make_json_response
>
> return make_json_response(data=current_app.javascripts)
>
> if config.DEBUG:
> with app.test_client() as client:
> import simplejson as json
> list_scripts = client.get('/get_script_paths')
> scripts = json.loads(list_scripts.data)
>
> javascriptBundler = JavascriptBundler()
> javascriptBundler.bundle(scripts['data'])
>
>
> This also needs little change in module dependency we defined
> using 'When': 'node_name' in `def get_own_javascripts(...)` method
> the module specified(name: module_name) is loaded when module
> given in `When` is expanded in node. Since we are using Webpack in 
> which
> behaviour to load module is little different.
>
> Now in webpack we are using `imports-loader` to load specific
> modules. So this is how it should work.
>
> 1. First load all modules which do not have dependency on any node
> like 'about', 'dashboard',  'server-group', 'server' etc.
>>>

Jenkins build is back to normal : pgadmin4-master-python34 #236

2017-07-18 Thread pgAdmin 4 Jenkins
See 





Build failed in Jenkins: pgadmin4-master-python27-feature #8

2017-07-18 Thread pgAdmin 4 Jenkins
See 


Changes:

[Dave Page] Use client-side url_for in the sql editor and data grid modules.

[Dave Page] Ensure revoked public privileges are displayed in the RE-SQL for

[Dave Page] Ensure saved passwords are effective immediately, not just 
following a

[Dave Page] Un-break query tool feature tests.

[Dave Page] Add support for the hostaddr connection parameter. This helps us 
play

[Dave Page] Use on-demand loading for results in the query tool. Fixes #2137

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

[Dave Page] Add preferences to enable brace matching and brace closing in the 
SQL

[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

[Dave Page] Allow non-superusers to debug their own functions and prevent them 
from

[Dave Page] Update preferences docs.

[Dave Page] Fix image size.

[Dave Page] Fix encoding issue when saving servers. Fixes #2518

[Dave Page] A number of minor cleanups to the recent changes to the query tool.

[akshay.joshi] 1) Edit cellEditing function, in some cases grid object is 
undefined. 2)

[Dave Page] Improve speed of Select All in the results grid. Fixes #2522

[Dave Page] Allow the dashboard panel to be closed. Fixes #2506

[Dave Page] Add support for SCSS building in webpack.

[Dave Page] Update alertify alerts to use the styling defined in the styleguide.

[Dave Page] Update alertify alerts to use the styling defined in the styleguide

[Dave Page] Fix a couple of gripes from the JS linter on Windows.

[Dave Page] Fix typo that caused a layout issue with the Edit Grid.

[Dave Page] Fix an issue where duplicate entry is made of successful executed 
query,

[Dave Page] Fix a syntax error in the SQL Editor.

[Dave Page] Fix clipboard handling with large datasets. Fixes #2489

[Dave Page] Improve the debugger's default page layout, and prevent attempts to

[Dave Page] Fix deletion of table rows with the column definition having NOT 
NULL

[Dave Page] Allow breakpoints to be set on triggers on views. Fixes #2528

[Dave Page] Allow debugging of functions in packages. Fixes #1948

[Dave Page] Remove unnecessary whitespace from stored procedure SQL. Fixes #2146

[Dave Page] Resolve a number of issues with domains and domain constraints. 
Fixes

[Dave Page] Improve styling for alerts by highlighting the icon.

[Dave Page] Prompt the user to save dirty queries rather than discard them for a

[Dave Page] Fix alert layout when more than one are shown at once.

[Dave Page] Allow use of Shift+Tab to un-indent selected text. Fixes #1988

[Dave Page] Add some useful make targets for bundling and linting.

[Dave Page] Remove unused minimisation code

[Dave Page] UI tweaks for the query history.

[Dave Page] In subnodes without dropdowns, the rows had smaller height, making 
them

[Dave Page] Ensure the save password option is enabled when creating a server. 
Fixes

[akshay.joshi] Added support of Declarative Partitioning (Range, List) for 
PostgreSQL

[akshay.joshi] Fixed issue by adding extra check for 'relkind' column

[akshay.joshi] Partitioned table does not present in grant wizard. Fixes #2543

[Dave Page] Fix clear history.

[Dave Page] Enable pretty html output of our karma test results. While running 
yarn

[Dave Page] Fix the formatting of the ROWS option for functions etc. Fixes #2537

[Dave Page] Improve spacing around delete icons in backform tables.

[Dave Page] Fix handling of CREATE TABLE OF . Fixes #2534

[Dave Page] Fix alert animation on IE11

[Dave Page] Open query tool and debugger windows in new tabs by default.

[Dave Page] Revert "Open query tool and debugger windows in new tabs by 
default."

[Dave Page] Update dialogue error styling to match alerts

[Dave Page] Fix history view in IE11.

[Dave Page] Use the correct font for alerts on IE.

[Dave Page] Fix history font on IE.

[Dave Page] Update Mingw build for changes in QtWebKit

[Dave Page] Refresh nodes correctly when there is a single child that is 
updated.

[Dave Page] Fix IE11 alert layout again.

[Dave Page] Handle un-mounted drives correctly on Windows. Fixes #1999

[Dave Page] Handle partitioned tables created "OF TYPE". Fixes #2545

[Dave Page] Release notes for 1.6.

[Dave Page] Bump version numbers prior to release.

[Dave Page] Couple of typos in the release notes.

[Dave Page] Fix drop/drop cascade for partitioned tables. Fixes #2550

[Dave Page] Ensure the initial password is properly hashed during setup in web 
mode.

[Dave Page] Fix alignment of Object > delete/drop & properties icons

[Dave Page] Ensure dependencies are packaged in the tarball

[Dave Page] Fix a compiler error with older compilers.

[Dave Page] Revert "Ensure dependencies are packaged in the tarball"

[Dave Page] Fix p

Re: Build failed in Jenkins: pgadmin4-master-python27-feature #8

2017-07-18 Thread Harshal Dhumal
On Tue, Jul 18, 2017 at 9:33 PM, pgAdmin 4 Jenkins 
wrote:

> See  feature/8/display/redirect?page=changes>
>
> Changes:
>
> [Dave Page] Use client-side url_for in the sql editor and data grid
> modules.
>
> [Dave Page] Ensure revoked public privileges are displayed in the RE-SQL
> for
>
> [Dave Page] Ensure saved passwords are effective immediately, not just
> following a
>
> [Dave Page] Un-break query tool feature tests.
>
> [Dave Page] Add support for the hostaddr connection parameter. This helps
> us play
>
> [Dave Page] Use on-demand loading for results in the query tool. Fixes
> #2137
>
> [Dave Page] Allow the user to close the dashboard panel. Fixes #2506
>
> [Dave Page] Add preferences to enable brace matching and brace closing in
> the SQL
>
> [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
>
> [Dave Page] Allow non-superusers to debug their own functions and prevent
> them from
>
> [Dave Page] Update preferences docs.
>
> [Dave Page] Fix image size.
>
> [Dave Page] Fix encoding issue when saving servers. Fixes #2518
>
> [Dave Page] A number of minor cleanups to the recent changes to the query
> tool.
>
> [akshay.joshi] 1) Edit cellEditing function, in some cases grid object is
> undefined. 2)
>
> [Dave Page] Improve speed of Select All in the results grid. Fixes #2522
>
> [Dave Page] Allow the dashboard panel to be closed. Fixes #2506
>
> [Dave Page] Add support for SCSS building in webpack.
>
> [Dave Page] Update alertify alerts to use the styling defined in the
> styleguide.
>
> [Dave Page] Update alertify alerts to use the styling defined in the
> styleguide
>
> [Dave Page] Fix a couple of gripes from the JS linter on Windows.
>
> [Dave Page] Fix typo that caused a layout issue with the Edit Grid.
>
> [Dave Page] Fix an issue where duplicate entry is made of successful
> executed query,
>
> [Dave Page] Fix a syntax error in the SQL Editor.
>
> [Dave Page] Fix clipboard handling with large datasets. Fixes #2489
>
> [Dave Page] Improve the debugger's default page layout, and prevent
> attempts to
>
> [Dave Page] Fix deletion of table rows with the column definition having
> NOT NULL
>
> [Dave Page] Allow breakpoints to be set on triggers on views. Fixes #2528
>
> [Dave Page] Allow debugging of functions in packages. Fixes #1948
>
> [Dave Page] Remove unnecessary whitespace from stored procedure SQL. Fixes
> #2146
>
> [Dave Page] Resolve a number of issues with domains and domain
> constraints. Fixes
>
> [Dave Page] Improve styling for alerts by highlighting the icon.
>
> [Dave Page] Prompt the user to save dirty queries rather than discard them
> for a
>
> [Dave Page] Fix alert layout when more than one are shown at once.
>
> [Dave Page] Allow use of Shift+Tab to un-indent selected text. Fixes #1988
>
> [Dave Page] Add some useful make targets for bundling and linting.
>
> [Dave Page] Remove unused minimisation code
>
> [Dave Page] UI tweaks for the query history.
>
> [Dave Page] In subnodes without dropdowns, the rows had smaller height,
> making them
>
> [Dave Page] Ensure the save password option is enabled when creating a
> server. Fixes
>
> [akshay.joshi] Added support of Declarative Partitioning (Range, List) for
> PostgreSQL
>
> [akshay.joshi] Fixed issue by adding extra check for 'relkind' column
>
> [akshay.joshi] Partitioned table does not present in grant wizard. Fixes
> #2543
>
> [Dave Page] Fix clear history.
>
> [Dave Page] Enable pretty html output of our karma test results. While
> running yarn
>
> [Dave Page] Fix the formatting of the ROWS option for functions etc. Fixes
> #2537
>
> [Dave Page] Improve spacing around delete icons in backform tables.
>
> [Dave Page] Fix handling of CREATE TABLE OF . Fixes #2534
>
> [Dave Page] Fix alert animation on IE11
>
> [Dave Page] Open query tool and debugger windows in new tabs by default.
>
> [Dave Page] Revert "Open query tool and debugger windows in new tabs by
> default."
>
> [Dave Page] Update dialogue error styling to match alerts
>
> [Dave Page] Fix history view in IE11.
>
> [Dave Page] Use the correct font for alerts on IE.
>
> [Dave Page] Fix history font on IE.
>
> [Dave Page] Update Mingw build for changes in QtWebKit
>
> [Dave Page] Refresh nodes correctly when there is a single child that is
> updated.
>
> [Dave Page] Fix IE11 alert layout again.
>
> [Dave Page] Handle un-mounted drives correctly on Windows. Fixes #1999
>
> [Dave Page] Handle partitioned tables created "OF TYPE". Fixes #2545
>
> [Dave Page] Release notes for 1.6.
>
> [Dave Page] Bump version numbers prior to release.
>
> [Dave Page] Couple of typos in the release notes.
>
> [Dave Page] Fix drop/drop cascade for partitioned tables. Fixes #2550
>
> [Dave Page] Ensure the initial password is properly 

Re: pgAdmin 4 v1.6 Released!

2017-07-18 Thread Pawel Hadam
Hi Dave,

Thank you for this advise.

Please find attached my files:

1) C:\Users\pawelhadam\AppData\Roaming\pgAdmin\pgadmin4.log

I cannot understand why this log file says "Starting pgAdmin 4 v1.5..." as
I have installed v1.6 from pgadmin4-1.6-x86.exe

2) C:\Program Files (x86)\pgAdmin 4\v1\web\config_local.py

Thank you and kind regards
Pawel


On 17 July 2017 at 09:36, Dave Page  wrote:

>
>
> On Fri, Jul 14, 2017 at 1:58 PM, Pawel Hadam  wrote:
>
>> Thank you Dave and Khushboo for advises.
>>
>> 1) (re)moving 'pgadmin4.db' - did not help.
>>
>> 2) I have disabled teredo - did not help.
>>
>> 3) localhost is resolved to IPv6 address:
>>
>> $ ping localhost
>>
>> Pinging ogrodowa [::1] with 32 bytes of data:
>> Reply from ::1: time<1ms
>> Reply from ::1: time<1ms
>> Reply from ::1: time<1ms
>> Reply from ::1: time<1ms
>>
>> 4) I DO use IPv4 as well.
>>
>> 5) No entries for localhost in hosts file.
>>
>> 6) On which address/port the server should be listening?
>>
>> $ netstat -a | grep LISTEN | grep "127.0.0.1"
>>   TCP127.0.0.1:3212 ogrodowa:0 LISTENING
>>   TCP127.0.0.1:3213 ogrodowa:0 LISTENING
>>   TCP127.0.0.1:4370 ogrodowa:0 LISTENING
>>   TCP127.0.0.1:4371 ogrodowa:0 LISTENING
>>   TCP127.0.0.1:4380 ogrodowa:0 LISTENING
>>   TCP127.0.0.1:4381 ogrodowa:0 LISTENING
>>   TCP127.0.0.1:5037 ogrodowa:0 LISTENING
>>   TCP127.0.0.1:9990 ogrodowa:0 LISTENING
>>   TCP127.0.0.1:3ogrodowa:0 LISTENING
>>   TCP127.0.0.1:49674ogrodowa:0 LISTENING
>>
>> 7) ping to 127.0.0.1 works well:
>>
>> $ ping 127.0.0.1
>>
>> Pinging 127.0.0.1 with 32 bytes of data:
>> Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
>> Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
>> Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
>> Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
>>
>>
>> Not sure what else I need to check...
>>
>
> In the web/ subdirectory of the installation, you should find a file
> called config.py. Please create a file called config_local.py in the same
> directory, containing the following lines (excluding the  lines) :
>
> 
> from config import *
>
> # Debug mode
> DEBUG = True
>
> # Log
> CONSOLE_LOG_LEVEL = DEBUG
> FILE_LOG_LEVEL = DEBUG
> 
>
> Then, try to start pgAdmin. That should create a more useful logfile in
> %APPDATA%\pgAdmin to share with us.
>
> Thanks.
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
# -*- coding: utf-8 -*-

##
#
# pgAdmin 4 - PostgreSQL Tools
#
# Copyright (C) 2013 - 2017, The pgAdmin Development Team
# This software is released under the PostgreSQL Licence
#
# config.py - Core application configuration settings
#
##

import os
import sys


# We need to include the root directory in sys.path to ensure that we can
# find everything we need when running in the standalone runtime.
root = os.path.dirname(os.path.realpath(__file__))
if sys.path[0] != root:
sys.path.insert(0, root)

from pgadmin.utils import env, IS_PY2, IS_WIN, fs_short_path

##
# Application settings
##

# Name of the application to display in the UI
APP_NAME = 'pgAdmin 4'
APP_ICON = 'icon-postgres-alt'

##
# Application settings
##

# NOTE!!!
# If you change any of APP_RELEASE, APP_REVISION or APP_SUFFIX, then you
# must also change APP_VERSION_INT to match.
#
# Any changes made here must also be made in runtime/pgAdmin4.pro and
# runtime/Info.plist
#

# Application version number components
APP_RELEASE = 1
APP_REVISION = 6

# Application version suffix, e.g. 'beta1', 'dev'. Usually an empty string
# for GA releases.
APP_SUFFIX = ''

# Numeric application version for upgrade checks. Should be in the format:
# [X]XYYZZ, where X is the release version, Y is the revision, with a leading
# zero if needed, and Z represents the suffix, with a leading zero if needed
# Note that we messed this up in v1.x, where the format is [X]XYZZZ. This
# should be fixed for v2.x!!
APP_VERSION_INT = 16001

# DO NOT CHANGE!
# The application version string, constructed from the components
if not APP_SUFFIX:
APP_VERSION = '%s.%s' % (APP_RELEASE, APP_REVISION)
else:
APP_VERSION = '%s.%s-%s' % (APP_RELEASE, APP_REVISION, APP_SUFFIX)

# Copyright string for display in the app
# Any changes made here must also be made in runtime/pgAdmin4.pro
APP_COPY