Re: Build failed in Jenkins: pgadmin4-master-python34 #440

2018-01-22 Thread Surinder Kumar
Yes, I will look.

Thanks,
Surinder

On Mon, Jan 22, 2018 at 4:25 PM, Dave Page  wrote:

> Hi Surinder,
>
> It seems that updating ESLint exposed various issues. Can you take a
> look ASAP please?
>
> Thanks.
>
>
> -- Forwarded message --
> From: pgAdmin 4 Jenkins 
> Date: Mon, Jan 22, 2018 at 10:53 AM
> Subject: Build failed in Jenkins: pgadmin4-master-python34 #440
> To: pgadmin-hack...@postgresql.org, dp...@pgadmin.org
>
>
> See  440/display/redirect?page=changes>
>
> Changes:
>
> [Dave Page] Update ESLint requirement to support --fix-dry-run
>
> [Dave Page] Ensure clickable images/buttons have appropriate tooltips for
> screen
>
> --
> [...truncated 401.64 KB...]
>   228:1   error  Expected indentation of 20 spaces but found 22  indent
>   229:1   error  Expected indentation of 22 spaces but found 24  indent
>   230:1   error  Expected indentation of 22 spaces but found 24  indent
>   231:1   error  Expected indentation of 22 spaces but found 24  indent
>   232:1   error  Expected indentation of 20 spaces but found 22  indent
>   233:1   error  Expected indentation of 18 spaces but found 20  indent
>   236:1   error  Expected indentation of 20 spaces but found 22  indent
>   237:1   error  Expected indentation of 22 spaces but found 24  indent
>   238:1   error  Expected indentation of 22 spaces but found 24  indent
>   239:1   error  Expected indentation of 22 spaces but found 24  indent
>   240:1   error  Expected indentation of 20 spaces but found 22  indent
>   543:1   error  Expected indentation of 14 spaces but found 12  indent
>   544:1   error  Expected indentation of 16 spaces but found 14  indent
>   546:1   error  Expected indentation of 16 spaces but found 14  indent
>   547:1   error  Expected indentation of 18 spaces but found 16  indent
>   548:1   error  Expected indentation of 18 spaces but found 16  indent
>   549:1   error  Expected indentation of 16 spaces but found 14  indent
>   551:1   error  Expected indentation of 16 spaces but found 14  indent
>   552:1   error  Expected indentation of 14 spaces but found 12  indent
>   553:1   error  Expected indentation of 14 spaces but found 12  indent
>   554:1   error  Expected indentation of 16 spaces but found 14  indent
>   556:1   error  Expected indentation of 16 spaces but found 14  indent
>   557:1   error  Expected indentation of 18 spaces but found 16  indent
>   558:1   error  Expected indentation of 18 spaces but found 16  indent
>   559:1   error  Expected indentation of 16 spaces but found 14  indent
>   561:1   error  Expected indentation of 16 spaces but found 14  indent
>   562:1   error  Expected indentation of 14 spaces but found 12  indent
>   593:1   error  Expected indentation of 14 spaces but found 12  indent
>   594:1   error  Expected indentation of 16 spaces but found 14  indent
>   596:1   error  Expected indentation of 16 spaces but found 14  indent
>   597:1   error  Expected indentation of 18 spaces but found 16  indent
>   598:1   error  Expected indentation of 18 spaces but found 16  indent
>   599:1   error  Expected indentation of 16 spaces but found 14  indent
>   601:1   error  Expected indentation of 16 spaces but found 14  indent
>   602:1   error  Expected indentation of 14 spaces but found 12  indent
>   603:1   error  Expected indentation of 14 spaces but found 12  indent
>   604:1   error  Expected indentation of 16 spaces but found 14  indent
>   606:1   error  Expected indentation of 16 spaces but found 14  indent
>   607:1   error  Expected indentation of 18 spaces but found 16  indent
>   608:1   error  Expected indentation of 18 spaces but found 16  indent
>   609:1   error  Expected indentation of 16 spaces but found 14  indent
>   611:1   error  Expected indentation of 16 spaces but found 14  indent
>   612:1   error  Expected indentation of 14 spaces but found 12  indent
>   778:43  error  Unnecessary escape character: \.
> no-useless-escape
>
>  ws/web/pgadmin/browser/static/js/error.js>
>2:1  error  Expected indentation of 2 spaces but found 4   indent
>3:1  error  Expected indentation of 2 spaces but found 0   indent
>4:1  error  Expected indentation of 4 spaces but found 2   indent
>6:1  error  Expected indentation of 4 spaces but found 2   indent
>7:1  error  Expected indentation of 6 spaces but found 4   indent
>8:1  error  Expected indentation of 8 spaces but found 6   indent
>   21:1  error  Expected indentation of 8 spaces but found 6   indent
>   22:1  error  Expected indentation of 10 spaces but found 8  indent
>   34:1  error  Expected indentation of 8 spaces but found 6   indent
>   36:1  error  Expected indentation of 8 spaces but found 6   indent
>   37:1  error  Expected indentation of 8 spaces but found 6   indent
>   38:1  error  

[pgAdmin4][Patch]: Update ESLint to latest version

2018-01-16 Thread Surinder Kumar
Hi

In the current version of ESLint the option "--fix-dry-run" not working.
So, updating to the latest one resolve this.

Please find an attached patch.

Thanks,
Surinder


update_eslint_to_latest.patch
Description: Binary data


Re: Next release

2017-11-17 Thread Surinder Kumar
243, in upgrade
>>> return script._upgrade_revs(revision, rev)
>>>   File 
>>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/alembic/script/base.py",
>>> line 338, in _upgrade_revs
>>> for script in reversed(list(revs))
>>>   File 
>>> "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/contextlib.py",
>>> line 35, in __exit__
>>> self.gen.throw(type, value, traceback)
>>>   File 
>>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/alembic/script/base.py",
>>> line 174, in _catch_revision_errors
>>> compat.raise_from_cause(util.CommandError(resolution))
>>>   File 
>>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/alembic/util/compat.py",
>>> line 205, in raise_from_cause
>>> reraise(type(exception), exception, tb=exc_tb)
>>>   File 
>>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/alembic/script/base.py",
>>> line 143, in _catch_revision_errors
>>> yield
>>>   File 
>>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/alembic/script/base.py",
>>> line 334, in _upgrade_revs
>>> revs = list(revs)
>>>   File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packa
>>> ges/alembic/script/revision.py", line 645, in _iterate_revisions
>>> requested_lowers = self.get_revisions(lower)
>>>   File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packa
>>> ges/alembic/script/revision.py", line 299, in get_revisions
>>> return sum([self.get_revisions(id_elem) for id_elem in id_], ())
>>>   File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packa
>>> ges/alembic/script/revision.py", line 304, in get_revisions
>>> for rev_id in resolved_id)
>>>   File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packa
>>> ges/alembic/script/revision.py", line 304, in 
>>> for rev_id in resolved_id)
>>>   File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packa
>>> ges/alembic/script/revision.py", line 362, in _revision_for_ident
>>> resolved_id)
>>> alembic.util.exc.CommandError: Can't locate revision identified by
>>> '02b9dccdcfcb'
>>>
>>>
>>>>
>>>>
>>>>>
>>>>> --
>>>>> *Harshal Dhumal*
>>>>> *Sr. Software Engineer*
>>>>>
>>>>> EnterpriseDB India: http://www.enterprisedb.com
>>>>> The Enterprise PostgreSQL Company
>>>>>
>>>>> On Fri, Aug 25, 2017 at 1:48 PM, Dave Page <dp...@pgadmin.org> wrote:
>>>>>
>>>>>>
>>>>>>
>>>>>> On Fri, Aug 25, 2017 at 9:15 AM, Surinder Kumar <
>>>>>> surinder.ku...@enterprisedb.com> wrote:
>>>>>>
>>>>>>> ​Hi​
>>>>>>>
>>>>>>> On Fri, Aug 25, 2017 at 12:21 PM, Ashesh Vashi <
>>>>>>> ashesh.va...@enterprisedb.com> wrote:
>>>>>>>
>>>>>>>> On Fri, Aug 25, 2017 at 12:16 PM, Surinder Kumar <
>>>>>>>> surinder.ku...@enterprisedb.com> wrote:
>>>>>>>>
>>>>>>>>> Hi
>>>>>>>>> On Fri, Aug 25, 2017 at 1:03 AM, Dave Page <dp...@pgadmin.org>
>>>>>>>>> wrote:
>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> On Thu, Aug 24, 2017 at 8:28 PM, Harshal Dhumal <
>>>>>>>>>> harshal.dhu...@enterprisedb.com> wrote:
>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> --
>>>>>>>>>>> *Harshal Dhumal*
>>>>>>>>>>> *Sr. Software Engineer*
>>>>>>>>>>>
>>>>>>>>>>> EnterpriseDB India: http://www.enterprisedb.com
>>>>>>>>>>> The Enterprise PostgreSQL Company
>>>>>>>>>>>
>>>>>>>>>>> On Thu, Aug 24, 2017 at 9:44 PM, Dave Page <dp...@pgadmin.org>
>>>>>>>>>>> wrote:
>>>>>>>

Re: pgAdmin4 never loading

2017-10-09 Thread Surinder Kumar
Hi Pavel,

If you are building pgAdmin4 from the source, then you don't need to
install pgAdmin4 from the wheel.

After taking the pgAdmin4 source from git HEAD, you need to install nodeJS,
Yarn to build JS/CSS modules. the error you are getting is possibly due to
this. For more help, you can follow the steps documented here


It seems QtWekbit compilation went well. so just run pgAdmin4. it should
work.

Also, can you share logs generated at location '/var/log/pgadmin4/pgadmin4.log'
?

Thanks,
Surinder


On Mon, Oct 9, 2017 at 1:10 PM, Dave Page  wrote:

> Surinder, can you help out with this please?
>
> On Fri, Oct 6, 2017 at 9:00 PM, Pavel Klimenko  wrote:
>
>> Hi.
>> I'm get last sources from git.
>> Make runtime application, create virtualenv as  "virtualenv pga4venv"
>> do:
>> source pga4venv/bin/activate
>> pip install -r ../requirements.txt
>> pip install backports.weakref # not run with out it
>> pip install https://ftp.postgresql.org/pub/pgadmin/pgadmin4/v2.0/pip/pga
>> dmin4-2.0-py2.py3-none-any.whl
>> export PYTHONPATH=/pgadmin4/runtime/pga4ven
>> v/lib/python2.7/site-packages/te-packages/
>> make app with QT5:
>> /opt/Qt/5.5/gcc_64/bin/qmake CONFIG+=release
>> do make
>> and run it.
>> App run byt I'm see only "Loading pgAdmin 4 v2.0..."
>> and it's never load.
>> How to fix it?
>>
>> My pip freeze in attachment.
>>
>> $uname -a
>> Linux lptp 4.13.0-12-generic #13-Ubuntu SMP Sat Sep 23 03:40:16 UTC 2017
>> x86_64 x86_64 x86_64 GNU/Linux
>>
>> $cat /etc/os-release
>> NAME="Ubuntu"
>> VERSION="17.10 (Artful Aardvark)"
>> ID=ubuntu
>> ID_LIKE=debian
>> PRETTY_NAME="Ubuntu Artful Aardvark (development branch)"
>> VERSION_ID="17.10"
>>
>>
>
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>


[pgAdmin4][Patch]: Fix the path to font-mfizz library in style.css

2017-09-28 Thread Surinder Kumar
Hi

*Issue:*
Webpacking the code fails due to the wrong path of "font-mfizz" library.
[Reported by: Neel Patel]

Please find an attached patch.

Thanks,
Surinder


fix_font_mfizz_library_path.patch
Description: Binary data


Re: v2.0-rc1 not starting, runtime not building

2017-09-21 Thread Surinder Kumar
Please send email to pgadmin-hackers mailing list not personally

On Sep 21, 2017 9:38 PM, "Willy-Bas Loos" <willy...@gmail.com> wrote:

Hi,

I've tried your instructions but no success.
I added a full log of my actions.
Only i couldn't find the package opengl-dev
Could it be named libqt5opengl5-dev:amd64 ? If so then it is installed.

It would be great if we can get the runtime working.
please see the attached log.

cheers,

Willy-Bas


On Fri, Sep 15, 2017 at 6:11 PM, Willy-Bas Loos <willy...@gmail.com> wrote:

>
>
> On Fri, Sep 15, 2017 at 4:19 PM, Surinder Kumar <
> surinder.ku...@enterprisedb.com> wrote:
>
>>
>> From the logs you sent, It seems there is some issue in Qt setup.
>>
>
> It's a fresh install especially for this pupose.
> The installation was a no brainer with a gui, just fill in the path and
> next, next. No errors.
>
>
>> Here is the step by step instructions
>> <https://imsurinder90.github.io/posts/setup_pgAdmin4_in_desktop_mode> I
>> had documented to setup pgAdmin4 in desktop mode on Ubuntu.
>>
>
> That looks good, i'll try it and let you know.
> thanks!
>
> You also need to setup virtual environment as well.
>>
>> I did.
>
>
> --
> Willy-Bas Loos
>



-- 
Willy-Bas Loos


Re: v2.0 RC2 test builds

2017-09-19 Thread Surinder Kumar
​Hi​

On Tue, Sep 19, 2017 at 4:29 PM, Dave Page <dp...@pgadmin.org> wrote:

> Is this accurate?
>
> https://www.pgadmin.org/faq/#9
>
​Yes​


>
>
> On Tue, Sep 19, 2017 at 10:58 AM, Dave Page <dp...@pgadmin.org> wrote:
>
>>
>>
>> On Tue, Sep 19, 2017 at 10:21 AM, Surinder Kumar <
>> surinder.ku...@enterprisedb.com> wrote:
>>
>>> Hi
>>> On Tue, Sep 19, 2017 at 1:51 PM, Dave Page <dp...@pgadmin.org> wrote:
>>>
>>>> I assume that's the same as:
>>>>
>>>> Allow apps downloaded from:
>>>>
>>>>  [ ] App Store
>>>>  [x] Apps Store and identified developers
>>>>
>>> ​I see the same settings with second options ticked in my machine. but
>>> the error message "pgAdmin4 is damaged and can't be opened. You should
>>> eject the disk image" doesn't gives the clue to user to tick the settings
>>> "Allow apps downloaded from: anywhere".
>>>
>>> Can this message be changed or it is system defined?
>>>
>>
>> It's system defined :-(.
>>
>>
>>
>>>
>>>
>>>> In later releases of macOS?
>>>>
>>>>
>>>> On Tue, Sep 19, 2017 at 8:12 AM, Surinder Kumar <
>>>> surinder.ku...@enterprisedb.com> wrote:
>>>>
>>>>> Hi Fahar,
>>>>>
>>>>> It gets installed successfully when I checked the option "Allow apps
>>>>> downloaded from" to "Anywhere" in Security & Privacy option.
>>>>> However, If I install another downloaded app, It asks the user to
>>>>> enable the install for this app by going to Security & Privacy option.
>>>>>
>>>>> Thanks to Khushboo for help.
>>>>>
>>>>> On Tue, Sep 19, 2017 at 11:36 AM, Fahar Abbas <
>>>>> fahar.ab...@enterprisedb.com> wrote:
>>>>>
>>>>>> Hi Surinder,
>>>>>>
>>>>>> I tested pgAdmin4 Build on MAC 10.10 and i don't see any issue
>>>>>> related to this.
>>>>>>
>>>>>> Steps:
>>>>>> 1. Downloaded MAC OS Build on 10.12 Firefox Browser and then scp on
>>>>>> MAC 10.10 fresh VM.
>>>>>>
>>>>>> Note: pgAdmin4 will not work on MAC 10.9 and we have already dropped
>>>>>> this support.
>>>>>>
>>>>>> Can you please share the exact steps so it could reproduce on my
>>>>>> fresh VM?
>>>>>>
>>>>>> Kind Regards,
>>>>>>
>>>>>>
>>>>>> On Tue, Sep 19, 2017 at 10:45 AM, Surinder Kumar <
>>>>>> surinder.ku...@enterprisedb.com> wrote:
>>>>>>
>>>>>>> Hi
>>>>>>>
>>>>>>> Today I downloaded the pgAdmin4 build(pgadmin4-2.0-rc2.dmg
>>>>>>> <https://developer.pgadmin.org/~dpage/2.0-rc2/pgadmin4-2.0-rc2.dmg>)
>>>>>>> for Mac but it is failed to open. When I double click on pgAdmin4 icon 
>>>>>>> to
>>>>>>> open pgAdmin4, I got an error, please refer the screenshot attached.
>>>>>>>
>>>>>>> *OS details:*
>>>>>>>
>>>>>>> Mac OS X Yosemite
>>>>>>> Version 10.10.2
>>>>>>>
>>>>>>> Even on Akshay's machine pgAdmin4 doesn't open
>>>>>>>
>>>>>>> *OS details:*
>>>>>>>
>>>>>>> Mac OS X Mavericks
>>>>>>> Version 10.09.05
>>>>>>>
>>>>>>> *Error:*
>>>>>>>
>>>>>>> The application server couldn't be contacted.
>>>>>>>
>>>>>>> @Fahar, Can you please verify If you got same error?
>>>>>>>
>>>>>>> Thanks,
>>>>>>> Surinder
>>>>>>>
>>>>>>>
>>>>>>> On Tue, Sep 19, 2017 at 1:27 AM, Anthony DeBarros <
>>>>>>> adebar...@gmail.com> wrote:
>>>>>>>
>>>>>>>> No show-stoppers to report. Just to say that it looks great and
>>>>>>>> loads fast. Nice work!
>>>>>>>>
>>>>>>>> Only stylistic item is that the column names in the result grid
>>>>>>>> used to be bold but are now the same weight as the data type.
>>>>>>>>
>>>>>>>> Anthony
>>>>>>>>
>>>>>>>>
>>>>>>>> On September 18, 2017 at 12:13:03 PM, Dave Page (dp...@pgadmin.org)
>>>>>>>> wrote:
>>>>>>>>
>>>>>>>> I've put v2.0-rc2 test builds at https://developer.pgadmin.o
>>>>>>>> rg/~dpage/2.0-rc2/ for anyone who needs them. Please report any
>>>>>>>> show-stopper issues ASAP!
>>>>>>>>
>>>>>>>> Devrim; these includes the WSGI fix needed for the problem I ran
>>>>>>>> into when testing the RPMs in web mode.
>>>>>>>>
>>>>>>>> Thanks.
>>>>>>>>
>>>>>>>> --
>>>>>>>> Dave Page
>>>>>>>> Blog: http://pgsnake.blogspot.com
>>>>>>>> Twitter: @pgsnake
>>>>>>>>
>>>>>>>> EnterpriseDB UK: http://www.enterprisedb.com
>>>>>>>> The Enterprise PostgreSQL Company
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Fahar Abbas
>>>>>> QMG
>>>>>> EnterpriseDB Corporation
>>>>>> Phone Office: +92-51-835-8874
>>>>>> Phone Direct: +92-51-8466803 <+92%2051%208466803>
>>>>>> Mobile: +92-333-5409707 <+92%20333%205409707>
>>>>>> Skype ID: syed.fahar.abbas
>>>>>> Website: www.enterprisedb.com
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> 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: v2.0 RC2 test builds

2017-09-19 Thread Surinder Kumar
Hi
On Tue, Sep 19, 2017 at 1:51 PM, Dave Page <dp...@pgadmin.org> wrote:

> I assume that's the same as:
>
> Allow apps downloaded from:
>
>  [ ] App Store
>  [x] Apps Store and identified developers
>
​I see the same settings with second options ticked in my machine. but the
error message "pgAdmin4 is damaged and can't be opened. You should eject
the disk image" doesn't gives the clue to user to tick the settings "Allow
apps downloaded from: anywhere".

Can this message be changed or it is system defined?


> In later releases of macOS?
>
>
> On Tue, Sep 19, 2017 at 8:12 AM, Surinder Kumar <
> surinder.ku...@enterprisedb.com> wrote:
>
>> Hi Fahar,
>>
>> It gets installed successfully when I checked the option "Allow apps
>> downloaded from" to "Anywhere" in Security & Privacy option.
>> However, If I install another downloaded app, It asks the user to enable
>> the install for this app by going to Security & Privacy option.
>>
>> Thanks to Khushboo for help.
>>
>> On Tue, Sep 19, 2017 at 11:36 AM, Fahar Abbas <
>> fahar.ab...@enterprisedb.com> wrote:
>>
>>> Hi Surinder,
>>>
>>> I tested pgAdmin4 Build on MAC 10.10 and i don't see any issue related
>>> to this.
>>>
>>> Steps:
>>> 1. Downloaded MAC OS Build on 10.12 Firefox Browser and then scp on MAC
>>> 10.10 fresh VM.
>>>
>>> Note: pgAdmin4 will not work on MAC 10.9 and we have already dropped
>>> this support.
>>>
>>> Can you please share the exact steps so it could reproduce on my fresh
>>> VM?
>>>
>>> Kind Regards,
>>>
>>>
>>> On Tue, Sep 19, 2017 at 10:45 AM, Surinder Kumar <
>>> surinder.ku...@enterprisedb.com> wrote:
>>>
>>>> Hi
>>>>
>>>> Today I downloaded the pgAdmin4 build(pgadmin4-2.0-rc2.dmg
>>>> <https://developer.pgadmin.org/~dpage/2.0-rc2/pgadmin4-2.0-rc2.dmg>)
>>>> for Mac but it is failed to open. When I double click on pgAdmin4 icon to
>>>> open pgAdmin4, I got an error, please refer the screenshot attached.
>>>>
>>>> *OS details:*
>>>>
>>>> Mac OS X Yosemite
>>>> Version 10.10.2
>>>>
>>>> Even on Akshay's machine pgAdmin4 doesn't open
>>>>
>>>> *OS details:*
>>>>
>>>> Mac OS X Mavericks
>>>> Version 10.09.05
>>>>
>>>> *Error:*
>>>>
>>>> The application server couldn't be contacted.
>>>>
>>>> @Fahar, Can you please verify If you got same error?
>>>>
>>>> Thanks,
>>>> Surinder
>>>>
>>>>
>>>> On Tue, Sep 19, 2017 at 1:27 AM, Anthony DeBarros <adebar...@gmail.com>
>>>> wrote:
>>>>
>>>>> No show-stoppers to report. Just to say that it looks great and loads
>>>>> fast. Nice work!
>>>>>
>>>>> Only stylistic item is that the column names in the result grid used
>>>>> to be bold but are now the same weight as the data type.
>>>>>
>>>>> Anthony
>>>>>
>>>>>
>>>>> On September 18, 2017 at 12:13:03 PM, Dave Page (dp...@pgadmin.org)
>>>>> wrote:
>>>>>
>>>>> I've put v2.0-rc2 test builds at https://developer.pgadmin.o
>>>>> rg/~dpage/2.0-rc2/ for anyone who needs them. Please report any
>>>>> show-stopper issues ASAP!
>>>>>
>>>>> Devrim; these includes the WSGI fix needed for the problem I ran into
>>>>> when testing the RPMs in web mode.
>>>>>
>>>>> Thanks.
>>>>>
>>>>> --
>>>>> Dave Page
>>>>> Blog: http://pgsnake.blogspot.com
>>>>> Twitter: @pgsnake
>>>>>
>>>>> EnterpriseDB UK: http://www.enterprisedb.com
>>>>> The Enterprise PostgreSQL Company
>>>>>
>>>>>
>>>>
>>>
>>>
>>> --
>>> Fahar Abbas
>>> QMG
>>> EnterpriseDB Corporation
>>> Phone Office: +92-51-835-8874
>>> Phone Direct: +92-51-8466803 <+92%2051%208466803>
>>> Mobile: +92-333-5409707 <+92%20333%205409707>
>>> Skype ID: syed.fahar.abbas
>>> Website: www.enterprisedb.com
>>>
>>
>>
>
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>


Re: v2.0 RC2 test builds

2017-09-19 Thread Surinder Kumar
Hi Fahar,

It gets installed successfully when I checked the option "Allow apps
downloaded from" to "Anywhere" in Security & Privacy option.
However, If I install another downloaded app, It asks the user to enable
the install for this app by going to Security & Privacy option.

Thanks to Khushboo for help.

On Tue, Sep 19, 2017 at 11:36 AM, Fahar Abbas <fahar.ab...@enterprisedb.com>
wrote:

> Hi Surinder,
>
> I tested pgAdmin4 Build on MAC 10.10 and i don't see any issue related to
> this.
>
> Steps:
> 1. Downloaded MAC OS Build on 10.12 Firefox Browser and then scp on MAC
> 10.10 fresh VM.
>
> Note: pgAdmin4 will not work on MAC 10.9 and we have already dropped this
> support.
>
> Can you please share the exact steps so it could reproduce on my fresh VM?
>
> Kind Regards,
>
>
> On Tue, Sep 19, 2017 at 10:45 AM, Surinder Kumar <
> surinder.ku...@enterprisedb.com> wrote:
>
>> Hi
>>
>> Today I downloaded the pgAdmin4 build(pgadmin4-2.0-rc2.dmg
>> <https://developer.pgadmin.org/~dpage/2.0-rc2/pgadmin4-2.0-rc2.dmg>) for
>> Mac but it is failed to open. When I double click on pgAdmin4 icon to open
>> pgAdmin4, I got an error, please refer the screenshot attached.
>>
>> *OS details:*
>>
>> Mac OS X Yosemite
>> Version 10.10.2
>>
>> Even on Akshay's machine pgAdmin4 doesn't open
>>
>> *OS details:*
>>
>> Mac OS X Mavericks
>> Version 10.09.05
>>
>> *Error:*
>>
>> The application server couldn't be contacted.
>>
>> @Fahar, Can you please verify If you got same error?
>>
>> Thanks,
>> Surinder
>>
>>
>> On Tue, Sep 19, 2017 at 1:27 AM, Anthony DeBarros <adebar...@gmail.com>
>> wrote:
>>
>>> No show-stoppers to report. Just to say that it looks great and loads
>>> fast. Nice work!
>>>
>>> Only stylistic item is that the column names in the result grid used to
>>> be bold but are now the same weight as the data type.
>>>
>>> Anthony
>>>
>>>
>>> On September 18, 2017 at 12:13:03 PM, Dave Page (dp...@pgadmin.org)
>>> wrote:
>>>
>>> I've put v2.0-rc2 test builds at https://developer.pgadmin.o
>>> rg/~dpage/2.0-rc2/ for anyone who needs them. Please report any
>>> show-stopper issues ASAP!
>>>
>>> Devrim; these includes the WSGI fix needed for the problem I ran into
>>> when testing the RPMs in web mode.
>>>
>>> Thanks.
>>>
>>> --
>>> Dave Page
>>> Blog: http://pgsnake.blogspot.com
>>> Twitter: @pgsnake
>>>
>>> EnterpriseDB UK: http://www.enterprisedb.com
>>> The Enterprise PostgreSQL Company
>>>
>>>
>>
>
>
> --
> Fahar Abbas
> QMG
> EnterpriseDB Corporation
> Phone Office: +92-51-835-8874
> Phone Direct: +92-51-8466803
> Mobile: +92-333-5409707
> Skype ID: syed.fahar.abbas
> Website: www.enterprisedb.com
>


Re: [pgAdmin4][Patch]: Properly handle builtins.SERVER_MODE variable when SERVER_MODE is not set

2017-09-18 Thread Surinder Kumar
Hi

On Mon, Sep 18, 2017 at 3:05 PM, Dave Page <dp...@pgadmin.org> wrote:

> Hi
>
> I'd already sent a suggested fix for this to Ashesh. I've just pushed that
> (it updates the WSGI file, not the config file).
>
​Yes, It's a proper fix.​

​I have tested with latest git pull and it works.​

>
> On Mon, Sep 18, 2017 at 6:46 AM, Surinder Kumar <
> surinder.ku...@enterprisedb.com> wrote:
>
>> Hi
>>
>> While configuring pgAdmin4 with Apache mod_wsgi, it fails to run apache
>> server due to python error.
>>
>> [mod_wsgi (pid=12596): Target WSGI script 
>> '/opt/pgadmin4_2/virtualenv/lib/python2.7/site-packages/pgadmin4/pgAdmin4.wsgi'
>>  cannot be loaded as Python module.
>> mod_wsgi (pid=12596): Exception occurred processing WSGI script 
>> '/opt/pgadmin4_2/virtualenv/lib/python2.7/site-packages/pgadmin4/pgAdmin4.wsgi'.
>>  Traceback (most recent call last):
>>File 
>> "/opt/pgadmin4_2/virtualenv/lib/python2.7/site-packages/pgadmin4/pgAdmin4.wsgi",
>>  line 20, in 
>>  import config
>>File 
>> "/opt/pgadmin4_2/virtualenv/lib/python2.7/site-packages/pgadmin4/config.py", 
>> line 118, in 
>>  if builtins.SERVER_MODE is None:
>>  AttributeError: 'module' object has no attribute 'SERVER_MODE'
>>
>> ​Reported by: ​
>> Gabriel Sánchez
>>
>> Please find an attached patch.
>>
>> Thanks,
>> Surinder
>> ​
>>
>
>
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>


[pgAdmin4][Patch]: Properly handle builtins.SERVER_MODE variable when SERVER_MODE is not set

2017-09-17 Thread Surinder Kumar
Hi

While configuring pgAdmin4 with Apache mod_wsgi, it fails to run apache
server due to python error.

[mod_wsgi (pid=12596): Target WSGI script
'/opt/pgadmin4_2/virtualenv/lib/python2.7/site-packages/pgadmin4/pgAdmin4.wsgi'
cannot be loaded as Python module.
mod_wsgi (pid=12596): Exception occurred processing WSGI script
'/opt/pgadmin4_2/virtualenv/lib/python2.7/site-packages/pgadmin4/pgAdmin4.wsgi'.
 Traceback (most recent call last):
   File 
"/opt/pgadmin4_2/virtualenv/lib/python2.7/site-packages/pgadmin4/pgAdmin4.wsgi",
line 20, in 
 import config
   File 
"/opt/pgadmin4_2/virtualenv/lib/python2.7/site-packages/pgadmin4/config.py",
line 118, in 
 if builtins.SERVER_MODE is None:
 AttributeError: 'module' object has no attribute 'SERVER_MODE'

​Reported by: ​
Gabriel Sánchez

Please find an attached patch.

Thanks,
Surinder
​


[pgAdmin4][Patch]: Use standalone modules prop-types as React.PropTypes has moved into a different package since React v15.5

2017-09-17 Thread Surinder Kumar
Hi

While looking into a React bug, I tried running pgAdmin4 code with
Reactv15.5 or with Reactv16-RC-3, the code fails to run.
Because React's PropTypes is no more part of React Module. Reference link

.

Please find an attached patch.

Thanks,
Surinder


fix_react_proptypes_deprecated.patch
Description: Binary data


Re: v2.0-rc1 not starting, runtime not building

2017-09-15 Thread Surinder Kumar
Hi Willy,

>From the logs you sent, It seems there is some issue in Qt setup.

Here is the step by step instructions
 I had
documented to setup pgAdmin4 in desktop mode on Ubuntu.
You also need to setup virtual environment as well.

I hope it helps.

Thanks,
Surinder




On Fri, Sep 15, 2017 at 7:34 PM, Willy-Bas Loos  wrote:

> Any idea's about what's going wrong here?
>
> On Thu, Sep 14, 2017 at 12:39 PM, Willy-Bas Loos 
> wrote:
>
>>
>> On Thu, Sep 14, 2017 at 11:07 AM, Neel Patel > > wrote:
>>
>>> I don't know the installed packages on your system but what I can help
>>> only - Download Qt 5.5 installers from "https://download.qt.io/archiv
>>> e/qt/" and install it on custom path ( e.g. /opt/Qt5.5" and use "qmake"
>>> installed in that directory during compilation and let us know result.
>>>
>> OK, different errors now, but still the qt warning
>>
>> (pgadmin4) wbloos@wb:~/python-files/pgadmin4/runtime$
>> /opt/Qt5.5.1/5.5/gcc_64/bin/qmake "DEFINES +=PGADMIN4_USE_WEBKIT"
>> Project MESSAGE: Building for QT5+...
>> Project MESSAGE: Forcing use of QWebKit...
>> Project MESSAGE:
>> Project MESSAGE: ** WARNING
>> **
>> Project MESSAGE: * It is strongly advised that Qt 5.5.0 or later is used
>> to build the pgAdmin runtime.
>> Project MESSAGE: **
>> ***
>> Project MESSAGE:
>> Project MESSAGE: Building for Linux/Mac...
>> Project MESSAGE: Using /home/wbloos/.virtualenvs/pgad
>> min4/bin/python-config
>> Project MESSAGE: Python3 detected.
>> (pgadmin4) wbloos@wb:~/python-files/pgadmin4/runtime$ make > make.log
>> 2>&1
>>
>>
>
>
> --
> Willy-Bas Loos
>


Re: [pgAdmin4][Patch]: Run MakeFile to generate builds in production mode

2017-09-13 Thread Surinder Kumar
Hi Dave,

If we set 'NODE_ENV' to 'production' variable in definePlugin, the React
will always build in production mode.

Please find an attached patch.

Thanks,
Surinder



On Wed, Sep 13, 2017 at 4:36 PM, Dave Page <dp...@pgadmin.org> wrote:

>
>
> On Wed, Sep 13, 2017 at 10:34 AM, Surinder Kumar <
> surinder.ku...@enterprisedb.com> wrote:
>
>> On Wed, Sep 13, 2017 at 2:52 PM, Dave Page <dp...@pgadmin.org> wrote:
>>
>>>
>>>
>>> On Wed, Sep 13, 2017 at 10:06 AM, Surinder Kumar <
>>> surinder.ku...@enterprisedb.com> wrote:
>>>
>>>>
>>>> ​
>>>> On Wed, Sep 13, 2017 at 2:18 PM, Dave Page <dp...@pgadmin.org> wrote:
>>>>
>>>>> Thanks, committed - though I did add a bundle-dev target to the
>>>>> Makefile for convenience.
>>>>>
>>>>> I'm a little concerned though that the query history still doesn't
>>>>> work in dev mode. Is that fixable?
>>>>>
>>>> ​That's an issue with ReactJS and I had logged a ticket​
>>>>
>>>> ​on their repository but didn't get any response from them.
>>>> The solution is pass `production` flag in place of `envType` in `dev`
>>>> mode too.
>>>>
>>>> const definePlugin = new webpack.DefinePlugin({
>>>> ​  ​
>>>> 'process.env': {
>>>> ​ ​
>>>> 'NODE_ENV': JSON.stringify(envType),
>>>> ​ // In dev mode envType is `development`​
>>>>
>>>> ​  ​
>>>> },
>>>> });
>>>>
>>>
>>> What would be the effect of that? No source map being generated for
>>> React?
>>>
>> ​Only React is using definePlugin's '
>> NODE_ENV'
>> ​ variable​
>> for writing debug-only statements in React code.
>> ​ It will have no effect on functionality. It is used to reduce React
>> bundle size by eliminating debug-only code when run in `production` mode.
>>
>> React code is like:
>>
>> function implementSomeReactBehavior() {
>> // do actual work part 1
>>
>> if(process.env.NODE_ENV !== "production") {
>> // do debug-only work, like recording perf stats
>> }
>>
>> // do actual work part 2
>> }
>>
>>
>> We are not generating source maps for vendor libraries including React.
>> We generate source maps for pgAdmin4 modules only for debugging purpose.
>>
>
> OK, in that case can you please tweak our build so React is always in prod
> mode, regardless of everything else? We really shouldn't have things that
> only work in one mode.
>
> Thanks!
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>


build_react_always_in_prod.patch
Description: Binary data


Re: [pgAdmin4][Patch]: Run MakeFile to generate builds in production mode

2017-09-13 Thread Surinder Kumar
On Wed, Sep 13, 2017 at 2:52 PM, Dave Page <dp...@pgadmin.org> wrote:

>
>
> On Wed, Sep 13, 2017 at 10:06 AM, Surinder Kumar <
> surinder.ku...@enterprisedb.com> wrote:
>
>>
>> ​
>> On Wed, Sep 13, 2017 at 2:18 PM, Dave Page <dp...@pgadmin.org> wrote:
>>
>>> Thanks, committed - though I did add a bundle-dev target to the Makefile
>>> for convenience.
>>>
>>> I'm a little concerned though that the query history still doesn't work
>>> in dev mode. Is that fixable?
>>>
>> ​That's an issue with ReactJS and I had logged a ticket​
>>
>> ​on their repository but didn't get any response from them.
>> The solution is pass `production` flag in place of `envType` in `dev`
>> mode too.
>>
>> const definePlugin = new webpack.DefinePlugin({
>> ​  ​
>> 'process.env': {
>> ​ ​
>> 'NODE_ENV': JSON.stringify(envType),
>> ​ // In dev mode envType is `development`​
>>
>> ​  ​
>> },
>> });
>>
>
> What would be the effect of that? No source map being generated for React?
>
​Only React is using definePlugin's '
NODE_ENV'
​ variable​
for writing debug-only statements in React code.
​ It will have no effect on functionality. It is used to reduce React
bundle size by eliminating debug-only code when run in `production` mode.

React code is like:

function implementSomeReactBehavior() {
// do actual work part 1

if(process.env.NODE_ENV !== "production") {
// do debug-only work, like recording perf stats
}

// do actual work part 2
}


We are not generating source maps for vendor libraries including React. We
generate source maps for pgAdmin4 modules only for debugging purpose.

>
>
>
>> ​
>>
>>
>>
>>> On Tue, Sep 12, 2017 at 11:57 AM, Surinder Kumar <
>>> surinder.ku...@enterprisedb.com> wrote:
>>>
>>>> Hi Dave,
>>>>
>>>> I had discussed this with Ashesh and according to him, running `yarn
>>>> run bundle` should always build prod bundle. So, I made changes 
>>>> accordingly.
>>>>
>>>> Following changes are made in package.json script commands:
>>>>
>>>> 1) Running `yarn run bundle` will build prod bundle.
>>>>
>>>> 2) Running `yarn run bundle:dev` will build dev bundle.
>>>>
>>>> No changes are required in Makefile and build.sh files.
>>>>
>>>> Please review and let me know for changes.
>>>>
>>>> Thanks,
>>>> Surinder
>>>>
>>>> On Tue, Sep 12, 2017 at 2:39 PM, Dave Page <dp...@pgadmin.org> wrote:
>>>>
>>>>> Hi
>>>>>
>>>>> This is over-complicating things. As I said, we never build packages
>>>>> in dev mode - there's just no need.
>>>>>
>>>>> All we need is easy-to-use Makefile targets that allow us to do either
>>>>> a prod or a dev bundle. The packages should always use prod bundles.
>>>>>
>>>>> I assume with the (to-be-updated) version of this patch,
>>>>> webpack_config_changes.patch is still required?
>>>>>
>>>>> On Tue, Sep 12, 2017 at 6:28 AM, Surinder Kumar <
>>>>> surinder.ku...@enterprisedb.com> wrote:
>>>>>
>>>>>> Hi
>>>>>>
>>>>>> As per the review comment given by Ashesh:
>>>>>>
>>>>>> 1) The test cases with target `check:` must run in `prod` mode by
>>>>>> default.
>>>>>>
>>>>>> 2) Add another target `check-dev:` to run test cases in `dev` mode.
>>>>>>
>>>>>> So, the patch is updated with fixed review comments.
>>>>>>
>>>>>> Please find an updated patch and review.
>>>>>>
>>>>>> Thanks,
>>>>>> Surinder
>>>>>>
>>>>>>
>>>>>> On Tue, Sep 12, 2017 at 10:28 AM, Surinder Kumar <
>>>>>> surinder.ku...@enterprisedb.com> wrote:
>>>>>>
>>>>>>> Hi Dave,
>>>>>>>
>>>>>>> I have added a new target to run build in 'dev' mode. By default, it
>>>>>>> will run in production mode.
>>>>>>>
>>>>>>> By dev mode it means, run `yarn run bundle:dev` and by prod mode,
>>>>>>> run `yarn run bundle:prod`.
>>>>>>>
>&

Re: [pgAdmin4][Patch]: Run MakeFile to generate builds in production mode

2017-09-13 Thread Surinder Kumar
​
On Wed, Sep 13, 2017 at 2:18 PM, Dave Page <dp...@pgadmin.org> wrote:

> Thanks, committed - though I did add a bundle-dev target to the Makefile
> for convenience.
>
> I'm a little concerned though that the query history still doesn't work in
> dev mode. Is that fixable?
>
​That's an issue with ReactJS and I had logged a ticket​

​on their repository but didn't get any response from them.
The solution is pass `production` flag in place of `envType` in `dev` mode
too.

const definePlugin = new webpack.DefinePlugin({
​  ​
'process.env': {
​ ​
'NODE_ENV': JSON.stringify(envType),
​ // In dev mode envType is `development`​

​  ​
},
});
​



> On Tue, Sep 12, 2017 at 11:57 AM, Surinder Kumar <
> surinder.ku...@enterprisedb.com> wrote:
>
>> Hi Dave,
>>
>> I had discussed this with Ashesh and according to him, running `yarn run
>> bundle` should always build prod bundle. So, I made changes accordingly.
>>
>> Following changes are made in package.json script commands:
>>
>> 1) Running `yarn run bundle` will build prod bundle.
>>
>> 2) Running `yarn run bundle:dev` will build dev bundle.
>>
>> No changes are required in Makefile and build.sh files.
>>
>> Please review and let me know for changes.
>>
>> Thanks,
>> Surinder
>>
>> On Tue, Sep 12, 2017 at 2:39 PM, Dave Page <dp...@pgadmin.org> wrote:
>>
>>> Hi
>>>
>>> This is over-complicating things. As I said, we never build packages in
>>> dev mode - there's just no need.
>>>
>>> All we need is easy-to-use Makefile targets that allow us to do either a
>>> prod or a dev bundle. The packages should always use prod bundles.
>>>
>>> I assume with the (to-be-updated) version of this patch,
>>> webpack_config_changes.patch is still required?
>>>
>>> On Tue, Sep 12, 2017 at 6:28 AM, Surinder Kumar <
>>> surinder.ku...@enterprisedb.com> wrote:
>>>
>>>> Hi
>>>>
>>>> As per the review comment given by Ashesh:
>>>>
>>>> 1) The test cases with target `check:` must run in `prod` mode by
>>>> default.
>>>>
>>>> 2) Add another target `check-dev:` to run test cases in `dev` mode.
>>>>
>>>> So, the patch is updated with fixed review comments.
>>>>
>>>> Please find an updated patch and review.
>>>>
>>>> Thanks,
>>>> Surinder
>>>>
>>>>
>>>> On Tue, Sep 12, 2017 at 10:28 AM, Surinder Kumar <
>>>> surinder.ku...@enterprisedb.com> wrote:
>>>>
>>>>> Hi Dave,
>>>>>
>>>>> I have added a new target to run build in 'dev' mode. By default, it
>>>>> will run in production mode.
>>>>>
>>>>> By dev mode it means, run `yarn run bundle:dev` and by prod mode, run
>>>>> `yarn run bundle:prod`.
>>>>>
>>>>> In Mac bundle, added new target `make appbundle-dev` to generate build
>>>>> with command `yarn run bundle:dev`. The default target `make appbundle`
>>>>> will run `yarn run bundle:prod`.
>>>>>
>>>>> In Windows bundle, If Make.bat file is executed with an argument `dev`
>>>>> like `./Make.bat x86 dev`, it will call `yarn run bundle:dev` otherwise it
>>>>> will run `yarn run bundle:prod`
>>>>>
>>>>> Please find attached patch and review.
>>>>>
>>>>> Thanks,
>>>>> Surinder
>>>>>
>>>>> On Fri, Sep 8, 2017 at 12:28 PM, Dave Page <dp...@pgadmin.org> wrote:
>>>>>
>>>>>> No, let's just have two targets in one makefile. It's only for our
>>>>>> convenience.
>>>>>>
>>>>>> --
>>>>>> Dave Page
>>>>>> Blog: http://pgsnake.blogspot.com
>>>>>> Twitter: @pgsnake
>>>>>>
>>>>>> EnterpriseDB UK:http://www.enterprisedb.com
>>>>>> The Enterprise PostgreSQL Company
>>>>>>
>>>>>> On 8 Sep 2017, at 05:34, Surinder Kumar <
>>>>>> surinder.ku...@enterprisedb.com> wrote:
>>>>>>
>>>>>> Hi
>>>>>>
>>>>>> On Thu, Sep 7, 2017 at 8:48 PM, Dave Page <dp...@pgadmin.org> wrote:
>>>>>>
>>>>>>> Hi
>>>>>>>
>>>>>>> On Thu, Sep 7, 2017 at 7:28 AM, Sur

Re: Fonts for pgAdmin

2017-09-12 Thread Surinder Kumar
Sure. I will send a patch.

On Tue, Sep 12, 2017 at 8:21 PM, Dave Page  wrote:

> Thanks. Whoever picks up this task will need to include that info in the
> libraries.txt file so we know exactly what 3rd party stuff is in the tree.
>
>
> On Tue, Sep 12, 2017 at 10:50 AM, Shirley Wang  wrote:
>
>> They're from the Google fonts directory : https://fonts.google.com/sel
>> ection?category=Monospace=Open+Sans:400,
>> 400i,600,700|Source+Code+Pro:400,700
>> 
>>
>> On Tue, Sep 12, 2017 at 4:28 PM Dave Page  wrote:
>>
>>> Hi
>>>
>>> On Tue, Sep 12, 2017 at 4:13 AM, Shirley Wang  wrote:
>>>
 Hi

 Following up on Anthony's comment in another thread, here are the open
 source fonts that I used in the test builds.

 I don't have the CSS skills to create a patch for submission, could
 someone take the lead and help create these?

 Attached is a font file that includes Open Sans (regular, italic,
 semibold, and bold) and Source Code Pro (regular and bold). Open Sans is
 used for body text in place of Helvetica/Arial and Source Code Pro is a
 monospace to be used in place of Monospace.

>>>
>>> What is the canonical source of these fonts?
>>>
>>> --
>>> Dave Page
>>> Blog: http://pgsnake.blogspot.com
>>> Twitter: @pgsnake
>>>
>>> EnterpriseDB UK: http://www.enterprisedb.com
>>> The Enterprise PostgreSQL Company
>>>
>>
>
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>


Re: [pgAdmin4][Patch]: Run MakeFile to generate builds in production mode

2017-09-12 Thread Surinder Kumar
Hi Dave,

I had discussed this with Ashesh and according to him, running `yarn run
bundle` should always build prod bundle. So, I made changes accordingly.

Following changes are made in package.json script commands:

1) Running `yarn run bundle` will build prod bundle.

2) Running `yarn run bundle:dev` will build dev bundle.

No changes are required in Makefile and build.sh files.

Please review and let me know for changes.

Thanks,
Surinder

On Tue, Sep 12, 2017 at 2:39 PM, Dave Page <dp...@pgadmin.org> wrote:

> Hi
>
> This is over-complicating things. As I said, we never build packages in
> dev mode - there's just no need.
>
> All we need is easy-to-use Makefile targets that allow us to do either a
> prod or a dev bundle. The packages should always use prod bundles.
>
> I assume with the (to-be-updated) version of this patch,
> webpack_config_changes.patch is still required?
>
> On Tue, Sep 12, 2017 at 6:28 AM, Surinder Kumar <
> surinder.ku...@enterprisedb.com> wrote:
>
>> Hi
>>
>> As per the review comment given by Ashesh:
>>
>> 1) The test cases with target `check:` must run in `prod` mode by default.
>>
>> 2) Add another target `check-dev:` to run test cases in `dev` mode.
>>
>> So, the patch is updated with fixed review comments.
>>
>> Please find an updated patch and review.
>>
>> Thanks,
>> Surinder
>>
>>
>> On Tue, Sep 12, 2017 at 10:28 AM, Surinder Kumar <
>> surinder.ku...@enterprisedb.com> wrote:
>>
>>> Hi Dave,
>>>
>>> I have added a new target to run build in 'dev' mode. By default, it
>>> will run in production mode.
>>>
>>> By dev mode it means, run `yarn run bundle:dev` and by prod mode, run
>>> `yarn run bundle:prod`.
>>>
>>> In Mac bundle, added new target `make appbundle-dev` to generate build
>>> with command `yarn run bundle:dev`. The default target `make appbundle`
>>> will run `yarn run bundle:prod`.
>>>
>>> In Windows bundle, If Make.bat file is executed with an argument `dev`
>>> like `./Make.bat x86 dev`, it will call `yarn run bundle:dev` otherwise it
>>> will run `yarn run bundle:prod`
>>>
>>> Please find attached patch and review.
>>>
>>> Thanks,
>>> Surinder
>>>
>>> On Fri, Sep 8, 2017 at 12:28 PM, Dave Page <dp...@pgadmin.org> wrote:
>>>
>>>> No, let's just have two targets in one makefile. It's only for our
>>>> convenience.
>>>>
>>>> --
>>>> Dave Page
>>>> Blog: http://pgsnake.blogspot.com
>>>> Twitter: @pgsnake
>>>>
>>>> EnterpriseDB UK:http://www.enterprisedb.com
>>>> The Enterprise PostgreSQL Company
>>>>
>>>> On 8 Sep 2017, at 05:34, Surinder Kumar <surinder.kumar@enterprisedb.c
>>>> om> wrote:
>>>>
>>>> Hi
>>>>
>>>> On Thu, Sep 7, 2017 at 8:48 PM, Dave Page <dp...@pgadmin.org> wrote:
>>>>
>>>>> Hi
>>>>>
>>>>> On Thu, Sep 7, 2017 at 7:28 AM, Surinder Kumar <
>>>>> surinder.ku...@enterprisedb.com> wrote:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> When we run Webpack in production mode, it performs optimization on
>>>>>> code while in development we don't optimize generated JS and CSS bundles 
>>>>>> as
>>>>>> dev mode is for developer use.
>>>>>>
>>>>>> So we should run Webpack bundle in production mode when we are
>>>>>> generating bundles for release mode.
>>>>>>
>>>>>
>>>>> Don't we also need a bundle target for dev mode? The patch changes
>>>>> "make bundle" to run "yarn run bundle:prod"
>>>>>
>>>> ​yes I think so.
>>>> We can have two Makefiles - one for dev mode and other for production
>>>> mode.
>>>>
>>>>>
>>>>>
>>>>>>
>>>>>> *In the second patch:*
>>>>>>
>>>>>> 1) Enabled "*sourced maps*" in production mode as well which will
>>>>>> help in debugging issues.
>>>>>>
>>>>>> 2) Removed "*yarn run linter*" script when Webpack runs in
>>>>>> production mode because it is for developer only to check if there are 
>>>>>> any
>>>>>> syntax errors in JS modules.
>>>>>>
>>>>>> 3) Removed redundant script command "*yarn run bundle*" as "*yarn
>>>>>> run bundle:dev*" does the same thing.
>>>>>>
>>>>>> Please find an attached patch.
>>>>>>
>>>>>> Thanks,
>>>>>> Surinder
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> 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
>


bundle_script_changes.patch
Description: Binary data


Re: [pgAdmin4][Patch]: Run MakeFile to generate builds in production mode

2017-09-11 Thread Surinder Kumar
Hi

As per the review comment given by Ashesh:

1) The test cases with target `check:` must run in `prod` mode by default.

2) Add another target `check-dev:` to run test cases in `dev` mode.

So, the patch is updated with fixed review comments.

Please find an updated patch and review.

Thanks,
Surinder


On Tue, Sep 12, 2017 at 10:28 AM, Surinder Kumar <
surinder.ku...@enterprisedb.com> wrote:

> Hi Dave,
>
> I have added a new target to run build in 'dev' mode. By default, it will
> run in production mode.
>
> By dev mode it means, run `yarn run bundle:dev` and by prod mode, run
> `yarn run bundle:prod`.
>
> In Mac bundle, added new target `make appbundle-dev` to generate build
> with command `yarn run bundle:dev`. The default target `make appbundle`
> will run `yarn run bundle:prod`.
>
> In Windows bundle, If Make.bat file is executed with an argument `dev`
> like `./Make.bat x86 dev`, it will call `yarn run bundle:dev` otherwise it
> will run `yarn run bundle:prod`
>
> Please find attached patch and review.
>
> Thanks,
> Surinder
>
> On Fri, Sep 8, 2017 at 12:28 PM, Dave Page <dp...@pgadmin.org> wrote:
>
>> No, let's just have two targets in one makefile. It's only for our
>> convenience.
>>
>> --
>> Dave Page
>> Blog: http://pgsnake.blogspot.com
>> Twitter: @pgsnake
>>
>> EnterpriseDB UK:http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>>
>> On 8 Sep 2017, at 05:34, Surinder Kumar <surinder.ku...@enterprisedb.com>
>> wrote:
>>
>> Hi
>>
>> On Thu, Sep 7, 2017 at 8:48 PM, Dave Page <dp...@pgadmin.org> wrote:
>>
>>> Hi
>>>
>>> On Thu, Sep 7, 2017 at 7:28 AM, Surinder Kumar <
>>> surinder.ku...@enterprisedb.com> wrote:
>>>
>>>> Hi,
>>>>
>>>> When we run Webpack in production mode, it performs optimization on
>>>> code while in development we don't optimize generated JS and CSS bundles as
>>>> dev mode is for developer use.
>>>>
>>>> So we should run Webpack bundle in production mode when we are
>>>> generating bundles for release mode.
>>>>
>>>
>>> Don't we also need a bundle target for dev mode? The patch changes "make
>>> bundle" to run "yarn run bundle:prod"
>>>
>> ​yes I think so.
>> We can have two Makefiles - one for dev mode and other for production
>> mode.
>>
>>>
>>>
>>>>
>>>> *In the second patch:*
>>>>
>>>> 1) Enabled "*sourced maps*" in production mode as well which will help
>>>> in debugging issues.
>>>>
>>>> 2) Removed "*yarn run linter*" script when Webpack runs in production
>>>> mode because it is for developer only to check if there are any syntax
>>>> errors in JS modules.
>>>>
>>>> 3) Removed redundant script command "*yarn run bundle*" as "*yarn run
>>>> bundle:dev*" does the same thing.
>>>>
>>>> Please find an attached patch.
>>>>
>>>> Thanks,
>>>> Surinder
>>>>
>>>>
>>>
>>>
>>> --
>>> Dave Page
>>> Blog: http://pgsnake.blogspot.com
>>> Twitter: @pgsnake
>>>
>>> EnterpriseDB UK: http://www.enterprisedb.com
>>> The Enterprise PostgreSQL Company
>>>
>>
>>
>


add_target_for_prod_in_makefiles_v1.patch
Description: Binary data


Re: pgAdmin 4 v2.0-rc1 builds

2017-09-11 Thread Surinder Kumar
On Mon, Sep 11, 2017 at 6:45 PM, Dave Page <dp...@pgadmin.org> wrote:

>
>
> On Mon, Sep 11, 2017 at 2:12 PM, Surinder Kumar <
> surinder.ku...@enterprisedb.com> wrote:
>
>> Hi
>>
>> On Mon, Sep 11, 2017 at 6:07 PM, Dave Page <dp...@pgadmin.org> wrote:
>>
>>>
>>>
>>> On Mon, Sep 11, 2017 at 1:18 PM, Surinder Kumar <
>>> surinder.ku...@enterprisedb.com> wrote:
>>>
>>>> Hi,
>>>>
>>>> On Mon, Sep 11, 2017 at 5:40 PM, Anthony DeBarros <adebar...@gmail.com>
>>>> wrote:
>>>>
>>>>> Howdy,
>>>>>
>>>>> Nice work! Don’t see any show-stoppers, but I’ll throw three comments
>>>>> at you all.
>>>>>
>>>>> 1. New tree icons look great.
>>>>> 2. A few weeks back, there was a test release with a new font for the
>>>>> query tool. Got used to it and liked it a lot. Hope you consider using it
>>>>> in the future.
>>>>> 3. Still experiencing this bug in the History tab on MacOS:
>>>>> https://redmine.postgresql.org/issues/2561
>>>>>
>>>> ​This is an issue when pgAdmin4 run/built in dev mode​. It would be
>>>> resolved when pgAdmin4 built in production mode.
>>>>
>>>> However, I had sent a patch to run builds in production mode. But as
>>>> per discussion with Dave, we need to add another target for production mode
>>>> on which I will work once i get time.
>>>>
>>>
>>> Can you get that done for tomorrow?
>>>
>> ​If I start working​
>>
>> ​on this tomorrow. I can add target to the build files but I am not sure
>> it will be completed by tomorrow because it needs testing on all possible
>> Operating Systems​ plus on runtime as well.
>> It it gets completed by tomorrow then I will send a patch for it,
>> otherwise this task will require more time.
>>
>
> We must be thinking about this differently. Surely we just need a target
> that calls yarn with a different argument?
>
​Yes, I think so.

​Here is my understanding:​

*As per README file for mac, To create Mac bundle, we execute:*

`make appbundle`​

​By default it should make build in production mode.​ But if we run it for
development mode, the command should be:

`make appbundle-dev`

and target in Makefile will be:

appbundle-dev: docs
  RUN_BUILD_IN_DEV=1 ./pkg/mac/build.sh (We can use this flag to run bundle
conditional)

bundle-dev:
  cd web && yarn run bundle:dev

otherwise, the default target would be:

bundle or bundle-prod:
  cd web && yarn run bundle:prod

*As per README file for Windows machine, To create bundle, we execute:*

"Make.bat x86|amd64"

To run it in dev mode, a flag `dev` will be passed:

`Make.bat x86|amd64 dev` (We will use `dev` flag to run bundle conditional)

Please let me know If i missed something.

Thanks,
Surinder



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


[pgAdmin4][Patch]: Run MakeFile to generate builds in production mode

2017-09-07 Thread Surinder Kumar
Hi,

When we run Webpack in production mode, it performs optimization on code
while in development we don't optimize generated JS and CSS bundles as dev
mode is for developer use.

So we should run Webpack bundle in production mode when we are generating
bundles for release mode.

*In the second patch:*

1) Enabled "*sourced maps*" in production mode as well which will help in
debugging issues.

2) Removed "*yarn run linter*" script when Webpack runs in production mode
because it is for developer only to check if there are any syntax errors in
JS modules.

3) Removed redundant script command "*yarn run bundle*" as "*yarn run
bundle:dev*" does the same thing.

Please find an attached patch.

Thanks,
Surinder


run_build_in_production_mode.patch
Description: Binary data


webpack_config_changes.patch
Description: Binary data


Re: Error with webpack

2017-08-31 Thread Surinder Kumar
Hi Ladislav,
​
After taking the latest pull from git HEAD:

1. Install all Python dependent packages
   `$ pip install -r requirements.txt`

2. Install all NPM packages
   $ cd web and run yarn install

3. Run pgAdmin4 server and browse to 'http://127.0.0.1:5050'
   `$ python pgAdmin4.py`

Thanks,
Surinder

On Thu, Aug 31, 2017 at 11:48 PM, Ladislav Jech <archenr...@gmail.com>
wrote:

> Hi guys,
>
> I am getting following error with latest git version:
> Done in 1.75s.
> yarn run v0.21.3
> $ yarn run webpack -- --config webpack.config.js
> yarn run v0.21.3
> $ "/home/zangetsu/devel/tmp/pgadmin4/web/node_modules/.bin/webpack"
> --config webpack.config.js
> module.js:491
> throw err;
> ^
>
> Error: Cannot find module 'optimize-css-assets-webpack-plugin'
> at Function.Module._resolveFilename (module.js:489:15)
> at Function.Module._load (module.js:439:25)
> at Module.require (module.js:517:17)
> at require (internal/module.js:11:18)
> at Object. (/home/zangetsu/devel/tmp/pgad
> min4/web/webpack.config.js:11:33)
> at Module._compile (module.js:573:30)
> at Object.Module._extensions..js (module.js:584:10)
> at Module.load (module.js:507:32)
> at tryModuleLoad (module.js:470:12)
> at Function.Module._load (module.js:462:3)
> error Command failed with exit code 1.
> info Visit https://yarnpkg.com/en/docs/cli/run for documentation about
> this command.
> error Command failed with exit code 1.
> info Visit https://yarnpkg.com/en/docs/cli/run for documentation about
> this command.
> error Command failed with exit code 1.
> info Visit https://yarnpkg.com/en/docs/cli/run for documentation about
> this command.
>
> ​It seems you didn't run `$ yarn install​`

> Commit:
> commit c4393a7795eef18b311724f45b6c9c0dae01926d (HEAD -> master,
> origin/master, origin/HEAD)
> Author: Surinder Kumar <surinder.ku...@enterprisedb.com>
> Date:   Thu Aug 31 14:50:22 2017 +0100
>


Re: [pgAdmin4][Patch]: RM_2596 - Query tool not working in Desktop Runtime on Mac OS X

2017-08-31 Thread Surinder Kumar
Hi Ashesh,

The issue is still not fixed, the reason is:

In the first patch, I was setting `production` flag in `definePlugin` like:

const definePlugin = new webpack.DefinePlugin({
  'process.env': {
'NODE_ENV': JSON.stringify('production'),
  },
});

in development mode but we had the discussion that when webpack is built in
dev mode the flag should be 'development' otherwise `production`.

But this issue is fixed only when we are setting `production` in
definePlugin, setting `development` mode doesn't fix this.

I have logged an issue in React
<https://github.com/facebook/react/issues/10582>

Thoughts?

Thanks,
Surinder

On Thu, Aug 31, 2017 at 2:29 PM, Ashesh Vashi <ashesh.va...@enterprisedb.com
> wrote:

> On Tue, Aug 29, 2017 at 5:55 PM, Surinder Kumar <
> surinder.ku...@enterprisedb.com> wrote:
>
>> Hi Ashesh,
>>
>> Can you please review this patch please?
>>
> Thanks - committed!
>
> --
>
> Thanks & Regards,
>
> Ashesh Vashi
> EnterpriseDB INDIA: Enterprise PostgreSQL Company
> <http://www.enterprisedb.com/>
>
>
> *http://www.linkedin.com/in/asheshvashi*
> <http://www.linkedin.com/in/asheshvashi>
>
>>
>> Thanks,
>> Surinder
>>
>> On Wed, Aug 16, 2017 at 3:43 PM, Surinder Kumar <
>> surinder.ku...@enterprisedb.com> wrote:
>>
>>> Hi,
>>>
>>> Updated patch contains changes:
>>>
>>>- Enable definePlugin for development environment as well. Just
>>>adding definePlugin in plugins array.
>>>The variable process.env.NODE_ENV is useful to write conditional
>>>code in pgAdmin4 JS modules.
>>>
>>> For example:
>>>
>>> if (process.env.NODE_ENV !== 'production') {
>>>   // Write development environment specific code
>>> } else {
>>>   // Write production only code.
>>> }
>>>
>>> Please review this patch and let me know for changes.
>>>
>>> Thanks,
>>> Surinder
>>> ​
>>>
>>> On Tue, Aug 1, 2017 at 11:32 AM, Surinder Kumar <
>>> surinder.ku...@enterprisedb.com> wrote:
>>>
>>>> Hi Ashesh,
>>>>
>>>> 1. Now we are using `envType` variable in definePlugin which sets
>>>> environment variable NODE_ENV globally which is used by React to create
>>>> development or production build.
>>>> where:
>>>>  envType - determine build type is either `production` or
>>>> `development`​ depending on the environment set in package.json > scripts.
>>>>
>>>> 2. In `UglifyJSPlugin`, i am setting compress > `warnings to false`,
>>>> because here warning flag is meant to display warnings on terminal while
>>>> creating build in production mode. so it is set to false.
>>>>
>>>> I didn't created an RM for #2 as it is minor change, if needed, i will
>>>> create.
>>>>
>>>> ​Reference to webpack definePlugin:
>>>> https://webpack.js.org/guides/production/#node-environment-variable​
>>>>
>>>> Please find updated patch with fixed review comments and review.
>>>>
>>>> Thanks,
>>>> Surinder
>>>>
>>>> On Mon, Jul 31, 2017 at 3:31 PM, Ashesh Vashi <
>>>> ashesh.va...@enterprisedb.com> wrote:
>>>>
>>>>> On Fri, Jul 28, 2017 at 12:42 PM, Surinder Kumar <
>>>>> surinder.ku...@enterprisedb.com> wrote:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> I inspect the react code and in call stacks, found
>>>>>> `process.env.NODE_ENV` is undefined due to which 'SyntheticEvent.call' is
>>>>>> not callable.
>>>>>>
>>>>>> So, to fix this, i add 'definePlugin' to plugins for `dev`
>>>>>> environment in `webpack.config.js`. Initially it was added only for
>>>>>> `production` environment. but it is needed for both, because React code 
>>>>>> is
>>>>>> conditional based on environment variables set.
>>>>>>
>>>>>
>>>>>> Please find attached patch and review.
>>>>>>
>>>>> As discussed, you're setting 'production', even in the 'development'
>>>>> mode.
>>>>>
>>>>> Please understand the code, and share the updated patch.
>>>>> Also - share the references next time, so that - committer can
>>>>> understand the reason for these changes.
>>>>>
>>>>> -- Thanks, Ashesh
>>>>>
>>>>>>
>>>>>> Thanks,
>>>>>> Surinder
>>>>>>
>>>>>
>>>>>
>>>>
>>>
>>
>


[pgAdmin4][Patch]: RM_2637 - Copy functionality in Query Tool doesn't work after copying from Data Output

2017-08-30 Thread Surinder Kumar
Hi

While working on webpacking pgAdmin4, I had removed
`document.removeEventListener(...)` temporarily as it was not working in
`strict` mode, giving type error and I forgot to include its fix,

because of this copy/paste functionality didn't work properly which is now
taken care in this patch.

Please find attached patch and review.

Thanks,
Surinder


RM_2637.patch
Description: Binary data


Re: [pgAdmin4][Patch]: RM_2596 - Query tool not working in Desktop Runtime on Mac OS X

2017-08-29 Thread Surinder Kumar
Hi Ashesh,

Can you please review this patch please?

Thanks,
Surinder

On Wed, Aug 16, 2017 at 3:43 PM, Surinder Kumar <
surinder.ku...@enterprisedb.com> wrote:

> Hi,
>
> Updated patch contains changes:
>
>- Enable definePlugin for development environment as well. Just adding
>definePlugin in plugins array.
>The variable process.env.NODE_ENV is useful to write conditional code
>in pgAdmin4 JS modules.
>
> For example:
>
> if (process.env.NODE_ENV !== 'production') {
>   // Write development environment specific code
> } else {
>   // Write production only code.
> }
>
> Please review this patch and let me know for changes.
>
> Thanks,
> Surinder
> ​
>
> On Tue, Aug 1, 2017 at 11:32 AM, Surinder Kumar <
> surinder.ku...@enterprisedb.com> wrote:
>
>> Hi Ashesh,
>>
>> 1. Now we are using `envType` variable in definePlugin which sets
>> environment variable NODE_ENV globally which is used by React to create
>> development or production build.
>> where:
>>  envType - determine build type is either `production` or
>> `development`​ depending on the environment set in package.json > scripts.
>>
>> 2. In `UglifyJSPlugin`, i am setting compress > `warnings to false`,
>> because here warning flag is meant to display warnings on terminal while
>> creating build in production mode. so it is set to false.
>>
>> I didn't created an RM for #2 as it is minor change, if needed, i will
>> create.
>>
>> ​Reference to webpack definePlugin:
>> https://webpack.js.org/guides/production/#node-environment-variable​
>>
>> Please find updated patch with fixed review comments and review.
>>
>> Thanks,
>> Surinder
>>
>> On Mon, Jul 31, 2017 at 3:31 PM, Ashesh Vashi <
>> ashesh.va...@enterprisedb.com> wrote:
>>
>>> On Fri, Jul 28, 2017 at 12:42 PM, Surinder Kumar <
>>> surinder.ku...@enterprisedb.com> wrote:
>>>
>>>> Hi,
>>>>
>>>> I inspect the react code and in call stacks, found
>>>> `process.env.NODE_ENV` is undefined due to which 'SyntheticEvent.call' is
>>>> not callable.
>>>>
>>>> So, to fix this, i add 'definePlugin' to plugins for `dev` environment
>>>> in `webpack.config.js`. Initially it was added only for `production`
>>>> environment. but it is needed for both, because React code is conditional
>>>> based on environment variables set.
>>>>
>>>
>>>> Please find attached patch and review.
>>>>
>>> As discussed, you're setting 'production', even in the 'development'
>>> mode.
>>>
>>> Please understand the code, and share the updated patch.
>>> Also - share the references next time, so that - committer can
>>> understand the reason for these changes.
>>>
>>> -- Thanks, Ashesh
>>>
>>>>
>>>> Thanks,
>>>> Surinder
>>>>
>>>
>>>
>>
>


Re: [pgAdmin4][Patch]: Ensure any changes to the config database are backward compatible

2017-08-25 Thread Surinder Kumar
Created an RM <https://redmine.postgresql.org/issues/2664> to track this
issue.

On Fri, Aug 25, 2017 at 7:19 PM, Surinder Kumar <
surinder.ku...@enterprisedb.com> wrote:

> ​Hi,​
>
> We will use config variable `SCHEMA_VERSION` to keep track of SQLite
> database changes. Whenever there is any change is performed in the
> database, the count of schema version will be incremented by 1 and the same
> will be updated in SQLite table `version`.
>
> So, these changes make sure the database migration is not performed on the
> older version of pgAdmin4 and this way the same database will work
> irrespective of pgAdmin4 version.
>
> Also, this will only work for future pgAdmin4 versions.
>
> Please find attached patch and review.
>
> Thanks,
> Surinder
>


Re: Next release

2017-08-25 Thread Surinder Kumar
Hi

On Fri, Aug 25, 2017 at 2:04 PM, Dave Page <dp...@pgadmin.org> wrote:

>
>
> On Fri, Aug 25, 2017 at 9:28 AM, Harshal Dhumal <
> harshal.dhu...@enterprisedb.com> wrote:
>
>> One more thing that this will only work for future pgAdmin4 versions
>>
>
>
> Yeah :-(
>
>
>>
>> --
>> *Harshal Dhumal*
>> *Sr. Software Engineer*
>>
>> EnterpriseDB India: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>>
>> On Fri, Aug 25, 2017 at 1:48 PM, Dave Page <dp...@pgadmin.org> wrote:
>>
>>>
>>>
>>> On Fri, Aug 25, 2017 at 9:15 AM, Surinder Kumar <
>>> surinder.ku...@enterprisedb.com> wrote:
>>>
>>>> ​Hi​
>>>>
>>>> On Fri, Aug 25, 2017 at 12:21 PM, Ashesh Vashi <
>>>> ashesh.va...@enterprisedb.com> wrote:
>>>>
>>>>> On Fri, Aug 25, 2017 at 12:16 PM, Surinder Kumar <
>>>>> surinder.ku...@enterprisedb.com> wrote:
>>>>>
>>>>>> Hi
>>>>>> On Fri, Aug 25, 2017 at 1:03 AM, Dave Page <dp...@pgadmin.org> wrote:
>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On Thu, Aug 24, 2017 at 8:28 PM, Harshal Dhumal <
>>>>>>> harshal.dhu...@enterprisedb.com> wrote:
>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>> *Harshal Dhumal*
>>>>>>>> *Sr. Software Engineer*
>>>>>>>>
>>>>>>>> EnterpriseDB India: http://www.enterprisedb.com
>>>>>>>> The Enterprise PostgreSQL Company
>>>>>>>>
>>>>>>>> On Thu, Aug 24, 2017 at 9:44 PM, Dave Page <dp...@pgadmin.org>
>>>>>>>> wrote:
>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Thu, Aug 24, 2017 at 10:36 AM, Surinder Kumar <
>>>>>>>>> surinder.ku...@enterprisedb.com> wrote:
>>>>>>>>>
>>>>>>>>>> Hi Dave,
>>>>>>>>>>
>>>>>>>>>> On Thu, Aug 24, 2017 at 2:28 PM, Dave Page <dp...@pgadmin.org>
>>>>>>>>>> wrote:
>>>>>>>>>>
>>>>>>>>>>> Anyone object to doing a release on 14th September, wrapping the
>>>>>>>>>>> code on Monday 11th? This seems like the best option for our QA 
>>>>>>>>>>> folks who
>>>>>>>>>>> will be off for EID somewhen in the two weeks before.
>>>>>>>>>>>
>>>>>>>>>>> Assuming not, should this be 1.7 or 2.0?
>>>>>>>>>>>
>>>>>>>>>>> If we go with 2.0, it'll be for "safety" given the proposed
>>>>>>>>>>> changes to path management to allow both server and desktop modes 
>>>>>>>>>>> to work
>>>>>>>>>>> out of the box on Linux.
>>>>>>>>>>>
>>>>>>>>>>> If we do that, we also need to ensure that any changes to the
>>>>>>>>>>> config database are backwards compatible, as a 2.0 release would be 
>>>>>>>>>>> a
>>>>>>>>>>> side-by-side installation. Surinder; was it you that had looked 
>>>>>>>>>>> into that?
>>>>>>>>>>>
>>>>>>>>>> ​I had looked into this and here are my findings:
>>>>>>>>>> 1. If we are using newer version of pgAdmin and the go back to
>>>>>>>>>> older version of pgAdmin, then on running `python pgAdmin4.py`. the
>>>>>>>>>> flask-migrate(Alembic) try to perform downgrade by one step only(ie. 
>>>>>>>>>> it can
>>>>>>>>>> switch back to one migration only when we run  `python 
>>>>>>>>>> pgAdmin4.py`). But
>>>>>>>>>> we have multiple database revisions to be migrated. So migration 
>>>>>>>>>> fails here.
>>>>>>>>>>
>>>>>>>>>> 2. When A

Re: Next release

2017-08-25 Thread Surinder Kumar
Hi
On Fri, Aug 25, 2017 at 1:03 AM, Dave Page <dp...@pgadmin.org> wrote:

>
>
> On Thu, Aug 24, 2017 at 8:28 PM, Harshal Dhumal <
> harshal.dhu...@enterprisedb.com> wrote:
>
>>
>>
>> --
>> *Harshal Dhumal*
>> *Sr. Software Engineer*
>>
>> EnterpriseDB India: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>>
>> On Thu, Aug 24, 2017 at 9:44 PM, Dave Page <dp...@pgadmin.org> wrote:
>>
>>>
>>>
>>> On Thu, Aug 24, 2017 at 10:36 AM, Surinder Kumar <
>>> surinder.ku...@enterprisedb.com> wrote:
>>>
>>>> Hi Dave,
>>>>
>>>> On Thu, Aug 24, 2017 at 2:28 PM, Dave Page <dp...@pgadmin.org> wrote:
>>>>
>>>>> Anyone object to doing a release on 14th September, wrapping the code
>>>>> on Monday 11th? This seems like the best option for our QA folks who will
>>>>> be off for EID somewhen in the two weeks before.
>>>>>
>>>>> Assuming not, should this be 1.7 or 2.0?
>>>>>
>>>>> If we go with 2.0, it'll be for "safety" given the proposed changes to
>>>>> path management to allow both server and desktop modes to work out of the
>>>>> box on Linux.
>>>>>
>>>>> If we do that, we also need to ensure that any changes to the config
>>>>> database are backwards compatible, as a 2.0 release would be a 
>>>>> side-by-side
>>>>> installation. Surinder; was it you that had looked into that?
>>>>>
>>>> ​I had looked into this and here are my findings:
>>>> 1. If we are using newer version of pgAdmin and the go back to older
>>>> version of pgAdmin, then on running `python pgAdmin4.py`. the
>>>> flask-migrate(Alembic) try to perform downgrade by one step only(ie. it can
>>>> switch back to one migration only when we run  `python pgAdmin4.py`). But
>>>> we have multiple database revisions to be migrated. So migration fails 
>>>> here.
>>>>
>>>> 2. When Alebmic downgrade is performed by one step, it looks for
>>>> downgrade function in that specific database revision, but in our code we
>>>> didn't written downgrade function. But if we have written downgrade
>>>> statement, still there is an issue:
>>>> ie. If we add a new column to a table xyz using ALTER statement like:
>>>>
>>>> ​```
>>>> ​
>>>> def upgrade():
>>>> ​​
>>>> verison = get_version()
>>>>
>>>> ​​
>>>> db.engine.execute(
>>>> ​​
>>>> 'ALTER TABLE server ADD COLUMN hostaddr TEXT(1024)'
>>>> ​ ​
>>>> )
>>>>
>>>> def downgrade():
>>>> ​​
>>>> pass
>>>> ​```​
>>>> then on downgrade it executes `downgrade` method, so downgrade should
>>>> have code like
>>>> `ALTER TABLE server DROP COLUMN hostaddr `
>>>> but in sqlite DROP COLUMN statements don't work.
>>>> So, this is a an issue with Sqlite database. However, an alternative
>>>> way is also given. Here is link
>>>> <https://stackoverflow.com/questions/5938048/delete-column-from-sqlite-table>
>>>>
>>>>
>>>> Still, I didn't find any other solution on upgrading/downgrading
>>>> database revisions without errors.
>>>> It is an issue with Flask-Migrate(Alembic) plugin.
>>>>
>>>
>>>
>>> Urgh. So I guess the other option is that we version the DB filename as
>>> well. The downside of that is that users will want to migrate their
>>> settings - which may be awkward as we'll have no real way of knowing where
>>> they are.
>>>
>>> Thoughts?
>>>
>>> Or should we write our own custom backword migrations? For eg. dropping
>>  column can be achieved by creating another table excluding the columns
>> which we want to drop then copy data to new table and then drop old table
>> and rename new table to old name. And also sqlite database schema which we
>> have in pgAdmin4 is small so writing and maintaining custom migration won
>> be that hard.
>>
>
> The problem is that we don't want to migrate backwards; we want both
> versions to be able to run with the same database (for example, because you
> might have multiple versions installed with the EDB PG installer as I do on
> my laptop).
>
> Previously, 

Re: Next release

2017-08-24 Thread Surinder Kumar
Hi Dave,

On Thu, Aug 24, 2017 at 2:28 PM, Dave Page  wrote:

> Anyone object to doing a release on 14th September, wrapping the code on
> Monday 11th? This seems like the best option for our QA folks who will be
> off for EID somewhen in the two weeks before.
>
> Assuming not, should this be 1.7 or 2.0?
>
> If we go with 2.0, it'll be for "safety" given the proposed changes to
> path management to allow both server and desktop modes to work out of the
> box on Linux.
>
> If we do that, we also need to ensure that any changes to the config
> database are backwards compatible, as a 2.0 release would be a side-by-side
> installation. Surinder; was it you that had looked into that?
>
​I had looked into this and here are my findings:
1. If we are using newer version of pgAdmin and the go back to older
version of pgAdmin, then on running `python pgAdmin4.py`. the
flask-migrate(Alembic) try to perform downgrade by one step only(ie. it can
switch back to one migration only when we run  `python pgAdmin4.py`). But
we have multiple database revisions to be migrated. So migration fails here.

2. When Alebmic downgrade is performed by one step, it looks for downgrade
function in that specific database revision, but in our code we didn't
written downgrade function. But if we have written downgrade statement,
still there is an issue:
ie. If we add a new column to a table xyz using ALTER statement like:

​```
​
def upgrade():
​​
verison = get_version()

​​
db.engine.execute(
​​
'ALTER TABLE server ADD COLUMN hostaddr TEXT(1024)'
​ ​
)

def downgrade():
​​
pass
​```​
then on downgrade it executes `downgrade` method, so downgrade should have
code like
`ALTER TABLE server DROP COLUMN hostaddr `
but in sqlite DROP COLUMN statements don't work.
So, this is a an issue with Sqlite database. However, an alternative way is
also given. Here is link



Still, I didn't find any other solution on upgrading/downgrading database
revisions without errors.
It is an issue with Flask-Migrate(Alembic) plugin.


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


Re: [pgAdmin4][Patch]: RM_ 2658 - Improve help message for "binary paths" entered in Preferences

2017-08-23 Thread Surinder Kumar
Hi Dave,

On Tue, Aug 22, 2017 at 7:22 PM, Murtuza Zabuawala <murtuza.zabuawala@
enterprisedb.com> wrote:

> ​​
> https://redmine.postgresql.org/issues/2008
> ​
>
> On Tue, Aug 22, 2017 at 7:14 PM, Surinder Kumar <
> surinder.ku...@enterprisedb.com> wrote:
>
>> On Tue, Aug 22, 2017 at 6:07 PM, Dave Page <dp...@pgadmin.org> wrote:
>>
>>>
>>>
>>> On Tue, Aug 22, 2017 at 1:30 PM, Surinder Kumar <
>>> surinder.ku...@enterprisedb.com> wrote:
>>>
>>>> Hi
>>>>
>>>> *Issue:*
>>>>
>>>> The user seems to enter sometimes paths with quotes and sometimes add
>>>> spaces which lead to failure of Backup, Restore or Maintenance utility.
>>>>
>>>> *Changes:*
>>>>
>>>>  - Added a note in help string `Note: Don't add quote(s) or space(s)
>>>> before or after the path.`
>>>>
>>>>  - Remove whitespace before/after the value before it gets saved.
>>>>
>>>> Please find attached patch and review.
>>>>
>>>
>>> I wonder if the more appropriate fix here would be to add a new setting
>>> type (perhaps two, one for directory and one for file), which is rendered
>>> with a browse button in the prefs panel, and includes real validation.
>>>
>> ​I thought of using Folder selection dialog (or Backform.FileControl) for
browsing the directory path.
But
FileControl won't work
​ because​
​
We do not allow the user to access file system outside his root dir
(~/.pgadmin/surinder/) in server mode so this will not allow user to select
bin dir path from folder select dialog as it is outside his root dir.

>
>>>
>> ​Yes, the suggested way is a better way.
>> I will check what changes we have to made in preferences code to add
>> support for new setting type and validations.
>>
>>>
>>> Stripping spaces and warning about quotes seems like it's just kicking
>>> the basic problem down the road a few feet.
>>>
>>> --
>>> Dave Page
>>> Blog: http://pgsnake.blogspot.com
>>> Twitter: @pgsnake
>>>
>>> EnterpriseDB UK: http://www.enterprisedb.com
>>> The Enterprise PostgreSQL Company
>>>
>>
>>
>


Re: [Patch][pgAdmin4][pgAgent]: RM_2656 - Unable to select start and end time for scheduler from calendar

2017-08-22 Thread Surinder Kumar
Adding more info...

Before this patch, when Datetimepicker is selected, it expands from the
top, so it was impossible to scroll and hence the user cannot select the
date.

Now, after applying this patch, the Datetimepicker will expand to bottom
and the subgrid will be scrollable, so the user can easily select the date
time and other options as well.

Thanks,
Surinder


On Wed, Aug 23, 2017 at 10:08 AM, Surinder Kumar <
surinder.ku...@enterprisedb.com> wrote:

> Hi
>
> *Issue:*
>
> When a user tries to select start and end time using the calendar, the
> calendar gets hidden and inaccessible to the user.
>
> *Solution:*
> ​
> Set `Backform.DatetimepickerControl` option `widget positioning >
> vertical` to `bottom` which ensures Datepicker widget expands to bottom
> whenever it is opened.
>
> Please find attached patch and review.
>
> Thanks,
> Surinder
>
>


[Patch][pgAdmin4][pgAgent]: RM_2656 - Unable to select start and end time for scheduler from calendar

2017-08-22 Thread Surinder Kumar
Hi

*Issue:*

When a user tries to select start and end time using the calendar, the
calendar gets hidden and inaccessible to the user.

*Solution:*
​
Set `Backform.DatetimepickerControl` option `widget positioning > vertical`
to `bottom` which ensures Datepicker widget expands to bottom whenever it
is opened.

Please find attached patch and review.

Thanks,
Surinder


RM_2656.patch
Description: Binary data


Re: [pgAdmin4][Patch]: RM_ 2658 - Improve help message for "binary paths" entered in Preferences

2017-08-22 Thread Surinder Kumar
On Tue, Aug 22, 2017 at 6:07 PM, Dave Page <dp...@pgadmin.org> wrote:

>
>
> On Tue, Aug 22, 2017 at 1:30 PM, Surinder Kumar <
> surinder.ku...@enterprisedb.com> wrote:
>
>> Hi
>>
>> *Issue:*
>>
>> The user seems to enter sometimes paths with quotes and sometimes add
>> spaces which lead to failure of Backup, Restore or Maintenance utility.
>>
>> *Changes:*
>>
>>  - Added a note in help string `Note: Don't add quote(s) or space(s)
>> before or after the path.`
>>
>>  - Remove whitespace before/after the value before it gets saved.
>>
>> Please find attached patch and review.
>>
>
> I wonder if the more appropriate fix here would be to add a new setting
> type (perhaps two, one for directory and one for file), which is rendered
> with a browse button in the prefs panel, and includes real validation.
>
​Yes, the suggested way is a better way.
I will check what changes we have to made in preferences code to add
support for new setting type and validations.

>
> Stripping spaces and warning about quotes seems like it's just kicking the
> basic problem down the road a few feet.
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>


[pgAdmin4][Patch]: RM_ 2658 - Improve help message for "binary paths" entered in Preferences

2017-08-22 Thread Surinder Kumar
Hi

*Issue:*

The user seems to enter sometimes paths with quotes and sometimes add
spaces which lead to failure of Backup, Restore or Maintenance utility.

*Changes:*

 - Added a note in help string `Note: Don't add quote(s) or space(s) before
or after the path.`

 - Remove whitespace before/after the value before it gets saved.

Please find attached patch and review.

Thanks,
Surinder


RM_2658.patch
Description: Binary data


[pgAdmin4] [pgAgent] [Patch]: RM_ 2657 - Syntax error while saving changes when start/end time is changed from scheduler

2017-08-22 Thread Surinder Kumar
Hi

*Issues fixed:*

 - Syntax error while saving changes when start/end time is updating in
Edit mode.
 - The data type of `jscstart` should be `timestamptz` not `text`.

Please find attached patch and review.

Thanks,
Surinder


RM_2657.patch
Description: Binary data


Re: pgAdmin4 - Tree view icons for final reveiw

2017-08-22 Thread Surinder Kumar
Hi Chethana,

The icons dimensions seem to vary in attached SVG. I have attached
screenshot.
Ideally, the icon(s) must fit(take full width/height) in the dimensions
either it is 16x16 or 14x14. because we will not adjust the pixels for each
icon.

Can you please tell what are the dimensions for an icon we are going to use?

Thanks,
Surinder

On Tue, Aug 22, 2017 at 11:17 AM, Murtuza Zabuawala <
murtuza.zabuaw...@enterprisedb.com> wrote:

> Hi Chethana,
>
> - The icons for Server node is missing, we will need given set of icons
> for server.
> 1) Basic Server icon (Disconnect state)
> 2) PG (Connected state)
> 3) EPAS (Connected state)
> 4) GreenPlum (Connected state)
> [Attaching current icons for PG & EPAS, I'm not sure about GreenPlum
> server icon.]
>
> - I'm not sure where we will use serverbad icon from 'tree_view_Icons.svg'
> file as it looks like server-group icon and not individual server.
>
> - Icon set for Schema & Catalog (both collection and individual) looks
> very similar to each other with minor colour difference, we have to look
> very carefully to identify them each.
>
> - Why do we require two different set of icons for Tables & Columns, I
> mean one for Schema and one for Catalog?
>
> - Icons for Partition node is same for collection and individual.
>
> - Icons for Event trigger node and Trigger node are very different from
> each other despite both are triggers.
>
> I know this is out of context but in my own opinion these icons have
> resemblance with Flat design where as rest of our application is in 2d
> design, for example buttons, dialogs etc.
>
> --
> Regards,
> Murtuza Zabuawala
> EnterpriseDB: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
>
>
> On Tue, Aug 22, 2017 at 9:37 AM, Chethana Kumar <
> chethana.ku...@enterprisedb.com> wrote:
>
>> Yes Shirley, I have already thought through on it.
>> Basically, we need to have one more set of icons in white color mode so
>> that we can use it on dialog headers as well.
>> As the blue theme icons won't fit there.
>>
>> Please share your thoughts.
>>
>> Regards,
>> Chethana kumar
>>
>> On Tue, Aug 22, 2017 at 4:32 AM, Shirley Wang  wrote:
>>
>>> Hi Chethana,
>>>
>>> I just thought of something with these icons. What happens with the ones
>>> that appear in dialog headers? In the blue bar?
>>>
>>> On Mon, Aug 21, 2017 at 8:31 AM Chethana Kumar <
>>> chethana.ku...@enterprisedb.com> wrote:
>>>
 Hello Team,

 I have applied labels for each icon for identification purpose.  So
 please consider this copy for your feedback.

 *Note*: The "icon_demo.png" is attached to show case the view on
 webpage.

 Regards,
 Chethana kumar

 On Mon, Aug 21, 2017 at 3:57 PM, Chethana Kumar <
 chethana.ku...@enterprisedb.com> wrote:

> Hello Team,
>
> Here are the revised and final icons for tree view control.
> I have attached in .svg file format as well so that you can do zoom in
> view at any level.
>
> Please share your feedback on the same.
>
>
> Thanks and regards,
>
> Chethana Kumar
> Principal UI/UX Designer
> EnterpriseDB Corporation
>
>
> The Postgres Database Company
>
> P: +91 86981 57146 <+91%2086981%2057146>
> www.enterprisedb.com
>



 --
 Chethana Kumar
 Principal UI/UX Designer
 EnterpriseDB Corporation


 The Postgres Database Company

 P: +91 86981 57146 <+91%2086981%2057146>
 www.enterprisedb.com

>>>
>>
>>
>> --
>> Chethana Kumar
>> Principal UI/UX Designer
>> EnterpriseDB Corporation
>>
>>
>> The Postgres Database Company
>>
>> P: +91 86981 57146
>> www.enterprisedb.com
>>
>
>


[pgAdmin4][Patch]: RM_ 2654 - Unable to set start and end time while creating pgAgent Job

2017-08-21 Thread Surinder Kumar
Hi,

The bootstrap-datetimepicker
 library being used
was an older version which had this issue.
So updated the bootstrap-datetimepicker library to the latest
 one and this issue
is fixed in newer version.

Please find attached patch and review.

Thanks,
Surinder


RM_2654.patch
Description: Binary data


[pgAdmin4][Patch]: RM_ 2582 - Backup : Fix compression value

2017-08-16 Thread Surinder Kumar
Hi

*Issue:*
In Backup, compression field can only accept values between 0 to 9. But if
the field is clicked, an empty value is set into the model, So, added a
check to remove the model attribute if the field is an empty string before
data is sent to the server.

Please find attached patch.

Thanks,
Surinder


RM_2582.patch
Description: Binary data


Re: [pgAdmin4][Patch]: RM_2596 - Query tool not working in Desktop Runtime on Mac OS X

2017-08-16 Thread Surinder Kumar
Hi,

Updated patch contains changes:

   - Enable definePlugin for development environment as well. Just adding
   definePlugin in plugins array.
   The variable process.env.NODE_ENV is useful to write conditional code in
   pgAdmin4 JS modules.

For example:

if (process.env.NODE_ENV !== 'production') {
  // Write development environment specific code
} else {
  // Write production only code.
}

Please review this patch and let me know for changes.

Thanks,
Surinder
​

On Tue, Aug 1, 2017 at 11:32 AM, Surinder Kumar <
surinder.ku...@enterprisedb.com> wrote:

> Hi Ashesh,
>
> 1. Now we are using `envType` variable in definePlugin which sets
> environment variable NODE_ENV globally which is used by React to create
> development or production build.
> where:
>  envType - determine build type is either `production` or
> `development`​ depending on the environment set in package.json > scripts.
>
> 2. In `UglifyJSPlugin`, i am setting compress > `warnings to false`,
> because here warning flag is meant to display warnings on terminal while
> creating build in production mode. so it is set to false.
>
> I didn't created an RM for #2 as it is minor change, if needed, i will
> create.
>
> ​Reference to webpack definePlugin:
> https://webpack.js.org/guides/production/#node-environment-variable​
>
> Please find updated patch with fixed review comments and review.
>
> Thanks,
> Surinder
>
> On Mon, Jul 31, 2017 at 3:31 PM, Ashesh Vashi <
> ashesh.va...@enterprisedb.com> wrote:
>
>> On Fri, Jul 28, 2017 at 12:42 PM, Surinder Kumar <
>> surinder.ku...@enterprisedb.com> wrote:
>>
>>> Hi,
>>>
>>> I inspect the react code and in call stacks, found
>>> `process.env.NODE_ENV` is undefined due to which 'SyntheticEvent.call' is
>>> not callable.
>>>
>>> So, to fix this, i add 'definePlugin' to plugins for `dev` environment
>>> in `webpack.config.js`. Initially it was added only for `production`
>>> environment. but it is needed for both, because React code is conditional
>>> based on environment variables set.
>>>
>>
>>> Please find attached patch and review.
>>>
>> As discussed, you're setting 'production', even in the 'development' mode.
>>
>> Please understand the code, and share the updated patch.
>> Also - share the references next time, so that - committer can understand
>> the reason for these changes.
>>
>> -- Thanks, Ashesh
>>
>>>
>>> Thanks,
>>> Surinder
>>>
>>
>>
>


RM_2596_v2.patch
Description: Binary data


Re: [pgAdmin4][patch] update the alert style in the sub-navigation

2017-08-15 Thread Surinder Kumar
Hi Violet,

I have already reviewed this patch. Here is the link
<https://www.postgresql.org/message-id/CAM5-9D8UJVgCD0MrKq6yPx0qx9k8v3r6_4e8SkHdGV1RBDnhbQ%40mail.gmail.com>
.

Thanks,
Surinder

On Wed, Aug 16, 2017 at 8:57 AM, Violet Cheng <vch...@pivotal.io> wrote:

> Hi,
>
> Any update on this patch? Could it be committed soon?
>
> Thanks,
> Violet
>
> On Fri, Aug 11, 2017 at 1:40 PM, Sarah McAlear <smcal...@pivotal.io>
> wrote:
>
>> Hi!
>>
>> We fixed that issue and created a new patch
>> <https://www.postgresql.org/message-id/flat/CAGRPzo9wUDtYE2jFz-%3DPbJr%2Btf20zyFncdEoAFdVMkTgoXzf3w%40mail.gmail.com>
>> .
>>
>> Thanks!
>>
>> On Thu, Aug 10, 2017 at 4:10 PM, Violet Cheng <vch...@pivotal.io> wrote:
>>
>>> Here's the Redmine link
>>>
>>> https://redmine.postgresql.org/issues/2644
>>>
>>> On Thu, Aug 10, 2017 at 4:03 PM, Violet Cheng <vch...@pivotal.io> wrote:
>>>
>>>> Hi Surinder!
>>>>
>>>> Are you referring to the green message popup? If so, it also appears to
>>>> be happening on master. We'll log a bug in our backlog and Redmine and
>>>> prioritize it. We agree that it needs to be fixed, but don't think it's
>>>> unrelated to this patch.
>>>>
>>>> Thanks!
>>>> Violet & Sarah
>>>>
>>>> On Thu, Aug 10, 2017 at 2:32 PM, Surinder Kumar <
>>>> surinder.ku...@enterprisedb.com> wrote:
>>>>
>>>>> Please find attached screenshot.
>>>>>
>>>>> On Thu, Aug 10, 2017 at 11:30 AM, Surinder Kumar <
>>>>> surinder.ku...@enterprisedb.com> wrote:
>>>>>
>>>>>> Hi Sarah,
>>>>>>
>>>>>> We noticed that due to this patch, the alert style of "Database
>>>>>> connected" message is changed.
>>>>>> Can you please look into this?
>>>>>>
>>>>>> Thanks,
>>>>>> Surinder
>>>>>>
>>>>>> On Wed, Aug 9, 2017 at 4:43 PM, Surinder Kumar <
>>>>>> surinder.ku...@enterprisedb.com> wrote:
>>>>>>
>>>>>>> ​Hi,
>>>>>>>
>>>>>>> ​The updated patch looks good to me.
>>>>>>>
>>>>>>> On Wed, Aug 9, 2017 at 4:15 PM, Sarah McAlear <smcal...@pivotal.io>
>>>>>>> wrote:
>>>>>>>
>>>>>>>> As discussed with Surinder, we have created a Redmine ticket for
>>>>>>>> his 4th comment regarding the error message not showing up when the app
>>>>>>>> can't be reached. This issue existed prior to this patch and should be
>>>>>>>> prioritized.
>>>>>>>>
>>>>>>>> https://redmine.postgresql.org/issues/2640
>>>>>>>>
>>>>>>>> Thanks!
>>>>>>>> Matt & Sarah
>>>>>>>>
>>>>>>>> On Wed, Aug 9, 2017 at 4:06 PM, Sarah McAlear <smcal...@pivotal.io>
>>>>>>>> wrote:
>>>>>>>>
>>>>>>>>> Hi Surinder!
>>>>>>>>>
>>>>>>>>> I am not able to see anything different from what I see on Master
>>>>>>>>> with or without the patch applied. I tried adjusting the preferences. 
>>>>>>>>> I did
>>>>>>>>> update the dashboard.js to instantiate a new object, great idea!
>>>>>>>>>
>>>>>>>>> Thanks,
>>>>>>>>> Sarah
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Wed, Aug 9, 2017 at 1:42 PM, Surinder Kumar <
>>>>>>>>> surinder.ku...@enterprisedb.com> wrote:
>>>>>>>>>
>>>>>>>>>> Hi Wenlin,
>>>>>>>>>>
>>>>>>>>>> On Tue, Aug 8, 2017 at 3:15 PM, Wenlin Zhang <wzh...@pivotal.io>
>>>>>>>>>> wrote:
>>>>>>>>>>
>>>>>>>>>>> Hi Surinder,
>>>>>>>>>>>
>>>>>>>>>>>Thanks for your review.
>>>>>>>>>>>
>>>

[pgAdmin4][Patch]: RM_2646 - Spinner icon not found error when a server node is connected

2017-08-11 Thread Surinder Kumar
Hi

Since Acitree is removed from vendor directory, but when a server is
connected, the load-node.gif file is still referencing tovendor directory
instead of referencing to static/js/generated/load-node.gif.

Fixed the reference path, now it points to static/js/generated/laod-node.gif
.

Please find attached patch and review.

Thanks,
Surinder
​


RM_2646.patch
Description: Binary data


Re: [pgadmin4][patch] Fix the style of the alert when connecting/disconnecting from a server

2017-08-11 Thread Surinder Kumar
Hi

I reviewed this patch and it looks good to me.

Thanks,
Surinder

On Fri, Aug 11, 2017 at 9:13 AM, Sarah McAlear  wrote:

> Hi Hackers!
>
> This patch applies to RM 2644 .
> It fixes the styling of the checkmark area.
>
> Thanks!
> Sarah
>
>
>


Re: [pgAdmin4][patch] update the alert style in the sub-navigation

2017-08-10 Thread Surinder Kumar
Hi Sarah,

We noticed that due to this patch, the alert style of "Database connected"
message is changed.
Can you please look into this?

Thanks,
Surinder

On Wed, Aug 9, 2017 at 4:43 PM, Surinder Kumar <
surinder.ku...@enterprisedb.com> wrote:

> ​Hi,
>
> ​The updated patch looks good to me.
>
> On Wed, Aug 9, 2017 at 4:15 PM, Sarah McAlear <smcal...@pivotal.io> wrote:
>
>> As discussed with Surinder, we have created a Redmine ticket for his 4th
>> comment regarding the error message not showing up when the app can't be
>> reached. This issue existed prior to this patch and should be prioritized.
>>
>> https://redmine.postgresql.org/issues/2640
>>
>> Thanks!
>> Matt & Sarah
>>
>> On Wed, Aug 9, 2017 at 4:06 PM, Sarah McAlear <smcal...@pivotal.io>
>> wrote:
>>
>>> Hi Surinder!
>>>
>>> I am not able to see anything different from what I see on Master with
>>> or without the patch applied. I tried adjusting the preferences. I did
>>> update the dashboard.js to instantiate a new object, great idea!
>>>
>>> Thanks,
>>> Sarah
>>>
>>>
>>>
>>> On Wed, Aug 9, 2017 at 1:42 PM, Surinder Kumar <
>>> surinder.ku...@enterprisedb.com> wrote:
>>>
>>>> Hi Wenlin,
>>>>
>>>> On Tue, Aug 8, 2017 at 3:15 PM, Wenlin Zhang <wzh...@pivotal.io> wrote:
>>>>
>>>>> Hi Surinder,
>>>>>
>>>>>Thanks for your review.
>>>>>
>>>>>We have changed the indentation for _dashboard.scss file and also
>>>>> removed the style about icon-postgres:before, like margin-top,etc,
>>>>> but we are not sure if it is perfectly aligned now, you can add further
>>>>> change to it.
>>>>>
>>>>> As the second comment, I'm sorry I'm not sure what's the problem,
>>>>> could you please clarify it? Because we replace css with scss right now,
>>>>> dashboard.css doesn't exist. So maybe you are looking at the css file that
>>>>> are complied by the scss?
>>>>>
>>>> ​Sorry I​ typed 'dashboard.css' instead of 'dashboard.js'.
>>>> ​In dashboard.js can we change `return DashboardAlert;` to `return new
>>>> DashboardAlert();`
>>>> and then we can remove the instances being created(var alertDashboard =
>>>> new AlertDashboard();) from dashboard.js, and simply
>>>> use `AlertDashboard.info('message')`.
>>>>
>>>>
>>>>> For the fourth comment, we tried the steps you suggested on master
>>>>> branch, the error is not shown either. So it should be an existing issue.
>>>>> But if you want to see the error message, navigate to "Servers" at the top
>>>>> of browser, then navigate back to postgresql server, then you will see the
>>>>> error message.
>>>>>
>>>> ​The error in console will appear when you selected a database which is
>>>> connected and stop the backend Python server because the request for graphs
>>>> for database level will fail and there is no response returned from server.
>>>> It might be not reproducible to you If you set the refresh rate to
>>>> higher value (i.e. Preferences > Graphs) in preferences. Just set refresh
>>>> rate to 1 for all dashboard graphs and repeat the steps.
>>>>
>>>>>
>>>>>
>>>>> Thanks,
>>>>>
>>>>> Wenlin 
>>>>>
>>>>>
>>>>>
>>>>> On Mon, Aug 7, 2017 at 2:30 PM, Surinder Kumar <
>>>>> surinder.ku...@enterprisedb.com> wrote:
>>>>>
>>>>>> Hi
>>>>>> Review comments:
>>>>>>
>>>>>>1.
>>>>>>
>>>>>>For consistency, we use two spaces for indentation in CSS files.
>>>>>>Four spaces are used in _dashboard.scss file. The configurations
>>>>>>are defined in web/.editorconfig file.
>>>>>>2.
>>>>>>
>>>>>>In,dashboard.css Can we return function object in return instead
>>>>>>of function class itself, this will eliminate the need of creating 
>>>>>> function
>>>>>>object every time we use info and error?
>>>>>>3.
>>>>>>
>>>>>>On

[pgAdmin4][Patch]: Add command under scripts to run webpack bundle in watch mode

2017-08-09 Thread Surinder Kumar
Hi

Currently, whenever we are making a change in JS file, we have to re-run
bundle script again to generate all bundles again, which takes time and it
is pain for developers to watch it till finished.

So Webpack `watch` option lets the Webapck watch for changes in the file
and compiles only files which are changed after the initial build.

Also added an option `--progress` which updates on terminal about packages
being built and percentage completed.

So, you can run bundle in watch mode in terminal:

``` $ yarn run bundle:watch ```

Reference [link](
https://webpack.js.org/configuration/watch/#components/sidebar/sidebar.jsx)

Please review the patch

Thanks,
Surinder Kumar


Add_watch_mode_in_scripts.patch
Description: Binary data


Re: [pgAdmin4][patch] update the alert style in the sub-navigation

2017-08-09 Thread Surinder Kumar
​Hi,

​The updated patch looks good to me.

On Wed, Aug 9, 2017 at 4:15 PM, Sarah McAlear <smcal...@pivotal.io> wrote:

> As discussed with Surinder, we have created a Redmine ticket for his 4th
> comment regarding the error message not showing up when the app can't be
> reached. This issue existed prior to this patch and should be prioritized.
>
> https://redmine.postgresql.org/issues/2640
>
> Thanks!
> Matt & Sarah
>
> On Wed, Aug 9, 2017 at 4:06 PM, Sarah McAlear <smcal...@pivotal.io> wrote:
>
>> Hi Surinder!
>>
>> I am not able to see anything different from what I see on Master with or
>> without the patch applied. I tried adjusting the preferences. I did update
>> the dashboard.js to instantiate a new object, great idea!
>>
>> Thanks,
>> Sarah
>>
>>
>>
>> On Wed, Aug 9, 2017 at 1:42 PM, Surinder Kumar <
>> surinder.ku...@enterprisedb.com> wrote:
>>
>>> Hi Wenlin,
>>>
>>> On Tue, Aug 8, 2017 at 3:15 PM, Wenlin Zhang <wzh...@pivotal.io> wrote:
>>>
>>>> Hi Surinder,
>>>>
>>>>Thanks for your review.
>>>>
>>>>We have changed the indentation for _dashboard.scss file and also
>>>> removed the style about icon-postgres:before, like margin-top,etc, but
>>>> we are not sure if it is perfectly aligned now, you can add further change
>>>> to it.
>>>>
>>>> As the second comment, I'm sorry I'm not sure what's the problem,
>>>> could you please clarify it? Because we replace css with scss right now,
>>>> dashboard.css doesn't exist. So maybe you are looking at the css file that
>>>> are complied by the scss?
>>>>
>>> ​Sorry I​ typed 'dashboard.css' instead of 'dashboard.js'.
>>> ​In dashboard.js can we change `return DashboardAlert;` to `return new
>>> DashboardAlert();`
>>> and then we can remove the instances being created(var alertDashboard =
>>> new AlertDashboard();) from dashboard.js, and simply
>>> use `AlertDashboard.info('message')`.
>>>
>>>
>>>> For the fourth comment, we tried the steps you suggested on master
>>>> branch, the error is not shown either. So it should be an existing issue.
>>>> But if you want to see the error message, navigate to "Servers" at the top
>>>> of browser, then navigate back to postgresql server, then you will see the
>>>> error message.
>>>>
>>> ​The error in console will appear when you selected a database which is
>>> connected and stop the backend Python server because the request for graphs
>>> for database level will fail and there is no response returned from server.
>>> It might be not reproducible to you If you set the refresh rate to
>>> higher value (i.e. Preferences > Graphs) in preferences. Just set refresh
>>> rate to 1 for all dashboard graphs and repeat the steps.
>>>
>>>>
>>>>
>>>> Thanks,
>>>>
>>>> Wenlin 
>>>>
>>>>
>>>>
>>>> On Mon, Aug 7, 2017 at 2:30 PM, Surinder Kumar <
>>>> surinder.ku...@enterprisedb.com> wrote:
>>>>
>>>>> Hi
>>>>> Review comments:
>>>>>
>>>>>1.
>>>>>
>>>>>For consistency, we use two spaces for indentation in CSS files.
>>>>>Four spaces are used in _dashboard.scss file. The configurations
>>>>>are defined in web/.editorconfig file.
>>>>>2.
>>>>>
>>>>>In,dashboard.css Can we return function object in return instead
>>>>>of function class itself, this will eliminate the need of creating 
>>>>> function
>>>>>object every time we use info and error?
>>>>>3.
>>>>>
>>>>>On Dashboard, I can see Postgres icon is misaligned compared to
>>>>>other icons in Getting Started section. It is not related to this
>>>>>patch. adjusting margin top will fix it.
>>>>>4.
>>>>>
>>>>>I tried to test out Error message displayed, but I encounter an
>>>>>error(screenshot attached).
>>>>>Steps to reproduce:
>>>>>   - Open pgAdmin4 in browser
>>>>>   - Connect to PostgreSQL Server, Keep dashboard tab open.
>>>>>   - Navigate to the database which is connected.
>>>&

Re: Unified server/desktop config

2017-08-09 Thread Surinder Kumar
Sure, I will update.

On Wed, Aug 9, 2017 at 11:17 AM, Dave Page <dp...@pgadmin.org> wrote:

> Please update the patch :-)
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK:http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
> On 9 Aug 2017, at 05:53, Surinder Kumar <surinder.ku...@enterprisedb.com>
> wrote:
>
> Hi,
>
> I noticed that test cases don’t run and I got an error:
>
> (pgAdmin_27)Laptop195:regression surinder$ python runtests.py --pkg 
> feature_tests
> 
> Traceback (most recent call last):
>   File "runtests.py", line 45, in 
> import config
>   File "/Users/surinder/Documents/Projects/pgadmin4/web/config.py", line 121, 
> in 
> if builtins.SERVER_MODE is None:
> AttributeError: 'module' object has no attribute'
> SERVER_MODE
> '
>
> I think this is because we are setting​ ​first​ ​builtins.SERVER_MODE​ in​ 
> ​pgAdmin4.py
> but in test cases pgAdmin4.py is not being called.​
>
>
> On Tue, Aug 8, 2017 at 4:03 PM, Dave Page <dp...@pgadmin.org> wrote:
>
>>
>>
>> On Tue, Aug 8, 2017 at 11:27 AM, Surinder Kumar <
>> surinder.ku...@enterprisedb.com> wrote:
>>
>>> On Tue, Aug 8, 2017 at 1:47 PM, Dave Page <dp...@pgadmin.org> wrote:
>>>
>>>
>>>>
>>>> On Tue, Aug 8, 2017 at 7:18 AM, Surinder Kumar <
>>>> surinder.ku...@enterprisedb.com> wrote:
>>>>
>>>>> Hi
>>>>>
>>>>> On Ubuntu-14.04, I got error Application Server couldn't be contacted:
>>>>>
>>>>> *Steps performed:*
>>>>>
>>>>>- I have already installed pgAdmin4-1.4 which come with
>>>>>PostgreSQL-9.6 installer.
>>>>>then I run root@ubuntu:/opt/PostgreSQL/9.6/pgAdmin 4/bin#
>>>>>./pgAdmin4./.
>>>>>- Now took latest git pull from HEAD
>>>>>- Apply unified_config.diff patch.
>>>>>- Then compiled pgAdmin4 in runtime and then run ./pgAdmin.
>>>>>- Got error Application Server couldn't be contacted.
>>>>>
>>>>> But when I ran ./pgAdmin4 for the second time. pgAdmin4 runs without
>>>>> any issue.
>>>>> I didn’t get any error on the terminal and log file.
>>>>> ​ I couldn't find why it gives this error.​
>>>>>
>>>>
>>>> I know Fahar has run into this with existing releases on Ubuntu. If you
>>>> enable debugging, can you see any clues? I assume it's going round the
>>>> retry loop before aborting?
>>>>
>>>>> *Another issue related to Alembic:*
>>>>>
>>>>> If I am running pgAdmin4 already installed on my machine, then I
>>>>> upgrade pgAdmin4 using Python wheel:
>>>>>
>>>>> (test_p27) surinder@ubuntu:~/virtualenvs/test_p27$ python
>>>>> ~/virtualenvs/test_p27/lib/python2.7/site-packages/pgadmin4/
>>>>> pgAdmin4.py
>>>>>
>>>>> *I am getting error:*
>>>>>
>>>>> alembic.util.exc.CommandError: Can't locate revision identified by
>>>>> 'd85a62333272'
>>>>>
>>>>> To fix this, I have to delete existing pgadmin4.db file. I don’t know
>>>>> if it is a valid case or should I log an RM if it is?
>>>>>
>>>> That's an annoying side-effect of the move to Alembic. The previous DB
>>>> code would quite happily (and intentionally) run with a newer version of
>>>> the database, however, the new code does not. You'll see this issue
>>>> whenever you've run a newer version of pgAdmin and then go back to an older
>>>> version that uses an older schema version.
>>>>
>>>> It would be nice to change this so it doesn't complain - but we'd have
>>>> to be cautious to only break compatibility on major releases.
>>>>
>>>>
>>>>
>>>>> Apart for this, I didn’t see any functionality break. It works!!
>>>>> ​
>>>>>
>>>>> I liked the approach to set SEVER_MODE in runtime using built-ins.
>>>>>
>>>> Thanks. Do you think it warrants a 2.0 version number, given the
>>>> potential for breaking existing installations (I do, but would like other
>>>> feedback)? If we do that - and thus allow a parallel installation of 1.x
>>>> and 2.x), how would we resolve the Alembic issu

Re: [pgAdmin4][patch] update the alert style in the sub-navigation

2017-08-08 Thread Surinder Kumar
Hi Wenlin,

On Tue, Aug 8, 2017 at 3:15 PM, Wenlin Zhang <wzh...@pivotal.io> wrote:

> Hi Surinder,
>
>Thanks for your review.
>
>We have changed the indentation for _dashboard.scss file and also
> removed the style about icon-postgres:before, like margin-top,etc, but we
> are not sure if it is perfectly aligned now, you can add further change to
> it.
>
> As the second comment, I'm sorry I'm not sure what's the problem,
> could you please clarify it? Because we replace css with scss right now,
> dashboard.css doesn't exist. So maybe you are looking at the css file that
> are complied by the scss?
>
​Sorry I​ typed 'dashboard.css' instead of 'dashboard.js'.
​In dashboard.js can we change `return DashboardAlert;` to `return new
DashboardAlert();`
and then we can remove the instances being created(var alertDashboard = new
AlertDashboard();) from dashboard.js, and simply
use `AlertDashboard.info('message')`.


> For the fourth comment, we tried the steps you suggested on master
> branch, the error is not shown either. So it should be an existing issue.
> But if you want to see the error message, navigate to "Servers" at the top
> of browser, then navigate back to postgresql server, then you will see the
> error message.
>
​The error in console will appear when you selected a database which is
connected and stop the backend Python server because the request for graphs
for database level will fail and there is no response returned from server.
It might be not reproducible to you If you set the refresh rate to higher
value (i.e. Preferences > Graphs) in preferences. Just set refresh rate to
1 for all dashboard graphs and repeat the steps.

>
>
> Thanks,
>
> Wenlin 
>
>
>
> On Mon, Aug 7, 2017 at 2:30 PM, Surinder Kumar <
> surinder.ku...@enterprisedb.com> wrote:
>
>> Hi
>> Review comments:
>>
>>1.
>>
>>For consistency, we use two spaces for indentation in CSS files. Four
>>spaces are used in _dashboard.scss file. The configurations are
>>defined in web/.editorconfig file.
>>2.
>>
>>In,dashboard.css Can we return function object in return instead of
>>function class itself, this will eliminate the need of creating function
>>object every time we use info and error?
>>3.
>>
>>On Dashboard, I can see Postgres icon is misaligned compared to other
>>icons in Getting Started section. It is not related to this patch.
>>adjusting margin top will fix it.
>>4.
>>
>>I tried to test out Error message displayed, but I encounter an
>>error(screenshot attached).
>>Steps to reproduce:
>>   - Open pgAdmin4 in browser
>>   - Connect to PostgreSQL Server, Keep dashboard tab open.
>>   - Navigate to the database which is connected.
>>   - Now disconnect pgAdmin4 python server.
>>   ​
>>
>> ​Here I mean Stop Python server. I​


>
>>1.
>>   - ​
>>   - No error message is displayed on Dashboard because it breaks in
>>   JS as xhr.responseText is empty.
>>   However, it might be an existing issue.
>>
>> Thanks,
>> Surinder
>>
>> On Mon, Aug 7, 2017 at 10:40 AM, Wenlin Zhang <wzh...@pivotal.io> wrote:
>>
>> Hi Ashesh,
>>>
>>> That's correct. This patch just changed alert style in the 'tabs',
>>> such as Dependency and Dependents.
>>>
>>> Thanks
>>>
>>> Wenlin
>>>
>>> On Mon, Aug 7, 2017 at 12:51 PM, Ashesh Vashi <
>>> ashesh.va...@enterprisedb.com> wrote:
>>>
>>>> Surinder,
>>>>
>>>> Please take a look at this patch.
>>>>
>>>> If I recalls correctly, this patch is related to styling of the 'tabs'
>>>> shown on the main window.
>>>> Wenlin - please correct me if my understanding is wrong.
>>>>
>>>> --
>>>>
>>>> Thanks & Regards,
>>>>
>>>> Ashesh Vashi
>>>> EnterpriseDB INDIA: Enterprise PostgreSQL Company
>>>> <http://www.enterprisedb.com>
>>>>
>>>>
>>>> *http://www.linkedin.com/in/asheshvashi*
>>>> <http://www.linkedin.com/in/asheshvashi>
>>>>
>>>> On Mon, Aug 7, 2017 at 8:11 AM, Sarah McAlear <smcal...@pivotal.io>
>>>> wrote:
>>>>
>>>>> Hi hackers,
>>>>>
>>>>> Could you please review this patch?
>>>>>
>>>>> Thanks
>>>>>
>>>>> Wenlin and Sarah
>>>>>
>>>>> On Wed, Aug 2, 2017 at 2:15 PM, Wenlin Zhang <wzh...@pivotal.io>
>>>>> wrote:
>>>>>
>>>>>> Hi Hackers,
>>>>>>
>>>>>> This patch changes the alert style in the sub-navigation to match
>>>>>> style guide.
>>>>>>
>>>>>> Thanks,
>>>>>> Wenlin, Shirley & Sarah
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>
>>> ​
>>
>
>


Re: Unified server/desktop config

2017-08-08 Thread Surinder Kumar
Hi,

I noticed that test cases don’t run and I got an error:

(pgAdmin_27)Laptop195:regression surinder$ python runtests.py --pkg
feature_tests

Traceback (most recent call last):
  File "runtests.py", line 45, in 
import config
  File "/Users/surinder/Documents/Projects/pgadmin4/web/config.py",
line 121, in 
if builtins.SERVER_MODE is None:
AttributeError: 'module' object has no attribute'
SERVER_MODE
'

I think this is because we are setting​ ​first​ ​builtins.SERVER_MODE​
in​ ​pgAdmin4.py
but in test cases pgAdmin4.py is not being called.​


On Tue, Aug 8, 2017 at 4:03 PM, Dave Page <dp...@pgadmin.org> wrote:

>
>
> On Tue, Aug 8, 2017 at 11:27 AM, Surinder Kumar <
> surinder.ku...@enterprisedb.com> wrote:
>
>> On Tue, Aug 8, 2017 at 1:47 PM, Dave Page <dp...@pgadmin.org> wrote:
>>
>>
>>>
>>> On Tue, Aug 8, 2017 at 7:18 AM, Surinder Kumar <
>>> surinder.ku...@enterprisedb.com> wrote:
>>>
>>>> Hi
>>>>
>>>> On Ubuntu-14.04, I got error Application Server couldn't be contacted:
>>>>
>>>> *Steps performed:*
>>>>
>>>>- I have already installed pgAdmin4-1.4 which come with
>>>>PostgreSQL-9.6 installer.
>>>>then I run root@ubuntu:/opt/PostgreSQL/9.6/pgAdmin 4/bin#
>>>>./pgAdmin4./.
>>>>- Now took latest git pull from HEAD
>>>>- Apply unified_config.diff patch.
>>>>- Then compiled pgAdmin4 in runtime and then run ./pgAdmin.
>>>>- Got error Application Server couldn't be contacted.
>>>>
>>>> But when I ran ./pgAdmin4 for the second time. pgAdmin4 runs without
>>>> any issue.
>>>> I didn’t get any error on the terminal and log file.
>>>> ​ I couldn't find why it gives this error.​
>>>>
>>>
>>> I know Fahar has run into this with existing releases on Ubuntu. If you
>>> enable debugging, can you see any clues? I assume it's going round the
>>> retry loop before aborting?
>>>
>>>> *Another issue related to Alembic:*
>>>>
>>>> If I am running pgAdmin4 already installed on my machine, then I
>>>> upgrade pgAdmin4 using Python wheel:
>>>>
>>>> (test_p27) surinder@ubuntu:~/virtualenvs/test_p27$ python
>>>> ~/virtualenvs/test_p27/lib/python2.7/site-packages/pgadmin4/pgAdmin4.py
>>>>
>>>> *I am getting error:*
>>>>
>>>> alembic.util.exc.CommandError: Can't locate revision identified by
>>>> 'd85a62333272'
>>>>
>>>> To fix this, I have to delete existing pgadmin4.db file. I don’t know
>>>> if it is a valid case or should I log an RM if it is?
>>>>
>>> That's an annoying side-effect of the move to Alembic. The previous DB
>>> code would quite happily (and intentionally) run with a newer version of
>>> the database, however, the new code does not. You'll see this issue
>>> whenever you've run a newer version of pgAdmin and then go back to an older
>>> version that uses an older schema version.
>>>
>>> It would be nice to change this so it doesn't complain - but we'd have
>>> to be cautious to only break compatibility on major releases.
>>>
>>>
>>>
>>>> Apart for this, I didn’t see any functionality break. It works!!
>>>> ​
>>>>
>>>> I liked the approach to set SEVER_MODE in runtime using built-ins.
>>>>
>>> Thanks. Do you think it warrants a 2.0 version number, given the
>>> potential for breaking existing installations (I do, but would like other
>>> feedback)? If we do that - and thus allow a parallel installation of 1.x
>>> and 2.x), how would we resolve the Alembic issue you noted such that both
>>> versions could be run against the same DB?
>>>
>> To resolve this issue while upgrading to newer version of pgAdmin4, we
>> can add a parameter version_table: 'alembic_version-1.6 in
>> web/migrations/env.py of upcoming pgAdmin4 source code(reference link
>> <https://issues.asterisk.org/jira/secure/attachment/51610/ASTERISK-24311-set-version-table.diff>
>> )
>> It will create a new version table in pgadmin4.db database and it will
>> instruct the Alembic to run migrations for the version stored in
>> table(alembic_version-1.6) when new pgAdmin4 will be installed.
>>
>> I tried to check if it works or not. But somehow I couldn’t install
>> pgAdmin4-1.5 from wheel.
>>
>> Alternatively I will try to generate new sc

Re: Unified server/desktop config

2017-08-08 Thread Surinder Kumar
On Tue, Aug 8, 2017 at 1:47 PM, Dave Page <dp...@pgadmin.org> wrote:


>
> On Tue, Aug 8, 2017 at 7:18 AM, Surinder Kumar <
> surinder.ku...@enterprisedb.com> wrote:
>
>> Hi
>>
>> On Ubuntu-14.04, I got error Application Server couldn't be contacted:
>>
>> *Steps performed:*
>>
>>- I have already installed pgAdmin4-1.4 which come with
>>PostgreSQL-9.6 installer.
>>then I run root@ubuntu:/opt/PostgreSQL/9.6/pgAdmin 4/bin# ./pgAdmin4./
>>.
>>- Now took latest git pull from HEAD
>>- Apply unified_config.diff patch.
>>- Then compiled pgAdmin4 in runtime and then run ./pgAdmin.
>>- Got error Application Server couldn't be contacted.
>>
>> But when I ran ./pgAdmin4 for the second time. pgAdmin4 runs without any
>> issue.
>> I didn’t get any error on the terminal and log file.
>> ​ I couldn't find why it gives this error.​
>>
>
> I know Fahar has run into this with existing releases on Ubuntu. If you
> enable debugging, can you see any clues? I assume it's going round the
> retry loop before aborting?
>
>> *Another issue related to Alembic:*
>>
>> If I am running pgAdmin4 already installed on my machine, then I upgrade
>> pgAdmin4 using Python wheel:
>>
>> (test_p27) surinder@ubuntu:~/virtualenvs/test_p27$ python
>> ~/virtualenvs/test_p27/lib/python2.7/site-packages/pgadmin4/pgAdmin4.py
>>
>> *I am getting error:*
>>
>> alembic.util.exc.CommandError: Can't locate revision identified by
>> 'd85a62333272'
>>
>> To fix this, I have to delete existing pgadmin4.db file. I don’t know if
>> it is a valid case or should I log an RM if it is?
>>
> That's an annoying side-effect of the move to Alembic. The previous DB
> code would quite happily (and intentionally) run with a newer version of
> the database, however, the new code does not. You'll see this issue
> whenever you've run a newer version of pgAdmin and then go back to an older
> version that uses an older schema version.
>
> It would be nice to change this so it doesn't complain - but we'd have to
> be cautious to only break compatibility on major releases.
>
>
>
>> Apart for this, I didn’t see any functionality break. It works!!
>> ​
>>
>> I liked the approach to set SEVER_MODE in runtime using built-ins.
>>
> Thanks. Do you think it warrants a 2.0 version number, given the potential
> for breaking existing installations (I do, but would like other feedback)?
> If we do that - and thus allow a parallel installation of 1.x and 2.x), how
> would we resolve the Alembic issue you noted such that both versions could
> be run against the same DB?
>
To resolve this issue while upgrading to newer version of pgAdmin4, we can
add a parameter version_table: 'alembic_version-1.6 in web/migrations/env.py
of upcoming pgAdmin4 source code(reference link
<https://issues.asterisk.org/jira/secure/attachment/51610/ASTERISK-24311-set-version-table.diff>
)
It will create a new version table in pgadmin4.db database and it will
instruct the Alembic to run migrations for the version stored in
table(alembic_version-1.6) when new pgAdmin4 will be installed.

I tried to check if it works or not. But somehow I couldn’t install
pgAdmin4-1.5 from wheel.

Alternatively I will try to generate new schema using in pgAdmin4 source
code(Git HEAD). It will generate a new migration version and then i will
run pgAdmin4-1.6 from wheel having different migration number. It will
create pgadmin4.db for 1.5.
Then
 I will run pgAdmin4-1.6 from source code, so migration will take place and
hopefully
​the ​
sa
me
​ ​
pgadmin4.db will work for newer pgAdmin4 version.

Reference link <https://issues.asterisk.org/jira/browse/ASTERISK-24311>
where the same issue has been discussed.

Thanks,
Surinder


>
>
>> Thanks,
>> Surinder
>> ​
>>
>> On Mon, Aug 7, 2017 at 7:01 PM, Dave Page <dp...@pgadmin.org> wrote:
>>
>>>
>>>
>>> On Mon, Aug 7, 2017 at 1:43 PM, Surinder Kumar <
>>> surinder.ku...@enterprisedb.com> wrote:
>>>
>>>> Hi,
>>>>
>>>> The patch seems to work in Runtime mode, but fails in Server mode with
>>>> error:
>>>>
>>>> (pgAdmin_27)Laptop195:pgadmin4 surinder$ python web/pgAdmin4.py
>>>> Traceback (most recent call last):
>>>>   File "web/pgAdmin4.py", line 55, in 
>>>> exec(open(file_quote(setupfile), 'r').read())
>>>>   File "", line 35, in 
>>>>   File 
>>>> "/Users/surinder/Documents/Projects/pgadmin4/web/pgadmin/setup/data_directory.py",
>>>&g

Re: [pgAdmin4][PATCH] To fix the add New Server through Quick links on Dashboard

2017-08-08 Thread Surinder Kumar
Hi Murtuza,

As type server-group is renamed to server_group, I can see there are other
occurrences of string server-group which needs to be replaced when I
perform search in pgAdmin4.

Can you please take care of those occurrences?

Thanks,
Surinder

On Tue, Aug 8, 2017 at 12:02 PM, Murtuza Zabuawala
[murtuza.zabuaw...@enterprisedb.com](mailto:murtuza.zabuaw...@enterprisedb.com)

wrote:

Hi,
>
> PFA minor patch to fix the issue where add new server functionality
> through Quick link on Dashboard is broken.
> RM#2634
>
> --
> Regards,
> Murtuza Zabuawala
> EnterpriseDB: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
> [image: https://community.postgresrocks.net/]
> 
>
​


Re: Unified server/desktop config

2017-08-08 Thread Surinder Kumar
Hi

On Ubuntu-14.04, I got error Application Server couldn't be contacted:

*Steps performed:*

   - I have already installed pgAdmin4-1.4 which come with PostgreSQL-9.6
   installer.
   then I run root@ubuntu:/opt/PostgreSQL/9.6/pgAdmin 4/bin# ./pgAdmin4./.
   - Now took latest git pull from HEAD
   - Apply unified_config.diff patch.
   - Then compiled pgAdmin4 in runtime and then run ./pgAdmin.
   - Got error Application Server couldn't be contacted.

But when I ran ./pgAdmin4 for the second time. pgAdmin4 runs without any
issue.
I didn’t get any error on the terminal and log file.
​ I couldn't find why it gives this error.​

*Another issue related to Alembic:*

If I am running pgAdmin4 already installed on my machine, then I upgrade
pgAdmin4 using Python wheel:

(test_p27) surinder@ubuntu:~/virtualenvs/test_p27$ python
~/virtualenvs/test_p27/lib/python2.7/site-packages/pgadmin4/pgAdmin4.py

*I am getting error:*

alembic.util.exc.CommandError: Can't locate revision identified by
'd85a62333272'

To fix this, I have to delete existing pgadmin4.db file. I don’t know if it
is a valid case or should I log an RM if it is?

Apart for this, I didn’t see any functionality break. It works!!

I liked the approach to set SEVER_MODE in runtime using built-ins.

Thanks,
Surinder
​

On Mon, Aug 7, 2017 at 7:01 PM, Dave Page <dp...@pgadmin.org> wrote:

>
>
> On Mon, Aug 7, 2017 at 1:43 PM, Surinder Kumar <
> surinder.ku...@enterprisedb.com> wrote:
>
>> Hi,
>>
>> The patch seems to work in Runtime mode, but fails in Server mode with
>> error:
>>
>> (pgAdmin_27)Laptop195:pgadmin4 surinder$ python web/pgAdmin4.py
>> Traceback (most recent call last):
>>   File "web/pgAdmin4.py", line 55, in 
>> exec(open(file_quote(setupfile), 'r').read())
>>   File "", line 35, in 
>>   File 
>> "/Users/surinder/Documents/Projects/pgadmin4/web/pgadmin/setup/data_directory.py",
>>  line 23, in create_app_data_directory
>> _create_directory_if_not_exists(os.path.dirname(config.SQLITE_PATH))
>>   File 
>> "/Users/surinder/Documents/Projects/pgadmin4/web/pgadmin/setup/data_directory.py",
>>  line 15, in _create_directory_if_not_exists
>> os.mkdir(_path)
>> OSError: [Errno 13] Permission denied: '/var/lib/pgadmin'
>> (pgAdmin_27)Laptop195:pgadmin4 surinder$
>>
>> This is because the directory /var/lib/ has root only access and I am
>> running pgAdmin4 with the non-root user.
>>
>> Also pgadmin directory is not created.
>>
>> (pgAdmin_35)Laptop195:pgadmin4 surinder$ ls /var/lib/pgadmin
>> ls: /var/lib/pgadmin: No such file or directory
>>
>> I got same error with MacOSX and Ubuntu-14.04 machines irrespective of
>> Python version.
>>
>> Meanwhile, I am testing patch with other test cases.
>>
> That's fully expected. In the case of Linux, the packages will be
> responsible for creating those directories with the appropriate ownership.
> In other cases, the user would.
>
​ok, I got it.​

>
> There's not really much we can do about that - and it's exactly what would
> happen if you try to run many other packages yourself when standard *nix
> paths are used.
>

>
>
>> Thanks,
>> Surinder
>> ​
>>
>> On Mon, Aug 7, 2017 at 4:33 PM, Surinder Kumar <
>> surinder.ku...@enterprisedb.com> wrote:
>>
>>> On Mon, Aug 7, 2017 at 4:11 PM, Ashesh Vashi <
>>> ashesh.va...@enterprisedb.com> wrote:
>>>
>>>> On Mon, Aug 7, 2017 at 3:59 PM, Dave Page <dp...@pgadmin.org> wrote:
>>>>
>>>>> Anyone?
>>>>>
>>>> Surinder - please give this one priority.
>>>>
>>> Sure
>>> ​.​
>>>
>>>
>>>>
>>>> --
>>>>
>>>> Thanks & Regards,
>>>>
>>>> Ashesh Vashi
>>>> EnterpriseDB INDIA: Enterprise PostgreSQL Company
>>>> <http://www.enterprisedb.com/>
>>>>
>>>>
>>>> *http://www.linkedin.com/in/asheshvashi*
>>>> <http://www.linkedin.com/in/asheshvashi>
>>>>
>>>>>
>>>>> On Thu, Jul 20, 2017 at 5:03 PM, Dave Page <dp...@pgadmin.org> wrote:
>>>>>
>>>>>> All,
>>>>>>
>>>>>> Attached is a patch that aims to allow us to have a standardised
>>>>>> config that will work out of the box for both web and desktop modes. It
>>>>>> does this by doing two things:
>>>>>>
>>>>>> 1) The runtime sets SERVER_MODE in the Python environment before
>>>

Re: Fix key error

2017-08-07 Thread Surinder Kumar
Hi,

On Tue, Aug 8, 2017 at 12:23 AM, Dave Cramer  wrote:

I don't think this line in web/pgadmin/browser/server_groups/servers/types.py
> does what it should.
>
> default_path = config.DEFAULT_BINARY_PATHS[st.stype] or ""
>
> will ever succeed if the key does not exist
>
> Attached patch should work.
>
​It can be written as:

default_path = config.DEFAULT_BINARY_PATHS.get(st.stype, "")

Reference link


​Thanks for the patch.​


> Dave Cramer
>
​


Re: Unified server/desktop config

2017-08-07 Thread Surinder Kumar
On Mon, Aug 7, 2017 at 4:11 PM, Ashesh Vashi 
wrote:

> On Mon, Aug 7, 2017 at 3:59 PM, Dave Page  wrote:
>
>> Anyone?
>>
> Surinder - please give this one priority.
>
Sure
​.​


>
> --
>
> Thanks & Regards,
>
> Ashesh Vashi
> EnterpriseDB INDIA: Enterprise PostgreSQL Company
> 
>
>
> *http://www.linkedin.com/in/asheshvashi*
> 
>
>>
>> On Thu, Jul 20, 2017 at 5:03 PM, Dave Page  wrote:
>>
>>> All,
>>>
>>> Attached is a patch that aims to allow us to have a standardised config
>>> that will work out of the box for both web and desktop modes. It does this
>>> by doing two things:
>>>
>>> 1) The runtime sets SERVER_MODE in the Python environment before
>>> starting the app. If this value is set, then it overrides the default value
>>> of SERVER_MODE in the config.
>>>
>>> 2) The config file then offers default values for the various file
>>> locations for both server and desktop mode, setting them appropriately
>>> based on the derived SERVER_MODE value.
>>>
>>> The only downsides I can see from this are:
>>>
>>> - You cannot run in server mode in the runtime without manually
>>> reconfiguring SERVER_MODE and likely a bunch of paths in config_local.py
>>>
>>> - If you want to override SERVER_MODE, you'll probably also need to
>>> redefine the various paths in config_local.py.
>>>
>>> I don't see either being something 99.9% of users would need though.
>>>
>>> Can anyone see if the patch breaks anything, or if I missed any side
>>> effects?
>>>
>>> Is it likely to break things during upgrades? I suspect so... so maybe
>>> this should prompt v2.0?
>>>
>>> I'd appreciate multiple reviews of this, as it could break things. Note
>>> that I haven't yet updated the docs.
>>>
>>> --
>>> Dave Page
>>> Blog: http://pgsnake.blogspot.com
>>> Twitter: @pgsnake
>>>
>>> EnterpriseDB UK: http://www.enterprisedb.com
>>> The Enterprise PostgreSQL Company
>>>
>>
>>
>>
>> --
>> Dave Page
>> Blog: http://pgsnake.blogspot.com
>> Twitter: @pgsnake
>>
>> EnterpriseDB UK: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>>
>
>


[pgAdmin4][Patch]: RM_ 2620 - Getting error "Violates check constraint" while creating pgAgent job

2017-08-02 Thread Surinder Kumar
Hi

It gives error because database value is passed in query generated when jobstep
> kind == 'batch'.
the database value must be ‘’, if jobstep > kind == 'batch' as per check
constraint:

"pga_jobstep_check1" CHECK (jstdbname <> ''::name AND jstkind =
's'::bpchar OR jstdbname = ''::name AND (jstkind = 'b'::bpchar OR
jstconnstr <> ''
::text))

Please find attached patch and review.

Thanks,
Surinder
​


RM_2620.patch
Description: Binary data


[Patch][pgAdmin4]: RM_2617 - pgAgent module is not loading after webpacking

2017-08-01 Thread Surinder Kumar
Hi,

Added an entry for pgAgent JS module to imports-loader to fix the issue.

Please find attached patch and let me know for review comments.

Thanks,
Surinder


RM_2617.patch
Description: Binary data


Re: [pgAdmin4][Patch]: RM_2596 - Query tool not working in Desktop Runtime on Mac OS X

2017-08-01 Thread Surinder Kumar
Hi Ashesh,

1. Now we are using `envType` variable in definePlugin which sets
environment variable NODE_ENV globally which is used by React to create
development or production build.
where:
 envType - determine build type is either `production` or
`development`​ depending on the environment set in package.json > scripts.

2. In `UglifyJSPlugin`, i am setting compress > `warnings to false`,
because here warning flag is meant to display warnings on terminal while
creating build in production mode. so it is set to false.

I didn't created an RM for #2 as it is minor change, if needed, i will
create.

​Reference to webpack definePlugin:
https://webpack.js.org/guides/production/#node-environment-variable​

Please find updated patch with fixed review comments and review.

Thanks,
Surinder

On Mon, Jul 31, 2017 at 3:31 PM, Ashesh Vashi <ashesh.va...@enterprisedb.com
> wrote:

> On Fri, Jul 28, 2017 at 12:42 PM, Surinder Kumar <
> surinder.ku...@enterprisedb.com> wrote:
>
>> Hi,
>>
>> I inspect the react code and in call stacks, found `process.env.NODE_ENV`
>> is undefined due to which 'SyntheticEvent.call' is not callable.
>>
>> So, to fix this, i add 'definePlugin' to plugins for `dev` environment in
>> `webpack.config.js`. Initially it was added only for `production`
>> environment. but it is needed for both, because React code is conditional
>> based on environment variables set.
>>
>
>> Please find attached patch and review.
>>
> As discussed, you're setting 'production', even in the 'development' mode.
>
> Please understand the code, and share the updated patch.
> Also - share the references next time, so that - committer can understand
> the reason for these changes.
>
> -- Thanks, Ashesh
>
>>
>> Thanks,
>> Surinder
>>
>
>


RM_2596_v1.patch
Description: Binary data


[pgAdmin4][Patch]: RM_2596 - Query tool not working in Desktop Runtime on Mac OS X

2017-07-28 Thread Surinder Kumar
Hi,

I inspect the react code and in call stacks, found `process.env.NODE_ENV`
is undefined due to which 'SyntheticEvent.call' is not callable.

So, to fix this, i add 'definePlugin' to plugins for `dev` environment in
`webpack.config.js`. Initially it was added only for `production`
environment. but it is needed for both, because React code is conditional
based on environment variables set.

Please find attached patch and review.

Thanks,
Surinder


RM_2596.patch
Description: Binary data


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

2017-07-26 Thread Surinder Kumar
Ok. I will send rebased patch.

On Thu, Jul 27, 2017 at 10:32 AM, Ashesh Vashi <
ashesh.va...@enterprisedb.com> wrote:

>
>
> On Thu, Jul 27, 2017 at 10:22 AM, Ashesh Vashi <
> ashesh.va...@enterprisedb.com> wrote:
>
>> Hi Surinder,
>>
>> 'delete_template_files.patch' is applied any more.
>> Please send the rebased patches.
>>
>> I have also noticed in the 'move_js_files_to_static_directory.patch',
>> couple of modules have two definitions for 'module_use_template_javascript'
>> method.
>>
> Also - 'module_paths.json' is auto generated, please don't include that in
> the patch.
>
> -- Thanks, Ashesh
>
>>
>>
>> --
>>
>> Thanks & Regards,
>>
>> Ashesh Vashi
>> EnterpriseDB INDIA: Enterprise PostgreSQL Company
>> <http://www.enterprisedb.com>
>>
>>
>> *http://www.linkedin.com/in/asheshvashi*
>> <http://www.linkedin.com/in/asheshvashi>
>>
>> On Tue, Jul 25, 2017 at 3:56 PM, Surinder Kumar <
>> surinder.ku...@enterprisedb.com> wrote:
>>
>>> Hi,
>>>
>>> Please find rebased patches and review.
>>>
>>> On Sat, Jul 22, 2017 at 1:03 AM, Surinder Kumar <
>>> surinder.ku...@enterprisedb.com> wrote:
>>>
>>>> Hi,
>>>>
>>>> Following are the changes in patches attached:
>>>>
>>>> 1) Move Javascripts from Templates directory to Static for following
>>>> modules:
>>>>  - About
>>>>  - Browser nodes
>>>>  - Dashboard
>>>>  - FileManager
>>>>  - Vendor/snap.svg
>>>>  - Preferences
>>>>  - Settings
>>>>  - Backup
>>>>  - Datagrid
>>>>  - Debugger
>>>>  - Sqleditor
>>>>  - Grant Wizard
>>>>  - Import & Export
>>>>  - Maintenance
>>>>  - Restore and
>>>>  - User Management
>>>>
>>>> 2) Generate module JS path references dynamically/ Remove manually
>>>> written paths.
>>>> Added a new file 'module_paths.json' which will update with absolute
>>>> paths to module JS defined in every modules > __init__.py > 'def
>>>> get_own_javascripts'.
>>>>
>>>> When Flask service is started, it accesses the all module javascripts
>>>> using `current_app.javascripts` which is called inside an route.
>>>> This call to route is made using Flask's `test_client` and thus those
>>>> paths are written to `module_paths.json`(in javascript_bundler.py) which is
>>>> used by webpack.shim.js file.
>>>>
>>>> Three patches:
>>>> 1. Move JS files to static directory
>>>> 2. Deleted template JS
>>>> 3. Generate JS paths before app starts
>>>>
>>>> These patches needs to be committed separately as deleted files
>>>> includes in the commit that makes difficult to look for changes through
>>>> `git log `
>>>>
>>>> Please review.
>>>>
>>>> Thanks,
>>>> Surinder
>>>>
>>>>
>>>>
>>>> On Thu, Jul 20, 2017 at 6:08 PM, Dave Page <dp...@pgadmin.org> wrote:
>>>>
>>>>> Thanks, applied.
>>>>>
>>>>> On Thu, Jul 20, 2017 at 1:35 PM, Surinder Kumar <
>>>>> surinder.ku...@enterprisedb.com> wrote:
>>>>>
>>>>>> Hi Dave,
>>>>>>
>>>>>> Can you please review this patch please? I guess it was missed as i
>>>>>> send 2 patches back to back in same email chain.
>>>>>> Please find inline detailed description of issue.
>>>>>>
>>>>>> On Thu, Jul 20, 2017 at 12:37 PM, Surinder Kumar <
>>>>>> surinder.ku...@enterprisedb.com> wrote:
>>>>>>
>>>>>>> Hi
>>>>>>>
>>>>>>> The loading icon image is used in FileManager and it is still
>>>>>>> referenced from vendor `aciTree`(which is removed) so it gives 404 not
>>>>>>> found when FileManager is opened from Query tool/Backup utility.
>>>>>>>
>>>>>>> Please find attached patch and review.
>>>>>>>
>>>>>>> Thanks,
>>>>>>> Surinder Kumar
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Dave Page
>>>>> Blog: http://pgsnake.blogspot.com
>>>>> Twitter: @pgsnake
>>>>>
>>>>> EnterpriseDB UK: http://www.enterprisedb.com
>>>>> The Enterprise PostgreSQL Company
>>>>>
>>>>
>>>>
>>>
>>
>


[pgAdmin4][Patch]: Improvise the treeview element selection

2017-07-23 Thread Surinder Kumar
Hi All,

Changes:

1. Highlight the full selected tree item instead of highlighting only label.
2. Set selected item background color to dark blue that is more visible to
eyes.[same as in pgAdmin3]

Please find attached patch and review.

Thanks,
Surinder


change_acitree_style.patch
Description: Binary data


[pgAdmin4][Patch]: Using editorconfig to maintain consistent coding styles between different IDE's

2017-07-21 Thread Surinder Kumar
Hi All,

In pgAdmin4 codebase, the coding styles at many places is inconsistent, in
some files standard coding conventions are followed and in some not.

It is difficult to take care of 'tabs', 'spaces', 'trailing white-spaces',
'max_line_length' while development.

So adding .editorconfig to pgAdmin4 will make development easier and will
help in faster patch review.

Added a `.editorconfig` file where all coding styles followed in pgAdmin4
are added, and most of editors/IDE reads this file and follows the rules
while development.

For PyCharm editor, there is no additional configuration or settings
required. it reads .editorconfig.
For Vim editor - developer has to install plugin available.

List of editors supporting `.editorconfig`
http://editorconfig.org/#download

Also, there is a NPM plugin eclint  available
which fixes files automatically and do other tasks as well, for example:

Running following command on terminal fixes issues related to tabs,
trailing whitespaces in existing files:

./node_modules/eclint/bin/eclint.js fix
pgadmin/static/css/bootstrap.overrides.css

If i missed any rule, please let me know
​ i will add.​


Please find attached patch and review.

Thanks,
Surinder


add_support_for_editorconfig.patch
Description: Binary data


Re: [pgAdmin4][Patch]: Stop Flask from initialising service twice in Debug mode

2017-07-21 Thread Surinder Kumar
Hi

In this patch, i have added reference to the implementation.
Please find updated patch and review.

Thanks,
Surinder

On Fri, Jul 21, 2017 at 12:32 PM, Surinder Kumar <
surinder.ku...@enterprisedb.com> wrote:

> Hi
>
> When pgAdmin4 runs in DEBUG mode, Flask initialise service twice, while in
> non-DEBUG mode, once. It is pain while development because `yarn run
> bundle` also runs twice.
>
> It is because the parameter `use_reloader` = True in Debug Mode.
>
> If `os.environ` variable `WERKZEUG_RUN_MAIN` is set to None, i.e. app is
> starting for the first time and then its value is changed to True.
>
> Please find attached patch.
>
> Thanks
> Surinder
>
>
>
>


start_flask_service_once_in_debug_mode_v1.patch
Description: Binary data


[pgAdmin4][Patch]: Stop Flask from initialising service twice in Debug mode

2017-07-21 Thread Surinder Kumar
Hi

When pgAdmin4 runs in DEBUG mode, Flask initialise service twice, while in
non-DEBUG mode, once. It is pain while development because `yarn run
bundle` also runs twice.

It is because the parameter `use_reloader` = True in Debug Mode.

If `os.environ` variable `WERKZEUG_RUN_MAIN` is set to None, i.e. app is
starting for the first time and then its value is changed to True.

Please find attached patch.

Thanks
Surinder


start_flask_service_once_in_debug_mode.patch
Description: Binary data


Re: [pgAdmin4][Patch]: Allow user to Comment/Uncomment code in query editor

2017-07-20 Thread Surinder Kumar
Hi Murtuza,

Can the code related to Menu KeyEvents be moved out into a separate file
say 'menu_actions.js' if feasible ?

As the more functionality will be added to sqleditor, codemirror and its
file menu in future, the codebase will eventually increase.
It will ease writing jasmine test cases as well.

Thanks,
Surinder

On Thu, Jul 20, 2017 at 8:03 PM, Murtuza Zabuawala  wrote:

> Hi Dave,
>
> Please find patch attached, There were two issues,
> 1) We removed the default button to clear the editor window, it
> broke _clear_query_tool() functionality.
> 2) The buttons arrangements, we added new Edit button in between Delete
> and Filter button causing the "Explain" -> "Explain Options" sub menu to go
> out of browser visibility in feature test, so it was failing.
>
> I have put Edit button near Clear button for now, until we come up with
> new design for our editor for displaying these options.
>
>
> --
> Regards,
> Murtuza Zabuawala
> EnterpriseDB: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
> On Thu, Jul 20, 2017 at 6:04 PM, Murtuza Zabuawala <
> murtuza.zabuaw...@enterprisedb.com> wrote:
>
>> Hi Dave,
>>
>> I am working on this, will send you patch soon.
>>
>> On Thu, Jul 20, 2017 at 5:53 PM, Dave Page  wrote:
>>
>>> Did you get a chance to look at this yet Murtuza?
>>>
>>> On Wed, Jul 19, 2017 at 3:37 PM, Murtuza Zabuawala <
>>> murtuza.zabuaw...@enterprisedb.com> wrote:
>>>
 Sure, Will take a look.

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

 On Wed, Jul 19, 2017 at 8:00 PM, Dave Page  wrote:

> Except I managed to break a couple of tests :-(. Can you take a look
> please? I've had some other work come up that I need to deal with.
>
> ==
> ERROR: runTest (pgadmin.feature_tests.query_t
> ool_journey_test.QueryToolJourneyTest)
> Tests the path through the query tool
> --
> Traceback (most recent call last):
>   File 
> "/Users/dpage/git/pgadmin4/web/pgadmin/feature_tests/query_tool_journey_test.py",
> line 45, in runTest
> self._test_history_tab()
>   File 
> "/Users/dpage/git/pgadmin4/web/pgadmin/feature_tests/query_tool_journey_test.py",
> line 71, in _test_history_tab
> self.__clear_query_tool()
>   File 
> "/Users/dpage/git/pgadmin4/web/pgadmin/feature_tests/query_tool_journey_test.py",
> line 91, in __clear_query_tool
> self.page.click_element(self.page.find_by_xpath("//*[@id='bt
> n-edit']"))
>   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 232, 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 282, in _wait_for
> "Timed out waiting for " + waiting_for_message)
>   File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packa
> ges/selenium/webdriver/support/wait.py", line 80, in until
> raise TimeoutException(message, screen, stacktrace)
> TimeoutException: Message: Timed out waiting for element to exist
>
>
> ==
> ERROR: runTest (pgadmin.feature_tests.query_t
> ool_tests.QueryToolFeatureTest)
> Query tool feature test
> --
> Traceback (most recent call last):
>   File 
> "/Users/dpage/git/pgadmin4/web/pgadmin/feature_tests/query_tool_tests.py",
> line 52, in runTest
> self._clear_query_tool()
>   File 
> "/Users/dpage/git/pgadmin4/web/pgadmin/feature_tests/query_tool_tests.py",
> line 173, in _clear_query_tool
> self.page.find_by_id("btn-edit").click()
>   File 
> "/Users/dpage/git/pgadmin4/web/regression/feature_utils/pgadmin_page.py",
> line 151, in find_by_id
> return self.wait_for_element(lambda driver:
> driver.find_element_by_id(element_id))
>   File 
> "/Users/dpage/git/pgadmin4/web/regression/feature_utils/pgadmin_page.py",
> line 232, 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 282, in _wait_for
> "Timed out waiting for " + waiting_for_message)
>   File 

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

2017-07-19 Thread Surinder Kumar
Hi,

PFA patch for few code review comments given by Ashesh.

Thanks,
Surinder


On Wed, Jul 19, 2017 at 4:36 PM, Surinder Kumar <
surinder.ku...@enterprisedb.com> wrote:

> On Wed, Jul 19, 2017 at 4:27 PM, Dave Page <dp...@pgadmin.org> wrote:
>
>> That was a fun one to spot I'm sure!
>>
> ​Indeed, i had setup pgAdmin evn on Linux(as it works on Mac) and then i
> did `ls path/to/jquery.contextmenu.js`, it was spotted :)
>
>>
>> Thanks, committed.
>>
>> On Wed, Jul 19, 2017 at 11:21 AM, Surinder Kumar <
>> surinder.ku...@enterprisedb.com> wrote:
>>
>>> Hi
>>>
>>> Fix library path reference for `jquery.contextmenu'. This issue was only
>>> reproducible on Linux machine.
>>> So, i setup pgAdmin4 on Ubuntu VM and tested the patch and it works.
>>>
>>> Please find attached patch.
>>>
>>> Thanks,
>>> Surinder
>>>
>>> On Tue, Jul 18, 2017 at 9:05 PM, Murtuza Zabuawala <
>>> murtuza.zabuaw...@enterprisedb.com> wrote:
>>>
>>>> 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 <dp...@pgadmin.org> 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 <dp...@pgadmin.org>
>>>>>>> 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 <dp...@pgadmin.org>
>>>>>>>>>> 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)
>>>>>>>>>>>

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

2017-07-19 Thread Surinder Kumar
On Wed, Jul 19, 2017 at 4:27 PM, Dave Page <dp...@pgadmin.org> wrote:

> That was a fun one to spot I'm sure!
>
​Indeed, i had setup pgAdmin evn on Linux(as it works on Mac) and then i
did `ls path/to/jquery.contextmenu.js`, it was spotted :)

>
> Thanks, committed.
>
> On Wed, Jul 19, 2017 at 11:21 AM, Surinder Kumar <
> surinder.ku...@enterprisedb.com> wrote:
>
>> Hi
>>
>> Fix library path reference for `jquery.contextmenu'. This issue was only
>> reproducible on Linux machine.
>> So, i setup pgAdmin4 on Ubuntu VM and tested the patch and it works.
>>
>> Please find attached patch.
>>
>> Thanks,
>> Surinder
>>
>> On Tue, Jul 18, 2017 at 9:05 PM, Murtuza Zabuawala <
>> murtuza.zabuaw...@enterprisedb.com> wrote:
>>
>>> 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 <dp...@pgadmin.org> 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 <dp...@pgadmin.org> 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 <dp...@pgadmin.org>
>>>>>>>>> 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 p

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

2017-07-19 Thread Surinder Kumar
Hi

Fix library path reference for `jquery.contextmenu'. This issue was only
reproducible on Linux machine.
So, i setup pgAdmin4 on Ubuntu VM and tested the patch and it works.

Please find attached patch.

Thanks,
Surinder

On Tue, Jul 18, 2017 at 9:05 PM, Murtuza Zabuawala <murtuza.zabuawala@
enterprisedb.com> wrote:

> 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 <dp...@pgadmin.org> 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 <dp...@pgadmin.org> 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 <dp...@pgadmin.org>
>>>>>>> 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
>>>>>>>

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

2017-07-19 Thread Surinder Kumar
Yes Dave. I am looking.

On Wed, Jul 19, 2017 at 1:44 PM, Dave Page  wrote:

> Surinder; are you looking at this?
>
> On Tue, Jul 18, 2017 at 5:33 PM, Harshal Dhumal  > wrote:
>
>>
>>
>> On Tue, Jul 18, 2017 at 9:33 PM, pgAdmin 4 Jenkins 
>> wrote:
>>
>>> See >> ature/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

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 <dp...@pgadmin.org> 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 <dp...@pgadmin.org> 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.DE

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

2017-07-17 Thread Surinder Kumar
On Mon, Jul 17, 2017 at 2:15 PM, Dave Page <dp...@pgadmin.org> wrote:

> Hi
>
> On Wed, Jul 12, 2017 at 4:04 PM, Surinder Kumar <
> surinder.ku...@enterprisedb.com> wrote:
>
>> Hi
>>
>> While this patch is in review, i have not attached patch for "unvendored
>> libs" which is around 10MB in size and needs not to review.
>> Attached is the patch which can be reviewed.
>>
>> *Changes:*
>>
>> 1) As React will be used in other modules, so the React components
>> codebase is bundled into "vendor.js". the sqleditor.js bundle size is now
>> just 239kb(excluding react)
>>
>> If a module needs React package as dependency, the user can write:
>>
>> `import React from 'react' or
>>
>> `require('react')`
>>
>> in respective module.
>>
>> 2) As Matt earlier pointed, application takes longer to start while
>> generating bundle files. I used "hard-source-webpack-plugin
>> <https://github.com/mzgoddard/hard-source-webpack-plugin/>" to reduce
>> the build time and couple of other optimisations.
>>
>> - Initially webpack build time: 25.13 seconds
>>
>> - After removing 'pgadmin/browser' from ' resolve > modules, the time
>> taken to build is reduced to 24.74 seconds
>>
>> ​- ​
>> After downgrading css-loader@0.28.0 to css-loader@0.14.0
>> ​, it took 22.44 seconds.
>>
>> ​The older version of css-loader doesn't have other  packages like
>> 'post-css', so it doesn't take much time to build.
>>
>> While "hard-source-webpack-plugin" manages the cache and stores it into
>> 'generated/.cache//' path.​ So when the build is run  for the
>> first time, it takes ~22 seconds.`
>>
>> When run for second time, it takes 2-3 seconds to build. it builds only
>> the chunks which have changes.
>>
>> When build in production mode, initially it took ~47 seconds.
>>
>> On second run, it took ~22 seconds. the only change between development
>> and production builds are "CommonChunks" and "UglifyJS" plugins which are
>> used for production build. So, "hard-source-webpack-plugin" doesn't seems
>> to support build with these two optimisation plugins.
>>
>> Please review updated patch.
>>
>
> Works beautifully in the browser and in the runtime; the speedup is
> significant. Excellent work!
>
> However, the regression tests fail miserably :-(
>
​I will fix and send updated patch.​

>
> ERROR in ./node_modules/slickgrid/slick.core.js
> Module not found: Error: Can't resolve 'jquery.ui' in
> '/Users/dpage/git/pgadmin4/web/node_modules/slickgrid'
>  @ ./node_modules/slickgrid/slick.core.js 3:12-32 11:12-32
>  @ ./pgadmin/static/bundle/slickgrid.js
>
> ERROR in ./node_modules/slickgrid/slick.core.js
> Module not found: Error: Can't resolve 'jquery.event.drag' in
> '/Users/dpage/git/pgadmin4/web/node_modules/slickgrid'
>  @ ./node_modules/slickgrid/slick.core.js 6:20-48 14:20-48
>  @ ./pgadmin/static/bundle/slickgrid.js
>
> ERROR in ./node_modules/slickgrid/slick.core.js
> Module not found: Error: Can't resolve 'jquery' in
> '/Users/dpage/git/pgadmin4/web/node_modules/slickgrid'
>  @ ./node_modules/slickgrid/slick.core.js 1:0-17
>  @ ./pgadmin/static/bundle/slickgrid.js
>
> ERROR in ./node_modules/slickgrid/slick.grid.js
> Module not found: Error: Can't resolve 'jquery.ui' in
> '/Users/dpage/git/pgadmin4/web/node_modules/slickgrid'
>  @ ./node_modules/slickgrid/slick.grid.js 3:12-32
>  @ ./pgadmin/static/bundle/slickgrid.js
>
> ERROR in ./node_modules/slickgrid/slick.grid.js
> Module not found: Error: Can't resolve 'jquery.event.drag' in
> '/Users/dpage/git/pgadmin4/web/node_modules/slickgrid'
>  @ ./node_modules/slickgrid/slick.grid.js 6:20-48
>  @ ./pgadmin/static/bundle/slickgrid.js
>
> ERROR in ./node_modules/slickgrid/slick.grid.js
> Module not found: Error: Can't resolve 'jquery' in
> '/Users/dpage/git/pgadmin4/web/node_modules/slickgrid'
>  @ ./node_modules/slickgrid/slick.grid.js 1:0-17
>  @ ./pgadmin/static/bundle/slickgrid.js
>
> ERROR in ./node_modules/slickgrid/slick.dataview.js
> Module not found: Error: Can't resolve 'jquery.ui' in
> '/Users/dpage/git/pgadmin4/web/node_modules/slickgrid'
>  @ ./node_modules/slickgrid/slick.dataview.js 3:12-32
>  @ ./pgadmin/static/bundle/slickgrid.js
>
> ERROR in ./node_modules/slickgrid/slick.dataview.js
> Module not found: Error: Can't resolve 'jquery.event.drag' in
> '/Users/dpage/git/pgadmin4/web/node_modules/slickgrid'
>  @ ./node_modules/slickgrid/slick.dataview.js 6:20-48
>  @ ./pgadmin/static/bundle/slickgrid.js
>

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

2017-07-11 Thread Surinder Kumar
On Tue, Jul 11, 2017 at 10:18 PM, Robert Eckhardt <reckha...@pivotal.io>
wrote:

> The last email on this chain from Surinder says that it isn't working on
> IE and he will submit another patch. Are we missing that patch? Would you
> like us to look at the previous patch?
>
​Yes previous patch includes fix related to IE.​

>
> -- Rob
>
>
> On Jul 11, 2017 11:37 AM, "Dave Page" <dave.p...@enterprisedb.com> wrote:
>
>> Pivotal team; you guys are far more familiar with webpack etc. than we
>> are; could you review please?
>>
>> Thanks!
>>
>> On Tue, Jul 11, 2017 at 4:24 PM, Surinder Kumar <
>> surinder.ku...@enterprisedb.com> wrote:
>>
>>> Hi
>>>
>>> 1) Created a separated patch for Un-vendored libraries and another one
>>> related to webpack bundle files so it is easy to review.
>>>
>>> 2) Removed commented out code and dead code.
>>>
>>> 3) Feature test cases are fixed. All are running.
>>> I have to add `time.sleep` of 1 second in method
>>> 'fill_codemirror_area_with' as sometimes it work and sometimes don't.
>>>
>>> 4. Removed unused libraries from package.json
>>>
>>> Please find updated patch and review.
>>>
>>> Thanks,
>>> Surinder
>>>
>>>
>>>
>>> On Tue, Jul 11, 2017 at 3:11 PM, Surinder Kumar <
>>> surinder.ku...@enterprisedb.com> wrote:
>>>
>>>> Hi
>>>>
>>>> This patch doesn't work in windows IE 11 due to error `'Promise' is
>>>> undefined
>>>> ​`​.
>>>>
>>>> The dependency package 'babel-polyfill' is required to run ES6 code
>>>> with webpack and has to load before at entry point of app.
>>>> related thread <https://github.com/webpack/webpack/issues/4254>
>>>>
>>>> Please find updated patch.
>>>>
>>>> Thanks
>>>> Surinder
>>>>
>>>> On Tue, Jul 11, 2017 at 2:13 PM, Dave Page <dave.p...@enterprisedb.com>
>>>> wrote:
>>>>
>>>>> Nice!
>>>>>
>>>>> On Tue, Jul 11, 2017 at 9:42 AM, Neel Patel <
>>>>> neel.pa...@enterprisedb.com> wrote:
>>>>>
>>>>>> Hi Dave,
>>>>>>
>>>>>> I have tested Surinder's patch in my local machine with Qt 5.9.1
>>>>>> Webkit on Windows and we are getting improvements with this patch. :)
>>>>>>
>>>>>> Below performance tested with Qt 5.9.1 with annulen webkit v 5.212.0
>>>>>> Alpha2.
>>>>>>
>>>>>> *Before Webpack patch:-*
>>>>>>
>>>>>> It took ~20 seconds. This 20 seconds includes when user double click
>>>>>> on application ( timing of python server start + page load )
>>>>>>
>>>>>> *After Webpack patch:-*
>>>>>>
>>>>>> It took ~13 seconds ( timing of python server start + page load ).
>>>>>>
>>>>>> We got ~7 seconds improvement with webpack on same machine & same Qt
>>>>>> configuration and this will be useful in windows performance issue as 
>>>>>> well
>>>>>> :)
>>>>>>
>>>>>> Thanks,
>>>>>> Neel  Patel
>>>>>>
>>>>>> On Tue, Jul 11, 2017 at 1:27 PM, Surinder Kumar <
>>>>>> surinder.ku...@enterprisedb.com> wrote:
>>>>>>
>>>>>>> Hi
>>>>>>>
>>>>>>> I found this patch won't work on IE, so i have fixed it and will
>>>>>>> send updated patch.
>>>>>>>
>>>>>>> On Tue, Jul 11, 2017 at 1:25 PM, Surinder Kumar <
>>>>>>> surinder.ku...@enterprisedb.com> wrote:
>>>>>>>
>>>>>>>>
>>>>>>>> On Tue, Jul 11, 2017 at 1:22 PM, Dave Page <dp...@pgadmin.org>
>>>>>>>> wrote:
>>>>>>>>
>>>>>>>>> When you say "un-vendorising", do you mean removing them from the
>>>>>>>>> vendor directory and adding them to packages.json so they're pulled 
>>>>>>>>> in via
>>>>>>>>> npm/yarn? (if so, good :-) )
>>>>>>>>>
>>>>>>>> ​Yes.​
>>>>>>&g

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

2017-07-11 Thread Surinder Kumar
Hi

I found this patch won't work on IE, so i have fixed it and will send
updated patch.

On Tue, Jul 11, 2017 at 1:25 PM, Surinder Kumar <
surinder.ku...@enterprisedb.com> wrote:

>
> On Tue, Jul 11, 2017 at 1:22 PM, Dave Page <dp...@pgadmin.org> wrote:
>
>> When you say "un-vendorising", do you mean removing them from the vendor
>> directory and adding them to packages.json so they're pulled in via
>> npm/yarn? (if so, good :-) )
>>
> ​Yes.​
>
>>
>> On Tue, Jul 11, 2017 at 7:34 AM, Surinder Kumar <
>> surinder.ku...@enterprisedb.com> wrote:
>>
>>> Hi
>>>
>>> *Detailed changes:*
>>>
>>> ​1) Created a file bundle/app.js which loads `browser.js`  and then
>>> 'tools.datagrid' and its other dependents are configured to load in
>>> '`imports-loader`
>>>
>>> 2) bundle/codemirror.js - it generates a bundled JS which is used
>>> wherever required in various modules.
>>>
>>> 3) file_utils.js - It bundles the file manager's utility JS file and
>>> loaded from `file manager/index.html`
>>>
>>> 4) lib_css - It contains list of vendor CSS to be bundled.
>>>
>>> 5) pgadmin_css - It contains list of overrides CSS which are bundled and
>>> which has to load after vendors CSS is loaded.
>>>
>>> *Various Webpack configuration parameters:*
>>>
>>> 1) externals: List of template files to be loaded dynamically when a
>>> call is made by dependent modules. These files are excluded from the
>>> bundled JS.
>>>
>>> 2) resolve > alias - This resolves the path of module JS which is
>>> referred in other modules; For example:
>>> 'backbone': path.join(__dirname, './node_modules/backbone/backbone')
>>>
>>> 3) `backbone` is used in 'define(['backbone'])' calls and its path is
>>> resolved to above absolute path.
>>>
>>> 4) 'pgLibs': List of files to bundle into `pgadmin_commons.js`. The
>>> purpose is to separate files other than browser node modules JS in
>>> `pgadmin_commons.js` and browser node modules JS in `app.bundle.js`. It
>>> will help in debugging the code during development.
>>>
>>> *Un-vendor modules:*
>>>
>>> All modules are un-vendored except:
>>> - requireJS
>>> - Backgrid JS - it gives reference error when importing backgrid.css
>>> from node_modules in bundle/lib.css even if the path is correct. I logged
>>> an issue:
>>> Opened an issue
>>> <https://github.com/webpack-contrib/css-loader/issues/567>
>>>
>>> - React JS - I didn't un-vendor React JS because the pivotal developers
>>> submitted a patch to fix issue of QtWebEngine. Once the patch is merged in
>>> React repo, we will un-vendor.
>>>
>>> *Other issues faced:*
>>>
>>> 1) Backbone JS: I didn't upgraded backbone JS to latest because it
>>> affects the application code mainly `Preferences module`.
>>>
>>> 2) jQuery: I didn't upgraded it to latest because it is gives error in
>>> loading wcIframe of wcDocker in Query tool. I submit a PR
>>> <https://github.com/WebCabin/wcDocker/pull/118>.
>>>
>>> 3) Acitree - it is not available in yarn repository. logged an request
>>> <https://github.com/dragosu/jquery-aciTree/issues/15>
>>> However i am managing it on my github account by forking this repo.
>>>
>>> Specified the repo github link to `acitree` in package.json with tag to
>>> pull from
>>> 4.5.0-rc.7
>>> <https://github.com/imsurinder90/jquery-aciTree.git#4.5.0-rc.7>. The
>>> latest version of actiree has issues so code is used form 4.5.0-rc.7 tag.
>>>
>>> Thanks to bestander <https://github.com/bestander> for helping this
>>> out. link to thread
>>> <https://github.com/yarnpkg/yarn/issues/1747#issuecomment-312502008>
>>>
>>> *Plugins used:*
>>>
>>> ​- optimize-css-assets-webpack-plugin: its job is to optimise the CSS
>>> bundle like minifying CSS and removing comments from it. [used only in
>>> production]
>>>
>>> -  uglifyJS - It minimise the bundled JS​, and remove console statements
>>> from code. [used only in production]
>>>
>>> - definePlugin - It helps in minimising the `React' production bundle.
>>> As react has conditional code based on 'NODE_ENV' variable. [used only in
>>> production]
>>>
>>> - providePlugin - It makes the variable defi

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

2017-07-11 Thread Surinder Kumar
On Tue, Jul 11, 2017 at 1:22 PM, Dave Page <dp...@pgadmin.org> wrote:

> When you say "un-vendorising", do you mean removing them from the vendor
> directory and adding them to packages.json so they're pulled in via
> npm/yarn? (if so, good :-) )
>
​Yes.​

>
> On Tue, Jul 11, 2017 at 7:34 AM, Surinder Kumar <
> surinder.ku...@enterprisedb.com> wrote:
>
>> Hi
>>
>> *Detailed changes:*
>>
>> ​1) Created a file bundle/app.js which loads `browser.js`  and then
>> 'tools.datagrid' and its other dependents are configured to load in
>> '`imports-loader`
>>
>> 2) bundle/codemirror.js - it generates a bundled JS which is used
>> wherever required in various modules.
>>
>> 3) file_utils.js - It bundles the file manager's utility JS file and
>> loaded from `file manager/index.html`
>>
>> 4) lib_css - It contains list of vendor CSS to be bundled.
>>
>> 5) pgadmin_css - It contains list of overrides CSS which are bundled and
>> which has to load after vendors CSS is loaded.
>>
>> *Various Webpack configuration parameters:*
>>
>> 1) externals: List of template files to be loaded dynamically when a call
>> is made by dependent modules. These files are excluded from the bundled JS.
>>
>> 2) resolve > alias - This resolves the path of module JS which is
>> referred in other modules; For example:
>> 'backbone': path.join(__dirname, './node_modules/backbone/backbone')
>>
>> 3) `backbone` is used in 'define(['backbone'])' calls and its path is
>> resolved to above absolute path.
>>
>> 4) 'pgLibs': List of files to bundle into `pgadmin_commons.js`. The
>> purpose is to separate files other than browser node modules JS in
>> `pgadmin_commons.js` and browser node modules JS in `app.bundle.js`. It
>> will help in debugging the code during development.
>>
>> *Un-vendor modules:*
>>
>> All modules are un-vendored except:
>> - requireJS
>> - Backgrid JS - it gives reference error when importing backgrid.css from
>> node_modules in bundle/lib.css even if the path is correct. I logged an
>> issue:
>> Opened an issue
>> <https://github.com/webpack-contrib/css-loader/issues/567>
>>
>> - React JS - I didn't un-vendor React JS because the pivotal developers
>> submitted a patch to fix issue of QtWebEngine. Once the patch is merged in
>> React repo, we will un-vendor.
>>
>> *Other issues faced:*
>>
>> 1) Backbone JS: I didn't upgraded backbone JS to latest because it
>> affects the application code mainly `Preferences module`.
>>
>> 2) jQuery: I didn't upgraded it to latest because it is gives error in
>> loading wcIframe of wcDocker in Query tool. I submit a PR
>> <https://github.com/WebCabin/wcDocker/pull/118>.
>>
>> 3) Acitree - it is not available in yarn repository. logged an request
>> <https://github.com/dragosu/jquery-aciTree/issues/15>
>> However i am managing it on my github account by forking this repo.
>>
>> Specified the repo github link to `acitree` in package.json with tag to
>> pull from
>> 4.5.0-rc.7
>> <https://github.com/imsurinder90/jquery-aciTree.git#4.5.0-rc.7>. The
>> latest version of actiree has issues so code is used form 4.5.0-rc.7 tag.
>>
>> Thanks to bestander <https://github.com/bestander> for helping this out.
>> link to thread
>> <https://github.com/yarnpkg/yarn/issues/1747#issuecomment-312502008>
>>
>> *Plugins used:*
>>
>> ​- optimize-css-assets-webpack-plugin: its job is to optimise the CSS
>> bundle like minifying CSS and removing comments from it. [used only in
>> production]
>>
>> -  uglifyJS - It minimise the bundled JS​, and remove console statements
>> from code. [used only in production]
>>
>> - definePlugin - It helps in minimising the `React' production bundle. As
>> react has conditional code based on 'NODE_ENV' variable. [used only in
>> production]
>>
>> - providePlugin - It makes the variable defined through out the
>> application context. For example: jQuery object can be accessed wherever
>>  it is used but not included in `define` calls.
>>
>> - CommonsChunkPlugin - it helps in separating vendor like code, common
>> dependent modules used in multiple modules. it extracts out in a file.
>>
>> - extractTextPlugin - it is used in combination with 'css-loader' and
>> 'style-loader'. It helps in extracting CSS and moved into files.
>>
>> - webpack-bundle-analyzer - it helps in analysing the bundled JS files
>> like size of 

Object > delete/drop and properties menu icons misaligned

2017-07-10 Thread Surinder Kumar
Hi

Object > delete/drop & properties icons are now misaligned.

This is regression of commit d56f1d847c946f43bebbfbdefb929870f0050694


I found the lack of information why these changes were necessary, i have
attached a patch which fixes it but it might affect at other place for
which the changes were made originally.

Let me know if an RM is required to track.

Please find attached patch.

Thanks,
Surinder


fix_object_menu_icons.patch
Description: Binary data


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

2017-07-03 Thread Surinder Kumar
Hi All,

*​Things to discuss:*

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

​In Webpack we have to resolve paths to the modules same as in
requirejs.config(base.html). but previously we were using
'current_app.javascripts' which holds the the path references for modules
registered. Now in webpack.config.js we don't have such variable. so the
path to module js has to give manually.

However, there are ​t
wo ways:

​1. ​
The convention should be that static files should go in ‘static/‘ dir and
templates in ‘templates/‘ dir.
​ If this convention is followed, we can search through directories and
pull out static and template file paths.​

​2. ​
As per Ashesh,
​'​
static/
'​
 dir may also have templates file
​ or vice versa​
​.​

​I​
n this case, the convention to identify template file
​can be
,
​templates ​
file must ends with ‘.template.js’ extension
​.
​
The flag ‘is_template’ added in every module’s __init__.py doesn’t help
here because webpack works on files and directories.
​ so there is no way to use this flag.​

*For debug/release mode:*

We’ll get rid of snippets in
​'​
get_own_javascripts
​'​
 and
​'​
get_own_stylesheets
​'​
 defined in modules __init__.py as they are
​ of​
 no use for now as CSS and JS are
​ going to​
 bundl
​e​
. They
​were
 used to load specified CSS and JS files
​ at runtime.​

Introduce a flag ‘-p’ in
​'​
yarn run bundle
​ -p'
 command to tell webpack config to run in development or production mode.
-p is for production.

Few
​W​
ebpack plugins such as UglifyPlugin or other plugins will run only in
production mode to minify JS otherwise load the generated bundle
JS(unminified) in debug mode to help with debugging code.

*Taks remaining:*

​1. ​
Fix local variables which are declared without using var, have to check in
each file
​ by​
 running eslint (For now, i will fix only errors which are giving error in
browser).

​2. ​
Move non-template files from ’templates’ to ’static’ directory. List of
​ pending​
 modules is here:

   - Tools (mostly all modules - 9 modules)
   - Browser nodes - 3 modules(resource group, roles, tablespace)
   - ​About
   ​​

Also can we move
​'​
dashboard, statistic
​s​
, preferences and help
​'​
 modules inside misc to preserve modularity as pgAdmin is modular
​ ?​

​3. Client side implementation of 'url_for' for several modules.

​4. ​
Integrating CSS bundling patch, also pull out inline CSS
​ and unvendor the CSS.​
​Today i worked on it but it is not completed yet, has some effect on UI, i
am looking into it.​

​5. ​
FileManager module is not working
​
as it is loaded via html file
​ and the modules it calls are unavailable at that time.
​I will​
 look into it
​.​
​​

​There are other minor issues that has to take care.​

​6. ​
Caching:

I haven’t read much in detail on caching, but it can used to help browser
know when to cache static resources and when to not. Basically, it give
names to generated bundled files with unique hash and that hash is changed
when a new change in file is detected on running ‘yarn run bundle’.
Also we have to use HTML Webpack plugin to regenerate
​'​
base.html
​'
again with new hash in bundled files
​.


​Thanks,
Surinder​

On Fri, Jun 30, 2017 at 4:40 PM, Dave Page <dp...@pgadmin.org> wrote:

> Awesome work. Do you have an ETA for a feature complete test patch?
>
> On Fri, Jun 30, 2017 at 11:41 AM, Surinder Kumar <
> surinder.ku...@enterprisedb.com> wrote:
>
>> Hi
>>
>> So far, I have been able to generate bundled
>> 'sources/generated/browser.js' which contains only three browser modules
>> (Server-group, Server, Database) and load it from
>> 'browser/index.html'(entry point) and it works(except few JS error present
>> in file). so will fix them.
>>
>> Then I will add one by one dashboard module, nodes(cast, schema etc.),
>> tools which i earlier removed(because their JS had conflicts with vendor
>> JS) and make changes accordingly to webpack config and make other modules
>> to load properly.
>>
>> So far the JS files that won't be the part of  bundled JS and will load
>> separately according to dependency defined in externals in webpack config:
>>
>> 1. browser/utils.js - This file is extracted from browser.js which
>> contains Jinja syntax related code for menus, panels and preference related
>> settings from browser.js
>> 2. endpoints.js
>> 3. messages.js
>> 4. supported_servers.js
>> 5. current_user.js
>> 6. gettext.js
>> 7. translations.js
>>
>> All other JS files will go into bundled JS.
>>
>> Currently replacing '{{ url_for }}' in dashboard JS with client side
>> 'url_for' and load with bundled JS.
>>
>> Thanks,
>> Surinder
>>
>> On Fri, Jun 30, 2017 at 3:34 PM, Surinder Kumar <
>> surinder.ku...@enterprisedb.com> wrote:
>>
>>> Hi

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

2017-06-30 Thread Surinder Kumar
Hi

So far, I have been able to generate bundled 'sources/generated/browser.js'
which contains only three browser modules (Server-group, Server, Database)
and load it from 'browser/index.html'(entry point) and it works(except few
JS error present in file). so will fix them.

Then I will add one by one dashboard module, nodes(cast, schema etc.),
tools which i earlier removed(because their JS had conflicts with vendor
JS) and make changes accordingly to webpack config and make other modules
to load properly.

So far the JS files that won't be the part of  bundled JS and will load
separately according to dependency defined in externals in webpack config:

1. browser/utils.js - This file is extracted from browser.js which contains
Jinja syntax related code for menus, panels and preference related settings
from browser.js
2. endpoints.js
3. messages.js
4. supported_servers.js
5. current_user.js
6. gettext.js
7. translations.js

All other JS files will go into bundled JS.

Currently replacing '{{ url_for }}' in dashboard JS with client side
'url_for' and load with bundled JS.

Thanks,
Surinder

On Fri, Jun 30, 2017 at 3:34 PM, Surinder Kumar <
surinder.ku...@enterprisedb.com> wrote:

> Hi
>
> On Fri, Jun 30, 2017 at 2:29 AM, George Gelashvili <ggelashv...@pivotal.io
> > wrote:
>
>>  Hey Surinder,
>>
>>
>> ​1. ​
>>> Tools
>>> ​(tools.js)​ - It will contain all JS modules under tools directory
>>>
>>>
>>> ​2. ​
>>> Browser
>>> ​(browser.js)​ - It will contain all JS modules under browser directory
>>>
>>
>> By under, do you mean every javascript file recursively under the browser
>> directory?
>>
> ​No, I mean a single bundled javascript ​file of various nodes static JS
> files.
>
>>
>>
>>> ​4. Common.js and/or vendor.js - Common.js will contains all common js
>>> files/libraries shared by modules like backform, backbone, underscore etc.
>>>
>>
>> We're okay with bundling vendorized code for a first pass to webpack
>> everything. The goal should be to pull code out of the shared javascript
>> bundle as we unvendor dependencies.
>>
> Yes, bundled vendor.js will have all unvendor dependencies and files will
> refer from node_modules.
>
>> For naming: Common.js is an overloaded term (
>> http://requirejs.org/docs/commonjs.html). We prefer vendor.js. Will
>> there be non-vendor code put into this bundle?
>> ​I think vendor.js should only contain vendor files. We can create
>> another file(xyz) that will contains JS files shared across the modules.
>>
>> ​What do you think ?​
>>
>>
> ​
>>
>>> Entry points JS: main.js - It will load above modules ascynchronusly or
>>> it will be minified version of all.
>>> define('', ['common', 'tools', 'browser', 'grid'], function(...) {});
>>>
>> or these modules can also be loaded using dependency; For example, load
>>> grid.js on database node expand.
>>>
>>
>> Could you go into some more detail on this decision? How would main.js be
>> used in the app? Is the idea to still use define from require.js in
>> javascript being webpacked?
>>
> ​In pgAdmin4 there is no main.js, but entry point is browser/index.html.​
> This is how I think bundled JS will load:
>
> Load vendor.js using  in base.html
>
> *​browser/​index.html*
>
> require(
> ​  ​
> ['pgadmin',
> ​'sources/generated/common', ​
> 'sources/generated/bundled'],
> ​  ​
> function() {
> }
> ​)​
>
> *sources/generated/bundled​.js​*
>
> ​define
> (
> ​  ​
> ['
> ​sources/generated/browser
> ', 'sources/generated/
> ​tools
> '
> ​, 'sources/generated/grid'​
> ],
> ​  ​
> function
> ​(​
> pgBrowser) {
> ​  pgBrowser.init();​
> }
> )​
> ​
>
>
> ​or we can use 'import'​ instead of 'require' for files that will be
> bundled like 'bundled.js'
> I keep require/define call untouched in module JS, and webpack converts
> 'define' calls to __webpack_require__(module_id) to load dependent modules.
>
>>
>> ​Currently I am working on converting 'requirejs config shim dependency
>>> into webpack' using imports-loader and exports-loader which is taking
>>> time and will look for alternative if it doesn't works. Once dependency is
>>> properly defined, the task to generate other module JS will become quite
>>> easy.
>>>
>>
>> We used imports-loader and exports-loader for tests (see
>> web/webpack.test.config.js)
>>
> ​Hmm. it is useful.​ but I am using shim-loader
> <https://github.com/zinserjan/shim-loader> which is compatible with
> requi

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

2017-06-26 Thread Surinder Kumar
Hi
On Fri, Jun 23, 2017 at 11:39 PM, George Gelashvili <ggelashv...@pivotal.io>
wrote:

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

>
> ​2. CSS property flex is supported for IE >= 9 as per reference
>>> <https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Flexible_Box_Layout/Using_CSS_flexible_boxes>
>>> ​. I tested this patch on IE and layout is broken.​
>>>
>>>  Anyways IE-9/10 are outdated and no longer supported by Microsoft, the
>> only supported browsers are IE-11+.
>>
>
> Does this patch work in supported IEs?
>
​I use Windows 7 which has IE9,10, but if we can fix it for IE9,10 we
should fix. Majority of people are still using IE9,10.​

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

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


[pgAdmin4][Patch]: Using client-side 'url_for' implementation in the datagrid module

2017-06-26 Thread Surinder Kumar
Hi

Changes:

1. Replace Jinja {{ url_for }} with js 'url_for'

2. While minifying JS using webpack, the code to open QueryToolPanel and
DatagridPanel wasn't working. This is fixed.

Please find attached patch.

Thanks,
Surinder Kumar


url_for_datagrid.patch
Description: Binary data


Re: [pgadmin-hackers][patch] Upgrade slickgrid to version 2.3.7

2017-06-23 Thread Surinder Kumar
On Fri, Jun 23, 2017 at 4:21 PM, Dave Page <dp...@pgadmin.org> wrote:

>
>
> On Fri, Jun 23, 2017 at 11:47 AM, Surinder Kumar <
> surinder.ku...@enterprisedb.com> wrote:
>
>> Sorry, I forgot to attach screenshot.
>> I looked into Query tool HTML using inspect tool.
>>
>>
> That's code that's part of SlickGrid isn't it? If there are improvements
> to be made there, patches should be sent upstream. We don't want to modify
> (and thus have to vendorise) 3rd party code unless it's absolutely
> essential.
>
​Yes its part of SlickGrid and changes should go into slick grid repo.​

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


Re: [pgadmin-hackers][patch] Upgrade slickgrid to version 2.3.7

2017-06-23 Thread Surinder Kumar
Hi

On latest git pull, couple of issues:

1. The edit grid font(text-12) is overriden by 'ui-widget' font - Verdana.
2. The dotted border around cell appears again.

The class 'ui-widget' is added dynamically which i don't know why it is
added.

Also, Cascaded style is used(i.e. CSS is embedded into HTML(markup) which
is not recommended due to which css written in files have less precendece
over css written in markup.

Thanks,
Surinder


On Fri, Jun 23, 2017 at 2:08 PM, Dave Page  wrote:

> Thanks - all applied!
>
> On Thu, Jun 22, 2017 at 8:00 PM, Matthew Kleiman 
> wrote:
>
>> Hello Dave,
>>
>> We noticed that the makefile is not installing node_modules
>> dependencies, so we created a new patch that changes the makefile to
>> install node_modules first and then execute the tasks.
>>
>> Thanks
>> Matt && João
>>
>> On Tue, Jun 20, 2017 at 5:23 AM, Dave Page  wrote:
>>
>>> Hi,
>>>
>>> This fails tests:
>>>
>>> (pgadmin4)piranha:pgadmin4 dpage$ make check-feature
>>> cd web && yarn run bundle && python regression/runtests.py --pkg
>>> feature_tests
>>> yarn run v0.24.6
>>> $ yarn run linter && yarn run webpacker
>>> yarn run v0.24.6
>>> $ yarn run eslint pgadmin/static/jsx/**/*.jsx
>>> pgadmin/static/js/selection/*.js regression/javascript/**/*.jsx
>>> regression/javascript/**/*.js *.js
>>> yarn run v0.24.6
>>> $ "/Users/dpage/git/pgadmin4/web/node_modules/.bin/eslint"
>>> pgadmin/static/jsx/history/query_history.jsx
>>> pgadmin/static/jsx/history/query_history_entry.jsx
>>> pgadmin/static/js/selection/active_cell_capture.js
>>> pgadmin/static/js/selection/clipboard.js
>>> pgadmin/static/js/selection/column_selector.js
>>> pgadmin/static/js/selection/copy_data.js
>>> pgadmin/static/js/selection/grid_selector.js
>>> pgadmin/static/js/selection/range_boundary_navigator.js
>>> pgadmin/static/js/selection/range_selection_helper.js
>>> pgadmin/static/js/selection/row_selector.js
>>> pgadmin/static/js/selection/set_staged_rows.js
>>> pgadmin/static/js/selection/xcell_selection_model.js
>>> regression/javascript/history/query_history_entry_spec.jsx
>>> regression/javascript/history/query_history_spec.jsx
>>> regression/javascript/browser/menu_spec.js
>>> regression/javascript/history/history_collection_spec.js
>>> regression/javascript/selection/active_cell_capture_spec.js
>>> regression/javascript/selection/column_selector_spec.js
>>> regression/javascript/selection/copy_data_spec.js
>>> regression/javascript/selection/grid_selector_spec.js
>>> regression/javascript/selection/range_boundary_navigator_spec.js
>>> regression/javascript/selection/range_selection_helper_spec.js
>>> regression/javascript/selection/row_selector_spec.js
>>> regression/javascript/selection/set_staged_rows_spec.js
>>> regression/javascript/selection/xcell_selection_model_spec.js
>>> regression/javascript/slickgrid/cell_selector_spec.js karma.conf.js
>>> webpack.config.js webpack.test.config.js
>>> ✨  Done in 1.17s.
>>> ✨  Done in 1.40s.
>>> yarn run v0.24.6
>>> $ yarn run webpack -- --config webpack.config.js
>>> yarn run v0.24.6
>>> $ "/Users/dpage/git/pgadmin4/web/node_modules/.bin/webpack" --config
>>> webpack.config.js
>>> (node:33997) DeprecationWarning: loaderUtils.parseQuery() received a
>>> non-string value which can be problematic, see
>>> https://github.com/webpack/loader-utils/issues/56
>>> parseQuery() will be replaced with getOptions() in the next major
>>> version of loader-utils.
>>> Hash: fe4471bbef0e7c5081ef
>>> Version: webpack 2.3.3
>>> Time: 1552ms
>>>  Asset Size  ChunksChunk Names
>>> reactComponents.js  1.21 MB   0  [emitted]  [big]  reactComponents
>>> history.js  5.37 kB   1  [emitted] history
>>>   slickgrid.js  4.78 kB   2  [emitted] slickgrid
>>>[5] /Users/dpage/git/pgadmin4/web/~/object-assign/index.js 2.11 kB
>>> {0} [built]
>>>   [20] /Users/dpage/git/pgadmin4/web/~/react/lib/React.js 2.69 kB {0}
>>> [built]
>>>   [32] /Users/dpage/git/pgadmin4/web/~/react/react.js 56 bytes {0}
>>> [built]
>>>  [196] ./js/history/history_collection.js 1.91 kB {1} [built]
>>>  [197] ./jsx/history/query_history.jsx 3.65 kB {0} [built]
>>>  [198] /Users/dpage/git/pgadmin4/web/~/react-dom/index.js 59 bytes {0}
>>> [built]
>>>  [199] ./bundle/components.js 604 bytes {0} [built]
>>>  [200] ./bundle/slickgrid.js 620 bytes {2} [built]
>>>  [201] ./js/history/index.js 690 bytes {1} [built]
>>>  [202] ./jsx/history/query_history_entry.jsx 5.21 kB {0} [built]
>>>  [233] /Users/dpage/git/pgadmin4/web/~/react-dom/lib/ReactDOM.js 5.14
>>> kB {0} [built]
>>>  [282] /Users/dpage/git/pgadmin4/web/~/react-dom/lib/findDOMNode.js
>>> 2.46 kB {0} [built]
>>>  [296] /Users/dpage/git/pgadmin4/web/~/react/lib/ReactPropTypes.js
>>> 15.8 kB {0} [built]
>>>  [297] /Users/dpage/git/pgadmin4/web/~/react/lib/ReactPureComponent.js
>>> 1.32 kB {0} [built]
>>>  [298]