Re: Proposal for changes in official Docker image

2018-04-03 Thread Dave Page
Hi

On Sat, Mar 31, 2018 at 5:54 PM, Максим Кольцов  wrote:

> 2018-03-19 17:55 GMT+03:00 Dave Page :
> >
> > - PGADMIN_SERVER_NAME doesn't appear to be supported. This was added at
> user
> > request, for security reasons (to help ensure the connection is going
> where
> > expected). I'm not entirely convinced of the value of that, but if it's
> > fairly painless to add, it may well be worth it.
>
> Can you explain the meaning of this option, or maybe give me a link to
> original feature request?
> As far as I understand, Apache uses this to identify virtual hosts
> based on HTTP Host header,
> but there are no virtual hosts in Gunicorn, so no need for this.
>

Yeah, I looked back at the history on this - it was an Apache requirement,
essentially to avoid confusing SNI. If Gunicorn doesn't support virtual
hosts, then I agree there's no longer a need for this.


>
> > - If you don't map /var/lib/pgadmin (in my case, to a directory already
> > containing a config), then I was seeing the following error. I would
> expect
> > it to init within the container if the config directory isn't mapped:
> >
> > piranha:web dpage$ docker logs affectionate_spence
> > sh: -z: unknown operand
> > NOTE: Configuring authentication for SERVER mode.
> >
> > Enter the email address and password to use for the initial pgAdmin user
> > account:
> >
> > Traceback (most recent call last):
> >   File "run_pgadmin.py", line 4, in 
> > from pgAdmin4 import app
> >   File "/pgadmin4/pgAdmin4.py", line 67, in 
> > app = create_app()
> >   File "/pgadmin4/pgadmin/__init__.py", line 306, in create_app
> > db_upgrade(app)
> >   File "/pgadmin4/pgadmin/setup/db_upgrade.py", line 25, in db_upgrade
> > flask_migrate.upgrade(migration_folder)
> >   File "/usr/local/lib/python3.6/site-packages/flask_migrate/__init
> __.py",
> > line 244, in upgrade
> > command.upgrade(config, revision, sql=sql, tag=tag)
> >   File "/usr/local/lib/python3.6/site-packages/alembic/command.py", line
> > 254, in upgrade
> > script.run_env()
> >   File "/usr/local/lib/python3.6/site-packages/alembic/script/base.py",
> line
> > 427, in run_env
> > util.load_python_file(self.dir, 'env.py')
> >   File "/usr/local/lib/python3.6/site-packages/alembic/util/pyfiles.py",
> > line 81, in load_python_file
> > module = load_module_py(module_id, path)
> >   File "/usr/local/lib/python3.6/site-packages/alembic/util/compat.py",
> line
> > 83, in load_module_py
> > spec.loader.exec_module(module)
> >   File "/pgadmin4/pgadmin/setup/../../migrations/env.py", line 94, in
> > 
> > run_migrations_online()
> >   File "/pgadmin4/pgadmin/setup/../../migrations/env.py", line 87, in
> > run_migrations_online
> > context.run_migrations()
> >   File "", line 8, in run_migrations
> >   File
> > "/usr/local/lib/python3.6/site-packages/alembic/runtime/environment.py",
> > line 836, in run_migrations
> > self.get_context().run_migrations(**kw)
> >   File
> > "/usr/local/lib/python3.6/site-packages/alembic/runtime/migration.py",
> line
> > 330, in run_migrations
> > step.migration_fn(**kw)
> >   File "/pgadmin4/migrations/versions/fdc58d9bd449_.py", line 112, in
> > upgrade
> > email, password = user_info()
> >   File "/pgadmin4/pgadmin/setup/user_info.py", line 55, in user_info
> > email = input("Email address: ")
> > EOFError: EOF when reading a line
> > [2018-03-19 14:50:59 +] [1] [INFO] Starting gunicorn 19.7.1
> > [2018-03-19 14:50:59 +] [1] [INFO] Listening at: http://0.0.0.0:8080
> (1)
> > [2018-03-19 14:50:59 +] [1] [INFO] Using worker: threads
> > [2018-03-19 14:50:59 +] [14] [INFO] Booting worker with pid: 14
> > [2018-03-19 14:50:59 +] [14] [ERROR] Exception in worker process
> > Traceback (most recent call last):
> >   File "/usr/local/lib/python3.6/site-packages/gunicorn/arbiter.py",
> line
> > 578, in spawn_worker
> > worker.init_process()
> >   File "/usr/local/lib/python3.6/site-packages/gunicorn/workers/
> gthread.py",
> > line 109, in init_process
> > super(ThreadWorker, self).init_process()
> >   File "/usr/local/lib/python3.6/site-packages/gunicorn/workers/
> base.py",
> > line 126, in init_process
> > self.load_wsgi()
> >   File "/usr/local/lib/python3.6/site-packages/gunicorn/workers/
> base.py",
> > line 135, in load_wsgi
> > self.wsgi = self.app.wsgi()
> >   File "/usr/local/lib/python3.6/site-packages/gunicorn/app/base.py",
> line
> > 67, in wsgi
> > self.callable = self.load()
> >   File "/usr/local/lib/python3.6/site-packages/gunicorn/app/wsgiapp.py",
> > line 65, in load
> > return self.load_wsgiapp()
> >   File "/usr/local/lib/python3.6/site-packages/gunicorn/app/wsgiapp.py",
> > line 52, in load_wsgiapp
> > return util.import_app(self.app_uri)
> >   File "/usr/local/lib/python3.6/site-packages/gunicorn/util.py", line
> 352,
> > in import_app
> > __import__(module)
> >   File "/pgadmin4/run_pgadmin.py", line 4, in 
> > from pgAdmin4 import app
> >   File

Re: [pgAdmin4][Patch]: RM #1978 - Add an option to allow user to disable alertifyjs and acitree animations

2018-04-03 Thread Khushboo Vashi
Hi Joao,

Thanks for the review. I have sent the patch.

On Thu, Mar 29, 2018 at 8:46 PM, Joao De Almeida Pereira <
jdealmeidapere...@pivotal.io> wrote:

> Hi Khushboo,
>
> The patch looks like it is heading on the correct direction, we passed it
> through our test pipeline and all tests passed.
>
> We found the same issues as Dave mentioned in his email, also after some
> code review we have the following questions/comments:
>
> Fixed

> . Why does modify_animation.js have a dependency on sources/pgadmin if it
> doesnt use it?
>
Removed, it was by mistake

> . Can we convert modify_animation.js to ES6 without requirejs?
>
Done

> . Why does modifyAnimation function have 2 arguments if we never use the
> second one?
>
Not applicable now as it has been changed.

> . Can we convert modify_animation_spec.js to ES6 without requirejs?
>
Done

> . Why is pgBrowser.tree.options function called 4 times in the tests?
>
While setting tree options, it has been used 4 times.

>As an aside, when you use toHaveBeenCalledWith it is redundant to
> expect on toHaveBeenCalled
>
Thanks for the information

> . Looks like we are missing some coverage of the alertify modification as
> well
>
I have improved the coverage.

>
>

> As an aside get_preferences, the "cache", is still broken, if the cache as
> no value it will retrieve it but returns undefined to the caller. This
> behavior need to be addressed. We should change get preferences to be a
> Promise based thing or else this might become a problem
>
> Will check and fix.

> As another aside, one of our goals should be to move away from requirejs
> into a full ES6, webpack javascript build. In order to do that we should
> try to write the least amount of code possible using requirejs syntax. If
> we really need to write something in requirejs let it be a wrapper that
> call our ES6 function/class
>
> Thanks
> Joao
>
> Thanks,
Khushboo

> On Thu, Mar 29, 2018 at 9:25 AM Dave Page  wrote:
>
>> Hi
>>
>> On Thu, Mar 29, 2018 at 1:51 PM, Khushboo Vashi <
>> khushboo.va...@enterprisedb.com> wrote:
>>
>>>
>>>
>>> On Mon, Mar 26, 2018 at 6:07 PM, Dave Page  wrote:
>>>
 Hi

 On Mon, Mar 26, 2018 at 7:23 AM, Khushboo Vashi <
 khushboo.va...@enterprisedb.com> wrote:

> Hi,
>
> Please find the attached patch to fix RM #1978: Add an option to allow
> user to disable alertifyjs and acitree animations.
>

 I think these really need to be per-user settings, not
 per-installation.. Whether or not animations are shown is really a matter
 of personal taste and circumstance.

 Right, it should be per-user settings.  Please find the attached
>>> updated patch.
>>>
>>
>> I found some issues I'm afraid:
>>
>> - The label "Enable dialogues/notifications animation?" should read
>> "Enable dialogue/notification animation?"
>>
>> - Disabling treeview animation only seems to affect the main browser
>> treeview, and not others in the application (e.g. the one on the
>> Preferences panel).
>>
>>  - After disabling dialogue/notification animations, I cannot re-enable
>> notification animations. If I flip the switch back on, dialogue animations
>> immediately start working again, but notification animations don't even
>> work following a reload.
>>
>> Thanks.
>>
>> --
>> Dave Page
>> Blog: http://pgsnake.blogspot.com
>> Twitter: @pgsnake
>>
>> EnterpriseDB UK: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>>
>


Re: Regarding RM #2214 SCRAM Authentication for Change Password

2018-04-03 Thread Dave Page
Hi

On Mon, Apr 2, 2018 at 11:02 AM, Akshay Joshi  wrote:

> Hi Hackers,
>
> As a part of RM #2214, we will have to support SCRAM authentication. User
> will be able to login, but the problem is with "Change Password" of
> database server won't work, as we are encrypting new password using md5 and
> set the new password using "*ALTER USER  WITH ENCRYPTED PASSWORD
> *" query.
>
> If password_encryption = scram-sha-256 in postgresql.conf file then it
> will change the password with md5 encryption which is not correct and user
> won't be able to login using changed password. I have  tried previously
> (almost 12 months ago) and tried following again
>
> from passlib.hash import scram
>
> scram.default_rounds = 4096
> digest_info = scram.extract_digest_info(scram.encrypt(password), 'sha-256')
>
> salt = digest_info[0]
> rounds = digest_info[1]
> secret = digest_info[2]
>
> salted_password = hashlib.pbkdf2_hmac('sha256', secret, salt, rounds)
>
> but not able to encrypt the password for SCRAM.
>

Because you get a different hash than you'd get from libpq, or some other
problem?


>
> There is new method introduce in PostgreSQL 10 to encrypt the password:
>
> char *PQencryptPasswordConn(PGconn *conn, const char *passwd, const char 
> *user, const char *algorithm);
>
> As we are using psycopg2, so the support for the above method should be
> available in psycopg2. *Ashesh* *Vashi* has already send the patch to
> support for preparing encrypted password and they are planning to merge his
> patch in version 2.8. Following is the link of his patch
> https://github.com/psycopg/psycopg2/pull/576
>
> So when the above patch will be merged and released by psycopg2, we will
> work on this feature again and modified the code. I'll update the RM
> accordingly.
>

I've pinged Daniele on the tracker to see if we can get clarity on when a
release might happen.

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

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


[pgAdmin4][RM#3235] Code refactoring in Query tool

2018-04-03 Thread Murtuza Zabuawala
Hi,

PFA patch to extract the common code from query tool to handle ajax errors
& connection handling, Also added unit tests around extracted code.

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


RM_3235.diff
Description: Binary data


pgAdmin4 - Issue of unmaintained libraries

2018-04-03 Thread Murtuza Zabuawala
Hi Team,

As we are heavily dependent on 3rd party JS libraries and some of them are
no longer actively maintained by their respective authors (Last commit was
approximate year ago).

Some of the core libraries which are no longer actively maintained are,
- Backbone 
- wcDocker 
- aciTree 
- Backgrid /Backform
- jQuery 1.x  version

What would be our future plans when it comes to fixing the issues in the
core libraries or adding new feature?
(Ref: Email thread

)


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


Re: pgAdmin4 - Issue of unmaintained libraries

2018-04-03 Thread Dave Page
Hi

On Tue, Apr 3, 2018 at 1:22 PM, Murtuza Zabuawala <
murtuza.zabuaw...@enterprisedb.com> wrote:

> Hi Team,
>
> As we are heavily dependent on 3rd party JS libraries and some of them are
> no longer actively maintained by their respective authors (Last commit was
> approximate year ago).
>
> Some of the core libraries which are no longer actively maintained are,
> - Backbone 
> - wcDocker 
> - aciTree 
> - Backgrid /Backform
> - jQuery 1.x 
> version
>
> What would be our future plans when it comes to fixing the issues in the
> core libraries or adding new feature?
> (Ref: Email thread
> 
> )
>

Well jQuery can be updated can't it?

wcDocker is, as far as I'm aware, the only library of it's kind. Unless
something else has surpassed it in the last couple of years, there's
nothing even close in functionality to it. aciTree was in a similar
position, though Joao and team think there may be other candidates now.

As for Backbone/Backgrid/Backform, I don't know. Backbone could maybe be
replaced with React eventually. Not sure about the others.

In any case, this is likely to be a problem on an ongoing basis - and I
think we need to consider the future on a case by case basis when
necessary. It may mean moving to a different library, or it may mean
forking components, or it may be the upstream may have not had any commits
for a long time simply because there is no development happening right now,
but bugs may still be fixed.

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

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


Re: Bug #3083 fix

2018-04-03 Thread Dave Page
Hi

On Thu, Mar 29, 2018 at 4:29 PM, Joao De Almeida Pereira <
jdealmeidapere...@pivotal.io> wrote:

> Hi Dave,
> That looks like in the surrounding area of the change. We run our pipeline
> and everything was green.
> Can you provide more details, which python version are you using? OS?
>

That was on my travel laptop, which is macOS Sierra with the Apple supplied
Python 2.7.

Interestingly, I'm on my dev laptop today (same OS and Python) and it's
working just fine. The difference is that the travel machine is a 12"
Macbook, whilst the dev machine is


>
> Thanks
> Joao
>
> On Thu, Mar 29, 2018 at 9:03 AM Dave Page  wrote:
>
>> Hi
>>
>> On Wed, Mar 28, 2018 at 7:06 PM, Joao De Almeida Pereira <
>> jdealmeidapere...@pivotal.io> wrote:
>>
>>> Hey Akshay and Neethu
>>>
>>> We refactored the patch to add tests for the resize feature.  We were
>>> able to write test cases for the drag event by using spies and setting the
>>> rect dimensions.  In cases like this, we can just test some components in
>>> order to have enough confidence in the code.  So we isolated the function
>>> that implements the behavior of this feature and tested that it was
>>> performing as expected.
>>>
>>> We ran the patch through the pipelines and all of the tests passed.
>>>
>>
>> I'm consistently seeing the feature test failure below with this patch
>> applied:
>>
>> ==
>> FAIL: 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 125, in runTest
>> self._verify_row_data(True)
>>   File 
>> "/Users/dpage/git/pgadmin4/web/pgadmin/feature_tests/view_data_dml_queries.py",
>> line 325, in _verify_row_data
>> self.assertEquals(cells[idx], config_data[str(idx)][1])
>> AssertionError: u'[null]' != u'1'
>> - [null]
>> + 1
>>
>>
>> --
>> 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: Bug #3083 fix

2018-04-03 Thread Dave Page
Argh, managed to send before I finished typing...

On Tue, Apr 3, 2018 at 1:38 PM, Dave Page  wrote:

> Hi
>
> On Thu, Mar 29, 2018 at 4:29 PM, Joao De Almeida Pereira <
> jdealmeidapere...@pivotal.io> wrote:
>
>> Hi Dave,
>> That looks like in the surrounding area of the change. We run our
>> pipeline and everything was green.
>> Can you provide more details, which python version are you using? OS?
>>
>
> That was on my travel laptop, which is macOS Sierra with the Apple
> supplied Python 2.7.
>
> Interestingly, I'm on my dev laptop today (same OS and Python) and it's
> working just fine. The difference is that the travel machine is a 12"
> Macbook, whilst the dev machine is
>

a 15" MacBook Pro with 2 24" external monitors. That makes me wonder if the
small screen size is causing a problem with this test, something we have
seen before.


>
>
>>
>> Thanks
>> Joao
>>
>> On Thu, Mar 29, 2018 at 9:03 AM Dave Page  wrote:
>>
>>> Hi
>>>
>>> On Wed, Mar 28, 2018 at 7:06 PM, Joao De Almeida Pereira <
>>> jdealmeidapere...@pivotal.io> wrote:
>>>
 Hey Akshay and Neethu

 We refactored the patch to add tests for the resize feature.  We were
 able to write test cases for the drag event by using spies and setting the
 rect dimensions.  In cases like this, we can just test some components in
 order to have enough confidence in the code.  So we isolated the function
 that implements the behavior of this feature and tested that it was
 performing as expected.

 We ran the patch through the pipelines and all of the tests passed.

>>>
>>> I'm consistently seeing the feature test failure below with this patch
>>> applied:
>>>
>>> ==
>>> FAIL: runTest (pgadmin.feature_tests.view_da
>>> ta_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 125, in runTest
>>> self._verify_row_data(True)
>>>   File 
>>> "/Users/dpage/git/pgadmin4/web/pgadmin/feature_tests/view_data_dml_queries.py",
>>> line 325, in _verify_row_data
>>> self.assertEquals(cells[idx], config_data[str(idx)][1])
>>> AssertionError: u'[null]' != u'1'
>>> - [null]
>>> + 1
>>>
>>>
>>> --
>>> 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


Re: [pgAdmin4][RM#3154] Update modules to latest version

2018-04-03 Thread Dave Page
Hi

On Fri, Mar 30, 2018 at 8:01 AM, Murtuza Zabuawala <
murtuza.zabuaw...@enterprisedb.com> wrote:

> Hi,
>
> PFA patch to update the modules to latest version.
>
>
- Why isn't jQuery updated to 3.3.1?

- Shouldn't pkg/pip/setup_pip.py be updated with changes to psycopg2 and
pycrypto etc?



> We are not able to update some of the modules to latest version due to
> dependancy on other modules, For example
> - Python: Flask-Security has dependancy on flask-babelex which causes
> conflict with flask_babel
>

Hmm, flask-babelex might be a better option anyway; in particular, it
avoids loading catalogs with every request which seems desirable given the
size of ours. On the other hand, it hasn't been updated so recently.


> - JS: Can't update to Bootstrap4 because Bootstrap Switch & Bootstrap Datetime
> picker has dependancy on Bootstrap3.
>

OK.


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

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


Re: Bug #3083 fix

2018-04-03 Thread Harshal Dhumal
-- 
*Harshal Dhumal*
*Sr. Software Engineer*

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

On Tue, Apr 3, 2018 at 6:10 PM, Dave Page  wrote:

> Argh, managed to send before I finished typing...
>
> On Tue, Apr 3, 2018 at 1:38 PM, Dave Page  wrote:
>
>> Hi
>>
>> On Thu, Mar 29, 2018 at 4:29 PM, Joao De Almeida Pereira <
>> jdealmeidapere...@pivotal.io> wrote:
>>
>>> Hi Dave,
>>> That looks like in the surrounding area of the change. We run our
>>> pipeline and everything was green.
>>> Can you provide more details, which python version are you using? OS?
>>>
>>
>> That was on my travel laptop, which is macOS Sierra with the Apple
>> supplied Python 2.7.
>>
>> Interestingly, I'm on my dev laptop today (same OS and Python) and it's
>> working just fine. The difference is that the travel machine is a 12"
>> Macbook, whilst the dev machine is
>>
>
> a 15" MacBook Pro with 2 24" external monitors. That makes me wonder if
> the small screen size is causing a problem with this test, something we
> have seen before.
>
>

Yes, screen size does cause problem. Slick grid does not render all columns
if viewport is not wide enough (like it does for rows).
Remaining columns would render when user scrolls right.

To avoid similar problem in datatype feature test (commit:
88bcd3b5129db88975421e26c1bf188daf4892f9
)
I have executed
queries in batch to limit number of columns in single query result.



>
>>
>>>
>>> Thanks
>>> Joao
>>>
>>> On Thu, Mar 29, 2018 at 9:03 AM Dave Page  wrote:
>>>
 Hi

 On Wed, Mar 28, 2018 at 7:06 PM, Joao De Almeida Pereira <
 jdealmeidapere...@pivotal.io> wrote:

> Hey Akshay and Neethu
>
> We refactored the patch to add tests for the resize feature.  We were
> able to write test cases for the drag event by using spies and setting the
> rect dimensions.  In cases like this, we can just test some components in
> order to have enough confidence in the code.  So we isolated the function
> that implements the behavior of this feature and tested that it was
> performing as expected.
>
> We ran the patch through the pipelines and all of the tests passed.
>

 I'm consistently seeing the feature test failure below with this patch
 applied:

 ==
 FAIL: runTest (pgadmin.feature_tests.view_da
 ta_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 125, in runTest
 self._verify_row_data(True)
   File 
 "/Users/dpage/git/pgadmin4/web/pgadmin/feature_tests/view_data_dml_queries.py",
 line 325, in _verify_row_data
 self.assertEquals(cells[idx], config_data[str(idx)][1])
 AssertionError: u'[null]' != u'1'
 - [null]
 + 1


 --
 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: Show more granular timing info in the query tool hist

2018-04-03 Thread Dave Page
Show more granular timing info in the query tool history panel. Fixes #3244

Branch
--
master

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

Modified Files
--
web/package.json   |   1 +
.../js/sqleditor/calculate_query_run_time.js   |  33 
.../static/js/sqleditor/call_render_after_poll.js  |  52 ++
web/pgadmin/tools/sqleditor/static/js/sqleditor.js |  62 +--
.../sqleditor/calculate_query_run_time_spec.js |  82 +
.../sqleditor/call_render_after_poll_spec.js   | 203 +
web/yarn.lock  |   2 +-
7 files changed, 382 insertions(+), 53 deletions(-)



Re: [pgadmin4][patch] #3244 Query elapse time granularity

2018-04-03 Thread Dave Page
Thanks, patch applied.

On Mon, Apr 2, 2018 at 11:24 PM, Joao De Almeida Pereira <
jdealmeidapere...@pivotal.io> wrote:

> Hi Hackers,
>
> Attached you can find a patch that increases the granularity of time
> displayed for total run time of a query.
> Also extracts the functionality, wraps it with tests.
> An addon to this patch is the extraction of the function
> call_render_after_poll  that uses the function that calculates the time as
> well
>
>
> Thanks
> Joao
>



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

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


Re: v3.0 release on hold

2018-04-03 Thread Robert Eckhardt
All,

Where are we with respect to cutting this release?

-- Rob

On Mon, Mar 26, 2018 at 9:59 AM, Joao De Almeida Pereira <
jdealmeidapere...@pivotal.io> wrote:

> Hi Hackers,
>
> Did we had any progress on the things that are holding the release back?
>
> Thanks
> Joao
>
> On Fri, Mar 23, 2018 at 9:26 AM Akshay Joshi <
> akshay.jo...@enterprisedb.com> wrote:
>
>> Hi Dave
>>
>> On Fri, Mar 23, 2018 at 11:06 AM, Akshay Joshi <
>> akshay.jo...@enterprisedb.com> wrote:
>>
>>>
>>>
>>> On Thu, Mar 22, 2018 at 10:24 PM, Dave Page  wrote:
>>>
 Hi

 On Thu, Mar 22, 2018 at 1:13 PM, Dave Page  wrote:

>
> 2) Starting a second instance of the app bundle on Mac doesn't
> always open a new pgAdmin window as it should. It works fine in the
> debugger, or if you start the app with a command like:
> "/Applications/pgAdmin\ 4.app/Contents/MacOS/pgAdmin4". It
> doesn't work if you double-click the appbundle or use a command like 
> "open
> /Applications/pgAdmin\ 4.app"
>

   Still working on this, not found any solution yet.

>>>
>>  Not able to figure out the solution yet. I have tried to
>> debug the code, but every time it will create a new instance(tray icon). 
>> Do
>> I need to look into the code or something related to app bundle may be 
>> some
>> settings in info.plist or any other pointer?
>>
>
> Have a look at the code around line 85 an onwards of pgAdmin4.cpp. It
> creates the shared memory interlock (and log/address files) based on the
> current username and a hash of the executable name/path. My suspicion is
> that the path hash (which is calculated from argv[0] on line 72) is for
> some reason getting a different value each time when launched via the
> Finder or "open", thus the interlock is failing.
>

 So I took a look at this, and it seems the code is just fine. What is
 happening is that macOS only allows a single instance of an app to run at
 once. Whilst that is what we want of course, macOS is causing the new
 instance to exit before it has a change to open a new pgAdmin window. Using
 "open -n ..." or calling the embedded executable directly resolves that
 issue.

 So, there's another challenge to figure out... :-(

>>>
>>> OK. Will try to figure that out.
>>>
>>
>> After googled I have tried following solution:
>>
>>1. Create a shell script "launch.sh" and kept it in  
>> "/Applications/pgAdmin\
>>4.app/Contents/MacOS" folder. That shell script will contain the command
>>"open -n /Applications/pgAdmin\ 4.app/Contents/MacOS/pgAdmin4".
>>Change the "CFBundleExecutable" parameter of Info.plist from "pgAdmin4" to
>>"launch.sh".  It didn't work, shall script didn't launch.
>>2. Create one apple script with command like "do shell execute 
>> "/Applications/pgAdmin\
>>4.app", compile it and save it as Application. It create the app bundle,
>>copy contents of pgAdmin4 app to this newly created application. But the
>>problem is it opens and having icon in the dock and no response on double
>>click (second time).
>>
>>Will continue to figure out some other solutions tomorrow.
>>
>>>
 --
 Dave Page
 Blog: http://pgsnake.blogspot.com
 Twitter: @pgsnake

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

>>>
>>>
>>>
>>> --
>>> *Akshay Joshi*
>>>
>>> *Sr. Software Architect *
>>>
>>>
>>>
>>> *Phone: +91 20-3058-9517 <+91%2020%203058%209517>Mobile: +91
>>> 976-788-8246 <+91%2097678%2088246>*
>>>
>>
>>
>>
>> --
>> *Akshay Joshi*
>>
>> *Sr. Software Architect *
>>
>>
>>
>> *Phone: +91 20-3058-9517 <+91%2020%203058%209517>Mobile: +91 976-788-8246
>> <+91%2097678%2088246>*
>>
>


pgAdmin 4 commit: Add the ability to enable/disable UI animations. Fixe

2018-04-03 Thread Dave Page
Add the ability to enable/disable UI animations. Fixes #1978

Branch
--
master

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

Modified Files
--
docs/en_US/images/preferences_browser_display.png  | Bin 51492 -> 124191 bytes
docs/en_US/preferences.rst |   6 +-
docs/en_US/release_notes_3_0.rst   |   4 +-
web/pgadmin/browser/__init__.py|  13 +++
web/pgadmin/browser/static/js/browser.js   |   9 +-
web/pgadmin/preferences/static/js/preferences.js   |  12 ++-
web/pgadmin/static/css/alertify.noanimation.css|  41 +
web/pgadmin/static/js/modify_animation.js  |  57 +
web/pgadmin/templates/base.html|   1 +
web/pgadmin/tools/sqleditor/static/js/sqleditor.js |   5 +-
.../javascript/browser/modify_animation_spec.js|  94 +
11 files changed, 234 insertions(+), 8 deletions(-)



Re: [pgAdmin4][Patch]: RM #1978 - Add an option to allow user to disable alertifyjs and acitree animations

2018-04-03 Thread Dave Page
Hi

Thanks - I've committed this, however, could you send me an updated
screenshot for the docs? The one you sent was a different size and colour
depth from the others (and looked like a different scale).

On Tue, Apr 3, 2018 at 10:42 AM, Khushboo Vashi <
khushboo.va...@enterprisedb.com> wrote:

> Hi,
>
> Please find the attached updated patch.
>
> On Thu, Mar 29, 2018 at 6:54 PM, Dave Page  wrote:
>
>> Hi
>>
>> On Thu, Mar 29, 2018 at 1:51 PM, Khushboo Vashi <
>> khushboo.va...@enterprisedb.com> wrote:
>>
>>>
>>>
>>> On Mon, Mar 26, 2018 at 6:07 PM, Dave Page  wrote:
>>>
 Hi

 On Mon, Mar 26, 2018 at 7:23 AM, Khushboo Vashi <
 khushboo.va...@enterprisedb.com> wrote:

> Hi,
>
> Please find the attached patch to fix RM #1978: Add an option to allow
> user to disable alertifyjs and acitree animations.
>

 I think these really need to be per-user settings, not
 per-installation.. Whether or not animations are shown is really a matter
 of personal taste and circumstance.

 Right, it should be per-user settings.  Please find the attached
>>> updated patch.
>>>
>>
>> I found some issues I'm afraid:
>>
>> - The label "Enable dialogues/notifications animation?" should read
>> "Enable dialogue/notification animation?"
>>
>> Changed.
>
>> - Disabling treeview animation only seems to affect the main browser
>> treeview, and not others in the application (e.g. the one on the
>> Preferences panel).
>>
>> Fixed
>
>>  - After disabling dialogue/notification animations, I cannot re-enable
>> notification animations. If I flip the switch back on, dialogue animations
>> immediately start working again, but notification animations don't even
>> work following a reload.
>>
>> Fixed.
>
>> Thanks.
>>
>> --
>> Dave Page
>> Blog: http://pgsnake.blogspot.com
>> Twitter: @pgsnake
>>
>> EnterpriseDB UK: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>>
>
> Thanks,
> Khushboo
>



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

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


Re: [pgAdmin4][RM#3235] Code refactoring in Query tool

2018-04-03 Thread Dave Page
HI

On Tue, Apr 3, 2018 at 12:27 PM, Murtuza Zabuawala <
murtuza.zabuaw...@enterprisedb.com> wrote:

> Hi,
>
> PFA patch to extract the common code from query tool to handle ajax errors
> & connection handling, Also added unit tests around extracted code.
>

Looks good to me, except, I wonder if we should rename
is_new_transaction_required.js/is_new_transaction_required_spec.js to
something a little more generic; maybe conn_tx_handler_funcs.js? Not sure I
like that though.


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

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


Re: [pgAdmin4][RM#3154] Update modules to latest version

2018-04-03 Thread Murtuza Zabuawala
Hi Dave,

Please find updated patches, there are two patches attached one is for the
story and another is for changes required as per new modules.


On Tue, Apr 3, 2018 at 6:27 PM, Dave Page  wrote:

> Hi
>
> On Fri, Mar 30, 2018 at 8:01 AM, Murtuza Zabuawala  enterprisedb.com> wrote:
>
>> Hi,
>>
>> PFA patch to update the modules to latest version.
>>
>>
> - Why isn't jQuery updated to 3.3.1?
>
​Done​


> ​
>
>

> - Shouldn't pkg/pip/setup_pip.py be updated with changes to psycopg2 and
> pycrypto etc?
>
​Done​


>
>
>
>> We are not able to update some of the modules to latest version due to
>> dependancy on other modules, For example
>> - Python: Flask-Security has dependancy on flask-babelex which causes
>> conflict with flask_babel
>>
>
> Hmm, flask-babelex might be a better option anyway; in particular, it
> avoids loading catalogs with every request which seems desirable given the
> size of ours. On the other hand, it hasn't been updated so recently.
>
​I have removed flask-babel and used flask_babelex instead.​


>
>
>> - JS: Can't update to Bootstrap4 because Bootstrap Switch & Bootstrap 
>> Datetime
>> picker has dependancy on Bootstrap3.
>>
>
> OK.
>
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>


RM_3154_v2.diff
Description: Binary data


changes_required_with_RM_3154.diff
Description: Binary data


Re: v3.0 release on hold

2018-04-03 Thread Dave Page
I'm thinking build Monday, release Thursday.

Objections?

On Tue, Apr 3, 2018 at 2:43 PM, Robert Eckhardt 
wrote:

> All,
>
> Where are we with respect to cutting this release?
>
> -- Rob
>
> On Mon, Mar 26, 2018 at 9:59 AM, Joao De Almeida Pereira <
> jdealmeidapere...@pivotal.io> wrote:
>
>> Hi Hackers,
>>
>> Did we had any progress on the things that are holding the release back?
>>
>> Thanks
>> Joao
>>
>> On Fri, Mar 23, 2018 at 9:26 AM Akshay Joshi <
>> akshay.jo...@enterprisedb.com> wrote:
>>
>>> Hi Dave
>>>
>>> On Fri, Mar 23, 2018 at 11:06 AM, Akshay Joshi <
>>> akshay.jo...@enterprisedb.com> wrote:
>>>


 On Thu, Mar 22, 2018 at 10:24 PM, Dave Page  wrote:

> Hi
>
> On Thu, Mar 22, 2018 at 1:13 PM, Dave Page  wrote:
>
>>
>> 2) Starting a second instance of the app bundle on Mac doesn't
>> always open a new pgAdmin window as it should. It works fine in the
>> debugger, or if you start the app with a command like:
>> "/Applications/pgAdmin\ 4.app/Contents/MacOS/pgAdmin4". It
>> doesn't work if you double-click the appbundle or use a command like 
>> "open
>> /Applications/pgAdmin\ 4.app"
>>
>
>   Still working on this, not found any solution yet.
>

>>>  Not able to figure out the solution yet. I have tried to
>>> debug the code, but every time it will create a new instance(tray 
>>> icon). Do
>>> I need to look into the code or something related to app bundle may be 
>>> some
>>> settings in info.plist or any other pointer?
>>>
>>
>> Have a look at the code around line 85 an onwards of pgAdmin4.cpp. It
>> creates the shared memory interlock (and log/address files) based on the
>> current username and a hash of the executable name/path. My suspicion is
>> that the path hash (which is calculated from argv[0] on line 72) is for
>> some reason getting a different value each time when launched via the
>> Finder or "open", thus the interlock is failing.
>>
>
> So I took a look at this, and it seems the code is just fine. What is
> happening is that macOS only allows a single instance of an app to run at
> once. Whilst that is what we want of course, macOS is causing the new
> instance to exit before it has a change to open a new pgAdmin window. 
> Using
> "open -n ..." or calling the embedded executable directly resolves that
> issue.
>
> So, there's another challenge to figure out... :-(
>

 OK. Will try to figure that out.

>>>
>>> After googled I have tried following solution:
>>>
>>>1. Create a shell script "launch.sh" and kept it in  
>>> "/Applications/pgAdmin\
>>>4.app/Contents/MacOS" folder. That shell script will contain the command
>>>"open -n /Applications/pgAdmin\ 4.app/Contents/MacOS/pgAdmin4".
>>>Change the "CFBundleExecutable" parameter of Info.plist from "pgAdmin4" 
>>> to
>>>"launch.sh".  It didn't work, shall script didn't launch.
>>>2. Create one apple script with command like "do shell execute 
>>> "/Applications/pgAdmin\
>>>4.app", compile it and save it as Application. It create the app bundle,
>>>copy contents of pgAdmin4 app to this newly created application. But the
>>>problem is it opens and having icon in the dock and no response on double
>>>click (second time).
>>>
>>>Will continue to figure out some other solutions tomorrow.
>>>

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



 --
 *Akshay Joshi*

 *Sr. Software Architect *



 *Phone: +91 20-3058-9517 <+91%2020%203058%209517>Mobile: +91
 976-788-8246 <+91%2097678%2088246>*

>>>
>>>
>>>
>>> --
>>> *Akshay Joshi*
>>>
>>> *Sr. Software Architect *
>>>
>>>
>>>
>>> *Phone: +91 20-3058-9517 <+91%2020%203058%209517>Mobile: +91
>>> 976-788-8246 <+91%2097678%2088246>*
>>>
>>
>


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

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


Re: v3.0 release on hold

2018-04-03 Thread Robert Eckhardt
On Tue, Apr 3, 2018 at 11:04 AM, Dave Page  wrote:

> I'm thinking build Monday, release Thursday.
>
> Objections?
>

It we can make it happen faster I'd be all for it. If not that will work.
Thanks

-- Rob


>
>
> On Tue, Apr 3, 2018 at 2:43 PM, Robert Eckhardt 
> wrote:
>
>> All,
>>
>> Where are we with respect to cutting this release?
>>
>> -- Rob
>>
>> On Mon, Mar 26, 2018 at 9:59 AM, Joao De Almeida Pereira <
>> jdealmeidapere...@pivotal.io> wrote:
>>
>>> Hi Hackers,
>>>
>>> Did we had any progress on the things that are holding the release back?
>>>
>>> Thanks
>>> Joao
>>>
>>> On Fri, Mar 23, 2018 at 9:26 AM Akshay Joshi <
>>> akshay.jo...@enterprisedb.com> wrote:
>>>
 Hi Dave

 On Fri, Mar 23, 2018 at 11:06 AM, Akshay Joshi <
 akshay.jo...@enterprisedb.com> wrote:

>
>
> On Thu, Mar 22, 2018 at 10:24 PM, Dave Page  wrote:
>
>> Hi
>>
>> On Thu, Mar 22, 2018 at 1:13 PM, Dave Page  wrote:
>>
>>>
>>> 2) Starting a second instance of the app bundle on Mac doesn't
>>> always open a new pgAdmin window as it should. It works fine in the
>>> debugger, or if you start the app with a command like:
>>> "/Applications/pgAdmin\ 4.app/Contents/MacOS/pgAdmin4". It
>>> doesn't work if you double-click the appbundle or use a command 
>>> like "open
>>> /Applications/pgAdmin\ 4.app"
>>>
>>
>>   Still working on this, not found any solution yet.
>>
>
  Not able to figure out the solution yet. I have tried to
 debug the code, but every time it will create a new instance(tray 
 icon). Do
 I need to look into the code or something related to app bundle may be 
 some
 settings in info.plist or any other pointer?

>>>
>>> Have a look at the code around line 85 an onwards of pgAdmin4.cpp.
>>> It creates the shared memory interlock (and log/address files) based on 
>>> the
>>> current username and a hash of the executable name/path. My suspicion is
>>> that the path hash (which is calculated from argv[0] on line 72) is for
>>> some reason getting a different value each time when launched via the
>>> Finder or "open", thus the interlock is failing.
>>>
>>
>> So I took a look at this, and it seems the code is just fine. What is
>> happening is that macOS only allows a single instance of an app to run at
>> once. Whilst that is what we want of course, macOS is causing the new
>> instance to exit before it has a change to open a new pgAdmin window. 
>> Using
>> "open -n ..." or calling the embedded executable directly resolves that
>> issue.
>>
>> So, there's another challenge to figure out... :-(
>>
>
> OK. Will try to figure that out.
>

 After googled I have tried following solution:

1. Create a shell script "launch.sh" and kept it in  
 "/Applications/pgAdmin\
4.app/Contents/MacOS" folder. That shell script will contain the command
"open -n /Applications/pgAdmin\ 4.app/Contents/MacOS/pgAdmin4".
Change the "CFBundleExecutable" parameter of Info.plist from "pgAdmin4" 
 to
"launch.sh".  It didn't work, shall script didn't launch.
2. Create one apple script with command like "do shell execute 
 "/Applications/pgAdmin\
4.app", compile it and save it as Application. It create the app bundle,
copy contents of pgAdmin4 app to this newly created application. But the
problem is it opens and having icon in the dock and no response on 
 double
click (second time).

Will continue to figure out some other solutions tomorrow.

>
>> --
>> Dave Page
>> Blog: http://pgsnake.blogspot.com
>> Twitter: @pgsnake
>>
>> EnterpriseDB UK: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>>
>
>
>
> --
> *Akshay Joshi*
>
> *Sr. Software Architect *
>
>
>
> *Phone: +91 20-3058-9517 <+91%2020%203058%209517>Mobile: +91
> 976-788-8246 <+91%2097678%2088246>*
>



 --
 *Akshay Joshi*

 *Sr. Software Architect *



 *Phone: +91 20-3058-9517 <+91%2020%203058%209517>Mobile: +91
 976-788-8246 <+91%2097678%2088246>*

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


Re: [pgAdmin4][RM#3154] Update modules to latest version

2018-04-03 Thread Murtuza Zabuawala
Please hold on my previous patch.

We can't use latest jQuery version as SlickGrid has dependancy on older
version.
I'll send updated patch again.

On Tue, Apr 3, 2018 at 8:20 PM, Murtuza Zabuawala <
murtuza.zabuaw...@enterprisedb.com> wrote:

> Hi Dave,
>
> Please find updated patches, there are two patches attached one is for the
> story and another is for changes required as per new modules.
>
>
> On Tue, Apr 3, 2018 at 6:27 PM, Dave Page  wrote:
>
>> Hi
>>
>> On Fri, Mar 30, 2018 at 8:01 AM, Murtuza Zabuawala <
>> murtuza.zabuaw...@enterprisedb.com> wrote:
>>
>>> Hi,
>>>
>>> PFA patch to update the modules to latest version.
>>>
>>>
>> - Why isn't jQuery updated to 3.3.1?
>>
> ​Done​
>
>
>> ​
>>
>>
>
>> - Shouldn't pkg/pip/setup_pip.py be updated with changes to psycopg2 and
>> pycrypto etc?
>>
> ​Done​
>
>
>>
>>
>>
>>> We are not able to update some of the modules to latest version due to
>>> dependancy on other modules, For example
>>> - Python: Flask-Security has dependancy on flask-babelex which causes
>>> conflict with flask_babel
>>>
>>
>> Hmm, flask-babelex might be a better option anyway; in particular, it
>> avoids loading catalogs with every request which seems desirable given the
>> size of ours. On the other hand, it hasn't been updated so recently.
>>
> ​I have removed flask-babel and used flask_babelex instead.​
>
>
>>
>>
>>> - JS: Can't update to Bootstrap4 because Bootstrap Switch & Bootstrap 
>>> Datetime
>>> picker has dependancy on Bootstrap3.
>>>
>>
>> OK.
>>
>>
>> --
>> Dave Page
>> Blog: http://pgsnake.blogspot.com
>> Twitter: @pgsnake
>>
>> EnterpriseDB UK: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>>
>
>


Re: [pgAdmin4][RM#3155] Allow user to lock the Layout

2018-04-03 Thread Joao De Almeida Pereira
Hi Murtuza,

Everything seems to work, the tests are all green and the linter is fixed.

As we stated in an previous email, the direction we would love the
application to go is a more robust Javascript Front-End that would rely in
the Backend to provide data. Adding more things to templated Javascript
files feels like a step back and something that we will in the future have
to convert into AJAX calls and JSON responses.
As discussed before our idea is to remove all the javascript templated
files.

How hard do you think it would be to do this implementation without using
templates?

Thanks
Victoria & Joao

On Tue, Apr 3, 2018 at 7:57 AM Murtuza Zabuawala <
murtuza.zabuaw...@enterprisedb.com> wrote:

> Hi,
>
> Thanks Joao for reviewing.
>
> PFA updated patch.
>
> On Tue, Apr 3, 2018 at 1:11 AM, Joao De Almeida Pereira <
> jdealmeidapere...@pivotal.io> wrote:
>
>> Hello,
>>
>> On Mon, Apr 2, 2018 at 10:07 AM Murtuza Zabuawala <
>> murtuza.zabuaw...@enterprisedb.com> wrote:
>>
>>>
>>> ​Hello,
>>>
>>> Please find updated patch,
>>>
>>> Now layout will be locked after user updates its preferences, w
>>> e have used ​
>>> templated variable in the javascript file
>>> ​ because we do not have preference module or preference cache available
>>> when the page loads and panels gets rendered,
>>> ​I
>>> ​ also
>>> made changes in JS tests as per Joao's review comments.
>>>
>> Looks like everything is working when we change the lock.
>> As a personal preferences I would prefer to see this in at least 2
>> commits, one that is related to the preference issue and another one that
>> is related to this story.
>>
>>
>> All the tests are working, but he linter is failing:
>>
>> /tmp/build/4a5630c2/pivotal-rm-3155/web /tmp/build/4a5630c2
>>  
>> 
>> ./pgadmin/misc/__init__.py:78: [E303] too many blank lines (2)
>>  
>> 
>> 1   E303 too many blank lines (2)
>>  
>> 
>>
>> 1
>>
> ​Fixed​
>
>
>>
>>
>>> @Dave/Pivotal team,
>>> The given patch is working fine for all the Tabs/Panels (all the panels
>>> from main window as well as from Query tool and Debugger) but I'm facing an
>>> issue while handling the Browser tree section, It is a wcDocer frame
>>>  and not a wcDocker
>>> panel . Like
>>> wcDocker panel, wcDocker frame do not provide any API so that a developer
>>> can prevent drag-drop functionality on it.
>>>
>>> By visiting wcDocker github page  It
>>> looks like it not actively maintained.
>>> What do you suggest how should we tackle this issue?
>>>
>>>
>> I think this should be moved to a different thread, because at this point
>> in time we have 3 of our core libraries that are no longer
>> maintained/supported/under active development that I know out of my head.
>> (ACITree, Backbone and wcDocker). I might even add to the mix jquery 1.11.2
>> because it stopped being actively developed and supported after May 20 of
>> 2016.
>>
> ​Sure, I'll send separate email.​
>
>
>>
>>
>>> For time being, I've created subtask for this issue
>>> https://redmine.postgresql.org/issues/3243
>>>
>>> Thanks,
>>> Murtuza
>>>  ​
>>> On Thu, Mar 29, 2018 at 8:57 PM, Joao De Almeida Pereira <
>>> jdealmeidapere...@pivotal.io> wrote:
>>>
 Hi Murtuza,

 After changing the setting in the preferences nothing happened, we had
 to reset the layout or refresh the app to see it working. It only looks the
 right side. Was this the intended behavior?

 Not sure if this is the expected behavior or not. I would expect that
 any change I do in the preferences would start working after I press the
 Save button. This also happens with other preferences that only take effect
 after refresh on the browser.
 This being said, not sure if having the templated variable in the
 javascript file is the best approach in this case.

 Do you think you can remove the requirejs tags on the tests?

 At the testing file you do not need to create 3 different variables for
 the panels, you can reuse it, because the beforeEach will run for every 
 test

 Thanks
 Joao

 On Thu, Mar 29, 2018 at 9:48 AM Dave Page  wrote:

> Hi
>
> On Thu, Mar 29, 2018 at 2:15 PM, Murtuza Zabuawala <
> murtuza.zabuaw...@enterprisedb.com> wrote:
>
>> Hi,
>>
>> PFA patch which will allow user to lock the panels and it will not
>> allow user to drag & drop them.
>>
>
> Tests pass, but when I lock the

Re: [pgAdmin4][RM#3155] Allow user to lock the Layout

2018-04-03 Thread Dave Page
Hi

On Tue, Apr 3, 2018 at 12:56 PM, Murtuza Zabuawala <
murtuza.zabuaw...@enterprisedb.com> wrote:

> Hi,
>
> Thanks Joao for reviewing.
>
> PFA updated patch.
>
> On Tue, Apr 3, 2018 at 1:11 AM, Joao De Almeida Pereira <
> jdealmeidapere...@pivotal.io> wrote:
>
>> Hello,
>>
>> On Mon, Apr 2, 2018 at 10:07 AM Murtuza Zabuawala <
>> murtuza.zabuaw...@enterprisedb.com> wrote:
>>
>>>
>>> ​Hello,
>>>
>>> Please find updated patch,
>>>
>>> Now layout will be locked after user updates its preferences, w
>>> e have used ​
>>> templated variable in the javascript file
>>> ​ because we do not have preference module or preference cache available
>>> when the page loads and panels gets rendered,
>>> ​I
>>> ​ also
>>> made changes in JS tests as per Joao's review comments.
>>>
>> Looks like everything is working when we change the lock.
>> As a personal preferences I would prefer to see this in at least 2
>> commits, one that is related to the preference issue and another one that
>> is related to this story.
>>
>>
>> All the tests are working, but he linter is failing:
>>
>> /tmp/build/4a5630c2/pivotal-rm-3155/web /tmp/build/4a5630c2
>>  
>> 
>> ./pgadmin/misc/__init__.py:78: [E303] too many blank lines (2)
>>  
>> 
>> 1   E303 too many blank lines (2)
>>  
>> 
>>
>> 1
>>
> ​Fixed​
>
>
>>
>>
>>> @Dave/Pivotal team,
>>> The given patch is working fine for all the Tabs/Panels (all the panels
>>> from main window as well as from Query tool and Debugger) but I'm facing an
>>> issue while handling the Browser tree section, It is a wcDocer frame
>>>  and not a wcDocker
>>> panel . Like
>>> wcDocker panel, wcDocker frame do not provide any API so that a developer
>>> can prevent drag-drop functionality on it.
>>>
>>
It's not working fine for me. For example, if I put the SQL Panel on it's
own below the properties/stats panels (so it looks like pgAdmin 3 used to
by default), and then lock the layout, I can un-dock the SQL panel into a
dialogue, but then cannot re-dock it. I can do weird things with the
browser tree as well, probably because it's a frame as you say.


>
>>> By visiting wcDocker github page  It
>>> looks like it not actively maintained.
>>> What do you suggest how should we tackle this issue?
>>>
>>
It may not have been updated recently, but the lead developer answered your
questions pretty quickly. Maybe he'll be open to a pull request if we can
figure out how to lock the layout of the frame as well.


>
>>>
>> I think this should be moved to a different thread, because at this point
>> in time we have 3 of our core libraries that are no longer
>> maintained/supported/under active development that I know out of my head.
>> (ACITree, Backbone and wcDocker). I might even add to the mix jquery 1.11.2
>> because it stopped being actively developed and supported after May 20 of
>> 2016.
>>
> ​Sure, I'll send separate email.​
>
>
>>
>>
>>> For time being, I've created subtask for this issue
>>> https://redmine.postgresql.org/issues/3243
>>>
>>> Thanks,
>>> Murtuza
>>>  ​
>>> On Thu, Mar 29, 2018 at 8:57 PM, Joao De Almeida Pereira <
>>> jdealmeidapere...@pivotal.io> wrote:
>>>
 Hi Murtuza,

 After changing the setting in the preferences nothing happened, we had
 to reset the layout or refresh the app to see it working. It only looks the
 right side. Was this the intended behavior?

 Not sure if this is the expected behavior or not. I would expect that
 any change I do in the preferences would start working after I press the
 Save button. This also happens with other preferences that only take effect
 after refresh on the browser.
 This being said, not sure if having the templated variable in the
 javascript file is the best approach in this case.

 Do you think you can remove the requirejs tags on the tests?

 At the testing file you do not need to create 3 different variables for
 the panels, you can reuse it, because the beforeEach will run for every 
 test

 Thanks
 Joao

 On Thu, Mar 29, 2018 at 9:48 AM Dave Page  wrote:

> Hi
>
> On Thu, Mar 29, 2018 at 2:15 PM, Murtuza Zabuawala <
> murtuza.zabuaw...@enterprisedb.com> wrote:
>
>> Hi,
>>
>> PFA patch which will allow user to lock the panels and it will not
>> allow user to drag & drop them.
>>
>
> Tests pass, but when I lock the layout, I can still drag panels 

Re: [pgAdmin4][RM#3235] Code refactoring in Query tool

2018-04-03 Thread Murtuza Zabuawala
Hi Dave,

PFA updated patch, I've renamed it to query_tool_http_error_handler.js
& query_tool_http_error_handler_spec.js respectively.

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


On Tue, Apr 3, 2018 at 7:43 PM, Dave Page  wrote:

> HI
>
> On Tue, Apr 3, 2018 at 12:27 PM, Murtuza Zabuawala  enterprisedb.com> wrote:
>
>> Hi,
>>
>> PFA patch to extract the common code from query tool to handle ajax
>> errors & connection handling, Also added unit tests around extracted code.
>>
>
> Looks good to me, except, I wonder if we should rename
> is_new_transaction_required.js/is_new_transaction_required_spec.js to
> something a little more generic; maybe conn_tx_handler_funcs.js? Not sure I
> like that though.
>
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>


RM_3235_v1.diff
Description: Binary data


Re: [pgAdmin4][RM#3154] Update modules to latest version

2018-04-03 Thread Murtuza Zabuawala
​Hi Dave,

Reverted back jQuery version to 1.x because of SlickGrid dependancy.
Please find updated patch.

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


On Tue, Apr 3, 2018 at 8:50 PM, Murtuza Zabuawala <
murtuza.zabuaw...@enterprisedb.com> wrote:

> Please hold on my previous patch.
>
> We can't use latest jQuery version as SlickGrid has dependancy on older
> version.
> I'll send updated patch again.
>
> On Tue, Apr 3, 2018 at 8:20 PM, Murtuza Zabuawala  enterprisedb.com> wrote:
>
>> Hi Dave,
>>
>> Please find updated patches, there are two patches attached one is for
>> the story and another is for changes required as per new modules.
>>
>>
>> On Tue, Apr 3, 2018 at 6:27 PM, Dave Page  wrote:
>>
>>> Hi
>>>
>>> On Fri, Mar 30, 2018 at 8:01 AM, Murtuza Zabuawala <
>>> murtuza.zabuaw...@enterprisedb.com> wrote:
>>>
 Hi,

 PFA patch to update the modules to latest version.


>>> - Why isn't jQuery updated to 3.3.1?
>>>
>> ​Done​
>>
>>
>>> ​
>>>
>>>
>>
>>> - Shouldn't pkg/pip/setup_pip.py be updated with changes to psycopg2 and
>>> pycrypto etc?
>>>
>> ​Done​
>>
>>
>>>
>>>
>>>
 We are not able to update some of the modules to latest version due to
 dependancy on other modules, For example
 - Python: Flask-Security has dependancy on flask-babelex which causes
 conflict with flask_babel

>>>
>>> Hmm, flask-babelex might be a better option anyway; in particular, it
>>> avoids loading catalogs with every request which seems desirable given the
>>> size of ours. On the other hand, it hasn't been updated so recently.
>>>
>> ​I have removed flask-babel and used flask_babelex instead.​
>>
>>
>>>
>>>
 - JS: Can't update to Bootstrap4 because Bootstrap Switch & Bootstrap 
 Datetime
 picker has dependancy on Bootstrap3.

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


changes_required_with_RM_3154.diff
Description: Binary data


RM_3154_v3.diff
Description: Binary data


Re: [pgAdmin4][RM#3235] Code refactoring in Query tool

2018-04-03 Thread Joao De Almeida Pereira
Hi Murtuza

It is really good to see other patches that are just refactoring code.

We have some suggestions:
- We are trying to use === instead of == because === ensure that the type
is also checked (
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Equality_comparisons_and_sameness
)
- Now that we are refactoring some code, maybe we should keep some
consistency on the way we name functions and variables.
We should use camelCase for names instead of snake_case. In general, if you
see a function or variable name that doesn't fit the desired syntax or if a
block of code seems confusing, it is better to refactor it.
- By the name of the function is_new_transaction_required, it describes
what the function represents but doesn't seem to explain the full scope of
the function. What do you think about the name:
httpResponseRequiresNewTransaction
- The extraction doesn't look like it matches the code removed

-if (pgAdmin.Browser.UserManagement.is_pga_login_required(e)) {
-  self.save_state('_explain_timing', []);
-  return pgAdmin.Browser.UserManagement.pga_login();
-}
-
-if(transaction.is_new_transaction_required(e)) {
-  self.save_state('_explain_timing', []);
-  return self.init_transaction();
-}
-
-alertify.alert(gettext('Explain options error'),
-  gettext('Error occurred while setting timing option in
explain.')
+let msg = httpErrorHandler.handleQueryToolAjaxError(
+  pgAdmin, self, e, '_explain_timing', null, true
 );
+alertify.alert(gettext('Explain options error'), msg);
In this case we are only saving state if the following conditions are true:
isNotConnectedToThePythonServer and httpResponseJSONIsPresent and
connectionLostToPostgresDatabase and shouldSaveState
That is not the case on the removed code.
- The functions extracted when are called do not use all the parameters.
This tells us that the function groups too much functionality that is not
used in same cases. Maybe we should split this function into smaller
functions that do each part.


Thanks
Victoria & Joao

On Tue, Apr 3, 2018 at 11:38 AM Murtuza Zabuawala <
murtuza.zabuaw...@enterprisedb.com> wrote:

> Hi Dave,
>
> PFA updated patch, I've renamed it to query_tool_http_error_handler.js
> & query_tool_http_error_handler_spec.js respectively.
>
> --
> Regards,
> Murtuza Zabuawala
> EnterpriseDB: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
>
> On Tue, Apr 3, 2018 at 7:43 PM, Dave Page  wrote:
>
>> HI
>>
>> On Tue, Apr 3, 2018 at 12:27 PM, Murtuza Zabuawala <
>> murtuza.zabuaw...@enterprisedb.com> wrote:
>>
>>> Hi,
>>>
>>> PFA patch to extract the common code from query tool to handle ajax
>>> errors & connection handling, Also added unit tests around extracted code.
>>>
>>
>> Looks good to me, except, I wonder if we should rename
>> is_new_transaction_required.js/is_new_transaction_required_spec.js to
>> something a little more generic; maybe conn_tx_handler_funcs.js? Not sure I
>> like that though.
>>
>>
>> --
>> Dave Page
>> Blog: http://pgsnake.blogspot.com
>> Twitter: @pgsnake
>>
>> EnterpriseDB UK: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>>
>
>


Re: [pgAdmin4][RM#3154] Update modules to latest version

2018-04-03 Thread Joao De Almeida Pereira
Hi Murtuza,

The patches look good and they pass all tests in CI.
One think that we realized was the SlickGrid as a npm package now:
https://www.npmjs.com/package/slickgrid
Also Slickgrid comes packaged with jquery 3.1 not sure if it is fully
supported or not..

Thanks
Victoria & Joao

On Tue, Apr 3, 2018 at 11:50 AM Murtuza Zabuawala <
murtuza.zabuaw...@enterprisedb.com> wrote:

> ​Hi Dave,
>
> Reverted back jQuery version to 1.x because of SlickGrid dependancy.
> Please find updated patch.
>
> --
> Regards,
> Murtuza Zabuawala
> EnterpriseDB: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
>
> On Tue, Apr 3, 2018 at 8:50 PM, Murtuza Zabuawala <
> murtuza.zabuaw...@enterprisedb.com> wrote:
>
>> Please hold on my previous patch.
>>
>> We can't use latest jQuery version as SlickGrid has dependancy on older
>> version.
>> I'll send updated patch again.
>>
>> On Tue, Apr 3, 2018 at 8:20 PM, Murtuza Zabuawala <
>> murtuza.zabuaw...@enterprisedb.com> wrote:
>>
>>> Hi Dave,
>>>
>>> Please find updated patches, there are two patches attached one is for
>>> the story and another is for changes required as per new modules.
>>>
>>>
>>> On Tue, Apr 3, 2018 at 6:27 PM, Dave Page  wrote:
>>>
 Hi

 On Fri, Mar 30, 2018 at 8:01 AM, Murtuza Zabuawala <
 murtuza.zabuaw...@enterprisedb.com> wrote:

> Hi,
>
> PFA patch to update the modules to latest version.
>
>
 - Why isn't jQuery updated to 3.3.1?

>>> ​Done​
>>>
>>>
 ​


>>>
 - Shouldn't pkg/pip/setup_pip.py be updated with changes to psycopg2
 and pycrypto etc?

>>> ​Done​
>>>
>>>



> We are not able to update some of the modules to latest version due to
> dependancy on other modules, For example
> - Python: Flask-Security has dependancy on flask-babelex which causes
> conflict with flask_babel
>

 Hmm, flask-babelex might be a better option anyway; in particular, it
 avoids loading catalogs with every request which seems desirable given the
 size of ours. On the other hand, it hasn't been updated so recently.

>>> ​I have removed flask-babel and used flask_babelex instead.​
>>>
>>>


> - JS: Can't update to Bootstrap4 because Bootstrap Switch & Bootstrap 
> Datetime
> picker has dependancy on Bootstrap3.
>

 OK.


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

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

>>>
>>>
>>
>


Re: pgAdmin4 - Issue of unmaintained libraries

2018-04-03 Thread Joao De Almeida Pereira
Hi Dave,

On Tue, Apr 3, 2018 at 8:32 AM Dave Page  wrote:

> Hi
>
> On Tue, Apr 3, 2018 at 1:22 PM, Murtuza Zabuawala <
> murtuza.zabuaw...@enterprisedb.com> wrote:
>
>> Hi Team,
>>
>> As we are heavily dependent on 3rd party JS libraries and some of them
>> are no longer actively maintained by their respective authors (Last commit
>> was approximate year ago).
>>
>> Some of the core libraries which are no longer actively maintained are,
>> - Backbone 
>> - wcDocker 
>> - aciTree 
>> - Backgrid /Backform
>> - jQuery 1.x 
>> version
>>
>> What would be our future plans when it comes to fixing the issues in the
>> core libraries or adding new feature?
>> (Ref: Email thread
>> 
>> )
>>
>
> Well jQuery can be updated can't it?
>
> wcDocker is, as far as I'm aware, the only library of it's kind. Unless
> something else has surpassed it in the last couple of years, there's
> nothing even close in functionality to it. aciTree was in a similar
> position, though Joao and team think there may be other candidates now.
>

About the wcDocker, in fact it as a lot of features. In our User Interviews
we didn't find any person that was using features like dragging and
creating new panels. The only feature that we see people using was the
tabs. So if the only feature that people use of wcDocker is really tabs
there are some other libraries like:
react-tabs or react-tabtab (Draggable tabs) or rc-tabs(Static tabs, with
52k Downloads last 7 days).

For ACITree we already started the process of isolating it from the
application, This will allow us in the future to replace it with something
that is more up to date.


> As for Backbone/Backgrid/Backform, I don't know. Backbone could maybe be
> replaced with React eventually. Not sure about the others.
>
> In any case, this is likely to be a problem on an ongoing basis - and I
> think we need to consider the future on a case by case basis when
> necessary. It may mean moving to a different library, or it may mean
> forking components, or it may be the upstream may have not had any commits
> for a long time simply because there is no development happening right now,
> but bugs may still be fixed.
>
>
We understand and agree that this should be handled case-by-case instead of
replacing everything at once since it is not feasible to do a complete
rewrite of the application.  But we also think it's hard to build new
features on top of libraries that are no longer supported.  We don't really
want to fork a library either because we'll become responsible for
maintaining that library, which means maintaining more code.  We want to
use libraries that are actively maintained so we can get security patches,
new features, etc.  Also, if we need a new functionality on a specific
library, we can, for example, open an issue and the maintainers of that
library can implement it for us or we can create a pull request for them to
merge.

Thanks,

Victoria & Joao


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