Re: [pgadmin-hackers] pgAdmin 4 commit: Use a more sensible name for Query Tool tabs. Fixes #

2017-06-15 Thread Surinder Kumar
Hi Dave,

Please find attached patch. It should work.
In previous patch I was unaware that i added untracked file to tracked.

On Thu, Jun 15, 2017 at 4:10 PM, Dave Page <dp...@pgadmin.org> wrote:

> Hi
>
> Was this patch generated against a WIP branch? I get:
>
> (pgadmin4)piranha:pgadmin4 dpage$ git apply ~/Downloads/fix_scripts_in_
> query_tool.patch
> error: web/pgadmin/static/js/setup_connection.js: No such file or
> directory
>
> On Thu, Jun 15, 2017 at 6:36 AM, Surinder Kumar <
> surinder.ku...@enterprisedb.com> wrote:
>
>> Hi
>>
>> PFA patch which fixes the issue Harshal reported.
>>
>> Thanks,
>> Surinder
>>
>> On Thu, Jun 15, 2017 at 3:52 AM, Harshal Dhumal <
>> harshal.dhu...@enterprisedb.com> wrote:
>>
>>> Surinder,
>>>
>>> I guess this broke the script options (Create, Delete, Select, Insert,
>>> Update)
>>>
>>>
>>> VM4124 datagrid.js:440 Uncaught TypeError: self.get_panel_title is not
>>> a function at Object.success (VM4124 datagrid.js:440) at fire (
>>> jquery-1.11.2.js:3143) at Object.fireWith [as resolveWith] (
>>> jquery-1.11.2.js:3255) at done (jquery-1.11.2.js:9309) at
>>> XMLHttpRequest.callback (jquery-1.11.2.js:9713)
>>> success @ VM4124 datagrid.js:440
>>> fire @ jquery-1.11.2.js:3143
>>> fireWith @ jquery-1.11.2.js:3255
>>> done @ jquery-1.11.2.js:9309
>>> callback @ jquery-1.11.2.js:9713
>>>
>>>
>>>
>>>
>>> --
>>> *Harshal Dhumal*
>>> *Sr. Software Engineer*
>>>
>>> EnterpriseDB India: http://www.enterprisedb.com
>>> The Enterprise PostgreSQL Company
>>>
>>> On Tue, Jun 13, 2017 at 4:04 PM, Dave Page <dp...@pgadmin.org> wrote:
>>>
>>>> Use a more sensible name for Query Tool tabs. Fixes #2482
>>>>
>>>> Branch
>>>> --
>>>> master
>>>>
>>>> Details
>>>> ---
>>>> https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdif
>>>> f;h=57d866f7b70996a82a881b20248c3285ab3a6900
>>>> Author: Surinder Kumar <surinder.ku...@enterprisedb.com>
>>>>
>>>> Modified Files
>>>> --
>>>> web/pgadmin/browser/templates/browser/js/node.js   |  4 +-
>>>> web/pgadmin/static/css/webcabin.overrides.css  | 13 +
>>>> .../datagrid/templates/datagrid/js/datagrid.js | 58
>>>> --
>>>> .../sqleditor/templates/sqleditor/js/sqleditor.js  |  5 +-
>>>> 4 files changed, 49 insertions(+), 31 deletions(-)
>>>>
>>>>
>>>> --
>>>> Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
>>>> To make changes to your subscription:
>>>> http://www.postgresql.org/mailpref/pgadmin-hackers
>>>>
>>>
>>>
>>
>>
>> --
>> Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
>> To make changes to your subscription:
>> http://www.postgresql.org/mailpref/pgadmin-hackers
>>
>>
>
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>


fix_scripts_in_query_tool_v1.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] pgAdmin 4 commit: Use a more sensible name for Query Tool tabs. Fixes #

2017-06-14 Thread Surinder Kumar
Hi

PFA patch which fixes the issue Harshal reported.

Thanks,
Surinder

On Thu, Jun 15, 2017 at 3:52 AM, Harshal Dhumal <
harshal.dhu...@enterprisedb.com> wrote:

> Surinder,
>
> I guess this broke the script options (Create, Delete, Select, Insert,
> Update)
>
>
> VM4124 datagrid.js:440 Uncaught TypeError: self.get_panel_title is not a
> function at Object.success (VM4124 datagrid.js:440) at fire (
> jquery-1.11.2.js:3143) at Object.fireWith [as resolveWith] (
> jquery-1.11.2.js:3255) at done (jquery-1.11.2.js:9309) at
> XMLHttpRequest.callback (jquery-1.11.2.js:9713)
> success @ VM4124 datagrid.js:440
> fire @ jquery-1.11.2.js:3143
> fireWith @ jquery-1.11.2.js:3255
> done @ jquery-1.11.2.js:9309
> callback @ jquery-1.11.2.js:9713
>
>
>
>
> --
> *Harshal Dhumal*
> *Sr. Software Engineer*
>
> EnterpriseDB India: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
> On Tue, Jun 13, 2017 at 4:04 PM, Dave Page <dp...@pgadmin.org> wrote:
>
>> Use a more sensible name for Query Tool tabs. Fixes #2482
>>
>> Branch
>> --
>> master
>>
>> Details
>> ---
>> https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdif
>> f;h=57d866f7b70996a82a881b20248c3285ab3a6900
>> Author: Surinder Kumar <surinder.ku...@enterprisedb.com>
>>
>> Modified Files
>> --
>> web/pgadmin/browser/templates/browser/js/node.js   |  4 +-
>> web/pgadmin/static/css/webcabin.overrides.css  | 13 +
>> .../datagrid/templates/datagrid/js/datagrid.js | 58
>> --
>> .../sqleditor/templates/sqleditor/js/sqleditor.js  |  5 +-
>> 4 files changed, 49 insertions(+), 31 deletions(-)
>>
>>
>> --
>> Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
>> To make changes to your subscription:
>> http://www.postgresql.org/mailpref/pgadmin-hackers
>>
>
>


fix_scripts_in_query_tool.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] [pgAdmin4][Patch][RM_2482]: Query tool/ Edit grid panel should have meaningful title

2017-06-13 Thread Surinder Kumar
On Tue, Jun 13, 2017 at 11:24 PM, Shirley Wang <sw...@pivotal.io> wrote:

>
>
> On Tue, Jun 13, 2017 at 10:42 AM Surinder Kumar <
> surinder.ku...@enterprisedb.com> wrote:
>
>> On Tue, Jun 13, 2017 at 10:08 PM, Shirley Wang <sw...@pivotal.io> wrote:
>>
>>> Awesome!! This is super helpful :)
>>>
>>> Does this affect a new query window (currently the title is 'Query -
>>> untitled')?
>>>
>> ​Yes, in this case the title of query window will be Query - [db_name]
>> on [server_name]. It was showing 'Query - untitled' when opened from
>> context menu because no tree information was passed.
>>
>
> I know you enabled ellipses for names that are too long, but if it's a
> database name and server name in a tab, I think that all the tabs will have
> ellipses. Considering that, what if we just shorten it to the database
> name, especially since the blue bar where you type the SQL has the name of
> the server.
>
​Yes ellipses and tooltips are used if name is too long.
​But what I think is the title has all useful information about the
database and server it is connected to, considering the case:

1) When multiple instances of query tool are opened in New Tab/Window. or
when a user has multiple screens.

2) If a user is parallely running multiple instance of query tool for
different databases of different servers. server name will help uniquely
identify the tab.

3) The panel can be moved out of Panels tab by dragging out, so the panel
title must have server and database information.

considering the above cases, I think the blue bar could be removed If query
tool title already have server and database information.


Re: [pgadmin-hackers] [pgAdmin4][Patch][RM_ 2477]: New Line text edit pop up renders off page when the size of the grid exceeds the size of the window

2017-06-13 Thread Surinder Kumar
Hi

On Tue, Jun 13, 2017 at 2:54 PM, Dave Page <dp...@pgadmin.org> wrote:

> On Mon, Jun 12, 2017 at 5:55 PM, Shirley Wang <sw...@pivotal.io> wrote:
> >>>
> >>>
> >>> On Mon, Jun 12, 2017 at 2:27 PM, Surinder Kumar
> >>> <surinder.ku...@enterprisedb.com> wrote:
> >>> > Hi
> >>> >
> >>> > The current font-family applied to slick-grid is
> >>> > 'Verdana,Arial,sans-serif'.
> >>> > I tried changing it to "Helvetica Neue", Helvetica, Arial, sans-serif
> >>> > but
> >>> > the font size and spacing between text is reduced. so to match style
> I
> >>> > used
> >>> > "Verdana".
> >>> >
> >>> > Also, as per my knowledge, the Helvetica font will work only for
> >>> > Operating
> >>> > Systems where this font actually exists in system, otherwise it will
> >>> > pick
> >>> > Arial font.
> >>> >
> >>> > The right way to use 'Helvetica' is to download its 'ttf' and 'eot'
> >>> > files
> >>> > and use in CSS so that it appears same on all machines:
> >>> >
> >>> > https://stackoverflow.com/questions/13013616/css-
> helvetica-neue-not-working
> >>> >
> >>> > But it seems it is not available for free
> >>> > https://www.myfonts.com/fonts/linotype/neue-helvetica/licensing.html
> >>>
> >>> Oh, that's not good. I assume we were relying on it being on a users
> >>> machine already. I think we need to do one of two things:
> >>>
> >>> 1) Default to a font that we know should exist everywhere.
> >>> 2) Have a fallback from Helvetica Neue to Arial or similar.
> >>>
> >>> 3) Choose something completely new and free, and ship it with the app.
> >>>
> >>> I prefer 1 if possible, then 2, finally 3.
> >>>
> >>> Shirley, any thoughts?
> >
> >
> > Option 1 would require us choosing something new and free (there are a
> lot
> > of webfonts you can get from Google) but would take some time to pick the
> > appropriate one.
> >
> > Option 2 would be the best option for now. We should stick with Helvetica
> > and Arial until we have more time to choose the right font.
>
> Sounds good to me.
>
> Surinder, can you make that change please? And update any other font
> definitions in our CSS to have the same fallback?
>
​Added fonts Arial, Verdana as fallback in pgadmin.styles.css file. Also
used text-12​ class for datagrid element.

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


RM_2477_v1.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] [pgAdmin4] [PATCH] History Tab rewrite in React

2017-06-13 Thread Surinder Kumar
On Tue, Jun 13, 2017 at 4:05 PM, Dave Page <dp...@pgadmin.org> wrote:

> On Tue, Jun 13, 2017 at 11:31 AM, Surinder Kumar
> <surinder.ku...@enterprisedb.com> wrote:
> >
> > On Tue, Jun 13, 2017 at 3:56 PM, Dave Page <dp...@pgadmin.org> wrote:
> >>
> >> On Tue, Jun 13, 2017 at 11:22 AM, Ashesh Vashi
> >> <ashesh.va...@enterprisedb.com> wrote:
> >> > On Tue, Jun 13, 2017 at 2:47 PM, Dave Page <dp...@pgadmin.org> wrote:
> >> >>
> >> >> And then I find a problem. Sigh.
> >> >>
> >> >> When running in the desktop runtime, under QtWekKit (the forked,
> >> >> updated version that is by far the best of the browser engines we've
> >> >> used), we get the attached error at startup. I don't see this under
> >> >> QtWebEngine, though as we've already found, that's not usable for
> >> >> other reasons.
> >> >>
> >> >> Is this fixable?
> >> >
> >> > As per 'http://qtwebkit.blogspot.in/2016/08/qtwebkit-im-back.html':
> >> > "
> >> > WebKit engine itself has not been updated since Qt 5.2 release. That's
> >> > why
> >> > it didn't support recent changes in Web standards that happened after
> >> > 2013,
> >> > including: new JavaScript language standard ES2015 (also known as
> ES6),
> >> > as
> >> > well as improvements in DOM API and CSS.
> >> > ...
> >> > "
> >> >
> >> > Could this be a reason?
> >>
> >> For the old webkit, certainly, but if you read further down, the
> >> version we're using has been updated and does now claim to support
> >> most of ES2015.
> >
> > In fact the modern browsers don't support ES6 JS so the JS files
> containing
> > ES6 code are first transpiled using babel into JS that browsers supports.
>
> Well, we *could* do that, but are we? I'm not sure the current code
> does anything more than lint and webpack it.
>
​Yes. babel is used in webpack config which converts JSX, JS and react JS
library code into browser supportable JS code and put them into generated
directory which we are then imported in sqleditor.js

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


Re: [pgadmin-hackers] [pgAdmin4] [PATCH] History Tab rewrite in React

2017-06-13 Thread Surinder Kumar
On Tue, Jun 13, 2017 at 3:56 PM, Dave Page  wrote:

> On Tue, Jun 13, 2017 at 11:22 AM, Ashesh Vashi
>  wrote:
> > On Tue, Jun 13, 2017 at 2:47 PM, Dave Page  wrote:
> >>
> >> And then I find a problem. Sigh.
> >>
> >> When running in the desktop runtime, under QtWekKit (the forked,
> >> updated version that is by far the best of the browser engines we've
> >> used), we get the attached error at startup. I don't see this under
> >> QtWebEngine, though as we've already found, that's not usable for
> >> other reasons.
> >>
> >> Is this fixable?
> >
> > As per 'http://qtwebkit.blogspot.in/2016/08/qtwebkit-im-back.html':
> > "
> > WebKit engine itself has not been updated since Qt 5.2 release. That's
> why
> > it didn't support recent changes in Web standards that happened after
> 2013,
> > including: new JavaScript language standard ES2015 (also known as ES6),
> as
> > well as improvements in DOM API and CSS.
> > ...
> > "
> >
> > Could this be a reason?
>
> For the old webkit, certainly, but if you read further down, the
> version we're using has been updated and does now claim to support
> most of ES2015.
>
​In fact the modern browsers don't support ES6 JS so the JS files
containing ES6 code are first transpiled using babel into JS that browsers
supports.

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


[pgadmin-hackers] [pgAdmin4][Patch][RM_2482]: Query tool/ Edit grid panel should have meaningful title

2017-06-12 Thread Surinder Kumar
Hi

Changes:

1) When Query tool is opened, right now - panel title is displayed as
"Query - 1 ", instead it should display Query - [db_name] on [server_name] as
in pgAdmin3.

2) When Edit grid is opened for table, the panel title should display
Edit Data - [server_name] - [db_name] - [table_name]

These names are more meaningful instead of "Query - #'. helpful while
switching to panel tabs.

3) If panel is inactive and its title is quite long, show ellipsis(...),
otherwise display full title.

4) Add tooltips to Query tool/Edit grid panel on mouse hover of tab.

Also tested with preference settings > Open query tool in new tab. It
works!!.

Please find attached patch

Thanks
Surinder


RM_2482.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] [pgAdmin4][Patch][Feature_1535]: Pressing ESC from within a dialog box should act like "Cancel" button

2017-06-12 Thread Surinder Kumar
Hi Dave,

Please find updated patch.

On Mon, Jun 12, 2017 at 7:58 PM, Dave Page <dp...@pgadmin.org> wrote:

> Hi
>
> On Mon, Jun 12, 2017 at 2:03 PM, Surinder Kumar
> <surinder.ku...@enterprisedb.com> wrote:
> > Hi
> >
> > I confirm this is updated patch.
>
> Thanks. Something else seems to have changed that I can't spot. Only
>  should be ignored if a child control has focus - Escape and
> F1 should continue to work. I tried moving the:
>
> if (panel && panel['_type'] !== 'node_props') return;
>
> into the branch for keyCode.ENTER, but that doesn't seem to help.
>
​Fixed.​

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


Feature_1535_rebased_v1.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] [pgAdmin4][Patch][RM_ 2477]: New Line text edit pop up renders off page when the size of the grid exceeds the size of the window

2017-06-12 Thread Surinder Kumar
Hi

The current font-family applied to slick-grid is 'Verdana,Arial,sans-serif'.
I tried changing it to "Helvetica Neue", Helvetica, Arial, sans-serif but
the font size and spacing between text is reduced. so to match style I used
"Verdana".

Also, as per my knowledge, the Helvetica font will work only for Operating
Systems where this font actually exists in system, otherwise it will pick
Arial font.

The right way to use 'Helvetica' is to download its 'ttf' and 'eot' files
and use in CSS so that it appears same on all machines:
https://stackoverflow.com/questions/13013616/css-helvetica-neue-not-working

But it seems it is not available for free
https://www.myfonts.com/fonts/linotype/neue-helvetica/licensing.html

On Mon, Jun 12, 2017 at 6:16 PM, Dave Page <dp...@pgadmin.org> wrote:

> Hi
>
> Can you update this so that the CSS all follows the standards in the
> WIP styleguide please? I see that the current patch is using the wrong
> font for example.
>
> http://pgadmin4-styleguide.cfapps.io/
>
> Thanks!
>
> On Mon, Jun 12, 2017 at 11:57 AM, Surinder Kumar
> <surinder.ku...@enterprisedb.com> wrote:
> > Hi
> >
> > Changes:
> >
> > 1) Calculate text editor position properly when the size of the grid
> exceeds
> > the size of the window.
> >
> > 2) Assign NumberEditor to cell types('oid', 'xid', 'real').
> >
> > 3) Remove inline styles from rendered editors and move its styles to CSS
> > file.
> >
> > Please find attached patch and review.
> >
> > Thanks
> > Surinder
> >
> >
> > --
> > Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
> > To make changes to your subscription:
> > http://www.postgresql.org/mailpref/pgadmin-hackers
> >
>
>
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>


Re: [pgadmin-hackers] [pgAdmin4][Patch][Feature_1535]: Pressing ESC from within a dialog box should act like "Cancel" button

2017-06-12 Thread Surinder Kumar
Hi

I confirm this is updated patch.

PFA patch.
On Mon, Jun 12, 2017 at 6:20 PM, Dave Page <dp...@pgadmin.org> wrote:

> Hi
>
> Is that the correct patch? Hitting  in a comment text area is
> still causing the dialogue to close.​


> Thanks.
>
> On Mon, Jun 12, 2017 at 12:55 PM, Surinder Kumar
> <surinder.ku...@enterprisedb.com> wrote:
> > Hi
> >
> > Please find rebased patch
> >
> > Thanks
> >
> > On Mon, Jun 12, 2017 at 5:20 PM, Dave Page <dp...@pgadmin.org> wrote:
> >>
> >> Could you rebase this please?
> >>
> >> Thanks.
> >>
> >> On Fri, Jun 9, 2017 at 10:40 AM, Surinder Kumar
> >> <surinder.ku...@enterprisedb.com> wrote:
> >> > Ignore previous patch as it doesn't contains new changes.
> >> > Please find attached patch.
> >> >
> >> >
> >> > On Fri, Jun 9, 2017 at 3:06 PM, Surinder Kumar
> >> > <surinder.ku...@enterprisedb.com> wrote:
> >> >>
> >> >> Hi
> >> >>
> >> >> PFA patch and review.
> >> >>
> >> >>
> >> >> On Fri, Jun 9, 2017 at 1:47 PM, Dave Page <dp...@pgadmin.org> wrote:
> >> >>>
> >> >>> Hi
> >> >>>
> >> >>> Ahh, now we have a bug. In the properties dialogues, if you edit a
> >> >>> comment, as soon as the Save button gets enabled, hitting Return
> will
> >> >>> Save the changes instead of adding a newline to the comment. That's
> >> >>> clearly not right :-(
> >> >>
> >> >> Now if event.target is its child elements(for example input, textarea
> >> >> etc), the function "handleKeyDown(event)" won't call.
> >> >>>
> >> >>>
> >> >>> On Fri, Jun 9, 2017 at 7:48 AM, Surinder Kumar
> >> >>> <surinder.ku...@enterprisedb.com> wrote:
> >> >>> > Hi
> >> >>> >
> >> >>> > Please find updated patch.
> >> >>> >
> >> >>> > Thanks,
> >> >>> > Surinder
> >> >>> >
> >> >>> > On Thu, Jun 8, 2017 at 7:16 PM, Dave Page <dp...@pgadmin.org>
> wrote:
> >> >>> >>
> >> >>> >> Hi
> >> >>> >>
> >> >>> >> On Thu, Jun 8, 2017 at 5:38 AM, Surinder Kumar
> >> >>> >> <surinder.ku...@enterprisedb.com> wrote:
> >> >>> >> > Hi
> >> >>> >> >
> >> >>> >> > The attribute key for Ok, Save buttons should be mapped to
> >> >>> >> > 13(Enter),
> >> >>> >> > for Help - 112(F1) and
> >> >>> >> > for Cancel - 27(Esc)
> >> >>> >> > The above changes are made into all dialog related template
> >> >>> >> > files.
> >> >>> >> >
> >> >>> >> > PFA patch and review.
> >> >>> >>
> >> >>> >> Looks good. Just a couple of thoughts:
> >> >>> >>
> >> >>> >> - You've missed the object property dialogues. This really needs
> to
> >> >>> >> be
> >> >>> >> consistent across all dialogues :-)
> >> >>> >>
> >> >>> >> - The behaviour with Enter is a bit odd, because priority will be
> >> >>> >> given the the focussed control to handle it. That's what we want
> if
> >> >>> >> it's a text area for example, but on the other hand, if you open
> >> >>> >> the
> >> >>> >> Preference dialogue, then the Help button gets focus first, so
> >> >>> >> Enter
> >> >>> >> there will end up opening the docs. I suspect in most cases the
> >> >>> >> behaviour you've got is fine, so I'm not inclined to change it.
> >> >>> >>  >> >>> >> a little> Hmm, I see similar behaviour in some other apps. Let's
> >> >>> >> leave
> >> >>> >> it as you've done it :-)
> >> >>> >>
> >> >>> >> Please add support for the properties dialogues, then I think
> we're
> >> >>> >> good
> >> >>> >> to go.
> >> >>> >
> >> >>> > Done.
> >> >>> >>
> >> >>> >>
> >> >>> >> Thanks!
> >> >>> >>
> >> >>> >> --
> >> >>> >> Dave Page
> >> >>> >> Blog: http://pgsnake.blogspot.com
> >> >>> >> Twitter: @pgsnake
> >> >>> >>
> >> >>> >> EnterpriseDB UK: http://www.enterprisedb.com
> >> >>> >> The Enterprise PostgreSQL Company
> >> >>> >
> >> >>> >
> >> >>>
> >> >>>
> >> >>>
> >> >>> --
> >> >>> Dave Page
> >> >>> Blog: http://pgsnake.blogspot.com
> >> >>> Twitter: @pgsnake
> >> >>>
> >> >>> EnterpriseDB UK: http://www.enterprisedb.com
> >> >>> The Enterprise PostgreSQL Company
> >> >>
> >> >>
> >> >
> >>
> >>
> >>
> >> --
> >> 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
>


Feature_1535_rebased.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] [pgAdmin4][Patch][Feature_1535]: Pressing ESC from within a dialog box should act like "Cancel" button

2017-06-12 Thread Surinder Kumar
Hi

Please find rebased patch

Thanks

On Mon, Jun 12, 2017 at 5:20 PM, Dave Page <dp...@pgadmin.org> wrote:

> Could you rebase this please?
>
> Thanks.
>
> On Fri, Jun 9, 2017 at 10:40 AM, Surinder Kumar
> <surinder.ku...@enterprisedb.com> wrote:
> > Ignore previous patch as it doesn't contains new changes.
> > Please find attached patch.
> >
> >
> > On Fri, Jun 9, 2017 at 3:06 PM, Surinder Kumar
> > <surinder.ku...@enterprisedb.com> wrote:
> >>
> >> Hi
> >>
> >> PFA patch and review.
> >>
> >>
> >> On Fri, Jun 9, 2017 at 1:47 PM, Dave Page <dp...@pgadmin.org> wrote:
> >>>
> >>> Hi
> >>>
> >>> Ahh, now we have a bug. In the properties dialogues, if you edit a
> >>> comment, as soon as the Save button gets enabled, hitting Return will
> >>> Save the changes instead of adding a newline to the comment. That's
> >>> clearly not right :-(
> >>
> >> Now if event.target is its child elements(for example input, textarea
> >> etc), the function "handleKeyDown(event)" won't call.
> >>>
> >>>
> >>> On Fri, Jun 9, 2017 at 7:48 AM, Surinder Kumar
> >>> <surinder.ku...@enterprisedb.com> wrote:
> >>> > Hi
> >>> >
> >>> > Please find updated patch.
> >>> >
> >>> > Thanks,
> >>> > Surinder
> >>> >
> >>> > On Thu, Jun 8, 2017 at 7:16 PM, Dave Page <dp...@pgadmin.org> wrote:
> >>> >>
> >>> >> Hi
> >>> >>
> >>> >> On Thu, Jun 8, 2017 at 5:38 AM, Surinder Kumar
> >>> >> <surinder.ku...@enterprisedb.com> wrote:
> >>> >> > Hi
> >>> >> >
> >>> >> > The attribute key for Ok, Save buttons should be mapped to
> >>> >> > 13(Enter),
> >>> >> > for Help - 112(F1) and
> >>> >> > for Cancel - 27(Esc)
> >>> >> > The above changes are made into all dialog related template files.
> >>> >> >
> >>> >> > PFA patch and review.
> >>> >>
> >>> >> Looks good. Just a couple of thoughts:
> >>> >>
> >>> >> - You've missed the object property dialogues. This really needs to
> be
> >>> >> consistent across all dialogues :-)
> >>> >>
> >>> >> - The behaviour with Enter is a bit odd, because priority will be
> >>> >> given the the focussed control to handle it. That's what we want if
> >>> >> it's a text area for example, but on the other hand, if you open the
> >>> >> Preference dialogue, then the Help button gets focus first, so Enter
> >>> >> there will end up opening the docs. I suspect in most cases the
> >>> >> behaviour you've got is fine, so I'm not inclined to change it.
>  >>> >> a little> Hmm, I see similar behaviour in some other apps. Let's
> leave
> >>> >> it as you've done it :-)
> >>> >>
> >>> >> Please add support for the properties dialogues, then I think we're
> >>> >> good
> >>> >> to go.
> >>> >
> >>> > Done.
> >>> >>
> >>> >>
> >>> >> Thanks!
> >>> >>
> >>> >> --
> >>> >> Dave Page
> >>> >> Blog: http://pgsnake.blogspot.com
> >>> >> Twitter: @pgsnake
> >>> >>
> >>> >> EnterpriseDB UK: http://www.enterprisedb.com
> >>> >> The Enterprise PostgreSQL Company
> >>> >
> >>> >
> >>>
> >>>
> >>>
> >>> --
> >>> Dave Page
> >>> Blog: http://pgsnake.blogspot.com
> >>> Twitter: @pgsnake
> >>>
> >>> EnterpriseDB UK: http://www.enterprisedb.com
> >>> The Enterprise PostgreSQL Company
> >>
> >>
> >
>
>
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>


Feature_1535_v2.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] [pgAdmin4][Patch][Feature_1535]: Pressing ESC from within a dialog box should act like "Cancel" button

2017-06-09 Thread Surinder Kumar
Ignore previous patch as it doesn't contains new changes.
Please find attached patch.


On Fri, Jun 9, 2017 at 3:06 PM, Surinder Kumar <surinder.kumar@enterprisedb.
com> wrote:

> Hi
>
> PFA patch and review.
>
>
> On Fri, Jun 9, 2017 at 1:47 PM, Dave Page <dp...@pgadmin.org> wrote:
>
>> Hi
>>
>> Ahh, now we have a bug. In the properties dialogues, if you edit a
>> comment, as soon as the Save button gets enabled, hitting Return will
>> Save the changes instead of adding a newline to the comment. That's
>> clearly not right :-(
>>
> ​Now if event.target is its child elements(for example input, textarea
> etc), the function "handleKeyDown(event)" won't call.
>
>>
>> On Fri, Jun 9, 2017 at 7:48 AM, Surinder Kumar
>> <surinder.ku...@enterprisedb.com> wrote:
>> > Hi
>> >
>> > Please find updated patch.
>> >
>> > Thanks,
>> > Surinder
>> >
>> > On Thu, Jun 8, 2017 at 7:16 PM, Dave Page <dp...@pgadmin.org> wrote:
>> >>
>> >> Hi
>> >>
>> >> On Thu, Jun 8, 2017 at 5:38 AM, Surinder Kumar
>> >> <surinder.ku...@enterprisedb.com> wrote:
>> >> > Hi
>> >> >
>> >> > The attribute key for Ok, Save buttons should be mapped to 13(Enter),
>> >> > for Help - 112(F1) and
>> >> > for Cancel - 27(Esc)
>> >> > The above changes are made into all dialog related template files.
>> >> >
>> >> > PFA patch and review.
>> >>
>> >> Looks good. Just a couple of thoughts:
>> >>
>> >> - You've missed the object property dialogues. This really needs to be
>> >> consistent across all dialogues :-)
>> >>
>> >> - The behaviour with Enter is a bit odd, because priority will be
>> >> given the the focussed control to handle it. That's what we want if
>> >> it's a text area for example, but on the other hand, if you open the
>> >> Preference dialogue, then the Help button gets focus first, so Enter
>> >> there will end up opening the docs. I suspect in most cases the
>> >> behaviour you've got is fine, so I'm not inclined to change it. > >> a little> Hmm, I see similar behaviour in some other apps. Let's leave
>> >> it as you've done it :-)
>> >>
>> >> Please add support for the properties dialogues, then I think we're
>> good
>> >> to go.
>> >
>> > Done.
>> >>
>> >>
>> >> Thanks!
>> >>
>> >> --
>> >> Dave Page
>> >> Blog: http://pgsnake.blogspot.com
>> >> Twitter: @pgsnake
>> >>
>> >> EnterpriseDB UK: http://www.enterprisedb.com
>> >> The Enterprise PostgreSQL Company
>> >
>> >
>>
>>
>>
>> --
>> Dave Page
>> Blog: http://pgsnake.blogspot.com
>> Twitter: @pgsnake
>>
>> EnterpriseDB UK: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>>
>
>


Feature_1533_v2.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] [pgAdmin4][Patch][Feature_1535]: Pressing ESC from within a dialog box should act like "Cancel" button

2017-06-09 Thread Surinder Kumar
Hi

PFA patch and review.


On Fri, Jun 9, 2017 at 1:47 PM, Dave Page <dp...@pgadmin.org> wrote:

> Hi
>
> Ahh, now we have a bug. In the properties dialogues, if you edit a
> comment, as soon as the Save button gets enabled, hitting Return will
> Save the changes instead of adding a newline to the comment. That's
> clearly not right :-(
>
​Now if event.target is its child elements(for example input, textarea
etc), the function "handleKeyDown(event)" won't call.

>
> On Fri, Jun 9, 2017 at 7:48 AM, Surinder Kumar
> <surinder.ku...@enterprisedb.com> wrote:
> > Hi
> >
> > Please find updated patch.
> >
> > Thanks,
> > Surinder
> >
> > On Thu, Jun 8, 2017 at 7:16 PM, Dave Page <dp...@pgadmin.org> wrote:
> >>
> >> Hi
> >>
> >> On Thu, Jun 8, 2017 at 5:38 AM, Surinder Kumar
> >> <surinder.ku...@enterprisedb.com> wrote:
> >> > Hi
> >> >
> >> > The attribute key for Ok, Save buttons should be mapped to 13(Enter),
> >> > for Help - 112(F1) and
> >> > for Cancel - 27(Esc)
> >> > The above changes are made into all dialog related template files.
> >> >
> >> > PFA patch and review.
> >>
> >> Looks good. Just a couple of thoughts:
> >>
> >> - You've missed the object property dialogues. This really needs to be
> >> consistent across all dialogues :-)
> >>
> >> - The behaviour with Enter is a bit odd, because priority will be
> >> given the the focussed control to handle it. That's what we want if
> >> it's a text area for example, but on the other hand, if you open the
> >> Preference dialogue, then the Help button gets focus first, so Enter
> >> there will end up opening the docs. I suspect in most cases the
> >> behaviour you've got is fine, so I'm not inclined to change it.  >> a little> Hmm, I see similar behaviour in some other apps. Let's leave
> >> it as you've done it :-)
> >>
> >> Please add support for the properties dialogues, then I think we're good
> >> to go.
> >
> > Done.
> >>
> >>
> >> Thanks!
> >>
> >> --
> >> Dave Page
> >> Blog: http://pgsnake.blogspot.com
> >> Twitter: @pgsnake
> >>
> >> EnterpriseDB UK: http://www.enterprisedb.com
> >> The Enterprise PostgreSQL Company
> >
> >
>
>
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>


Feature_1533_v2.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] [pgAdmin4][Patch][Feature_1535]: Pressing ESC from within a dialog box should act like "Cancel" button

2017-06-09 Thread Surinder Kumar
Hi

Please find updated patch.

Thanks,
Surinder

On Thu, Jun 8, 2017 at 7:16 PM, Dave Page <dp...@pgadmin.org> wrote:

> Hi
>
> On Thu, Jun 8, 2017 at 5:38 AM, Surinder Kumar
> <surinder.ku...@enterprisedb.com> wrote:
> > Hi
> >
> > The attribute key for Ok, Save buttons should be mapped to 13(Enter),
> > for Help - 112(F1) and
> > for Cancel - 27(Esc)
> > The above changes are made into all dialog related template files.
> >
> > PFA patch and review.
>
> Looks good. Just a couple of thoughts:
>
> - You've missed the object property dialogues. This really needs to be
> consistent across all dialogues :-)
>
> - The behaviour with Enter is a bit odd, because priority will be
> given the the focussed control to handle it. That's what we want if
> it's a text area for example, but on the other hand, if you open the
> Preference dialogue, then the Help button gets focus first, so Enter
> there will end up opening the docs. I suspect in most cases the
> behaviour you've got is fine, so I'm not inclined to change it.  a little> Hmm, I see similar behaviour in some other apps. Let's leave
> it as you've done it :-)
>
> Please add support for the properties dialogues, then I think we're good
> to go.
>
​Done.​

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


Feature_1535_v1.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


[pgadmin-hackers] [pgAdmin4][Patch]: UI improvements in data-grid/query tool

2017-06-08 Thread Surinder Kumar
Hi,

*Changes:*

1) Display only border-top for data-grid header instead of border on whole
data-grid.

2) Remove dotted border from cell right for consistency.

3) Add border-bottom for header-row so that on scroll to bottom header rows
are differentiated from cells.

Also, due to these changes, the vertical scrollbar which appears at
data-grid right side seems to fixed.

PFA patch and review.


Thanks,
Surinder


data_grid_ui_changes.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


[pgadmin-hackers] [pgAdmin4][Patch][Feature_1535]: Pressing ESC from within a dialog box should act like "Cancel" button

2017-06-07 Thread Surinder Kumar
Hi

The attribute key for Ok, Save buttons should be mapped to 13(Enter),
for Help - 112(F1) and
for Cancel - 27(Esc)
The above changes are made into all dialog related template files.

PFA patch and review.

Thanks
Surinder


Feature_1535.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


[pgadmin-hackers] [pgAdmin4][Patch][Feature_1533]: Set focus on first field when new dialog window is presented

2017-06-07 Thread Surinder Kumar
Hi

PFA patch and review.

Thanks
Surinder


Feature_1533.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] Re: [pgAdmin4][Patch][Feature #1971]: Remember column sizes between executions of the same query in the query tool

2017-06-07 Thread Surinder Kumar
PFA patch after rebase

On Wed, Jun 7, 2017 at 6:26 PM, Surinder Kumar <
surinder.ku...@enterprisedb.com> wrote:

> Hi
>
> Please find rebased patch.
>
> On Wed, Jun 7, 2017 at 6:15 PM, Dave Page <dp...@pgadmin.org> wrote:
>
>> Hi,
>>
>> Could you rebase this please?
>>
>> Thanks.
>>
>> On Tue, Jun 6, 2017 at 9:22 AM, Surinder Kumar
>> <surinder.ku...@enterprisedb.com> wrote:
>> > Hi All,
>> >
>> > Please find updated patch which includes Jasmine test cases for
>> functions
>> > getHash and calculateColumnWidth
>> >
>> > Thanks,
>> > Surinder
>> >
>> > On Mon, Jun 5, 2017 at 11:38 PM, Shruti B Iyer <si...@pivotal.io>
>> wrote:
>> >>
>> >> Hi Surinder!
>> >>
>> >> We reviewed this patch. The changes look good and we especially like
>> that
>> >> you have extracted out the new utility functions and the
>> epicRandomString
>> >> function too.
>> >>
>> >> This patch will likely affect the Query Results patch that is currently
>> >> under review. In order to assist either us or yourself when making a
>> merge
>> >> between these patches, it would help to have jasmine unit testing for
>> the
>> >> two new functions, getHash and calculate_column_width.
>> >>
>> >> Also, we suggest that you rename calculate_column_width to
>> >> calculateColumnWidth for consistency with javascript code style.
>> >>
>> >> Thanks,
>> >> Shruti and Matt
>> >>
>> >> On Mon, Jun 5, 2017 at 9:16 AM Surinder Kumar
>> >> <surinder.ku...@enterprisedb.com> wrote:
>> >>>
>> >>> Staged changes are missed in previous patch, so please ignore.
>> >>> Please find attached updated patch.
>> >>>
>> >>> On Mon, Jun 5, 2017 at 4:29 PM, Surinder Kumar
>> >>> <surinder.ku...@enterprisedb.com> wrote:
>> >>>>
>> >>>> Hi
>> >>>>
>> >>>> This patch contains two fixes:
>> >>>>
>> >>>> 1) In Query/tool or Edit grid, the width of table column header is
>> fixed
>> >>>> depending on the column type(int, boolean, char etc.) due to which
>> the
>> >>>> column name or type appears cut from right and doesn't looks good
>> from user
>> >>>> point of view. The main concern was to display as much as the
>> content of
>> >>>> column should be displayed.
>> >>>>
>> >>>> Now the width of column is decided using the text length of column
>> name
>> >>>> or column type so that the column takes exact width it required and
>> it don't
>> >>>> appears cut.
>> >>>>
>> >>>> 2) Remember column size after re-running a query.
>> >>>>
>> >>>> The approach is to extract table name from the query executed and
>> use it
>> >>>> to store its columns width.
>> >>>> Whenever the column(s) width of a table is adjusted, the
>> corresponding
>> >>>> values are updated into the object and used every time the same
>> query is
>> >>>> executed.
>> >>>>
>> >>>> If a query is executed for e.g:
>> >>>>
>> >>>> SELECT generate_series(1, 1000) as id, generate_series(1, 1000) as
>> name,
>> >>>> generate_series(1, 1000) as age
>> >>>>
>> >>>> it
>> >>>> displays 3 columns
>> >>>> but don't have any table name. In that case,
>> >>>>  i use a hash generator function which returns unique hash for a
>> query
>> >>>> written in query editor and adjusted column(s) width are stored
>> against that
>> >>>> hash in object.
>> >>>>
>> >>>> Is there any way to get temporary table name(avoiding unique hash)
>> for
>> >>>> such queries ?
>> >>>>
>> >>>> Also, Moved utilities functions into pgadmin/static/utils.js
>> >>>>
>> >>>> Please find attached patch and review.
>> >>>>
>> >>>> Thanks,
>> >>>> Surinder Kumar
>> >>>
>> >>>
>> >>>
>> >>> --
>> >>> Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org
>> )
>> >>> To make changes to your subscription:
>> >>> http://www.postgresql.org/mailpref/pgadmin-hackers
>> >
>> >
>> >
>> >
>> > --
>> > Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
>> > To make changes to your subscription:
>> > http://www.postgresql.org/mailpref/pgadmin-hackers
>> >
>>
>>
>>
>> --
>> Dave Page
>> Blog: http://pgsnake.blogspot.com
>> Twitter: @pgsnake
>>
>> EnterpriseDB UK: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>>
>
>


Feature_1971_with_jasmine_tests_v2.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] [pgAdmin4][PATCH] Consolidating gray colors in the application

2017-06-07 Thread Surinder Kumar
Hi

With the latest pull, I found:
The header color of Properties panel disappears and background color of
footer area in Edit Properties panel is changed.

On Wed, Jun 7, 2017 at 6:28 PM, Dave Page  wrote:

> Thanks, applied. I removed the doc comments from the CSS for now as we
> don't have minimisation for that yet (and one of them seemed to be
> garbage).
>
> On Mon, Jun 5, 2017 at 4:52 PM, Shruti B Iyer  wrote:
> > Hi Hackers
> >
> > Attached are two patches for styling improvements.
> > 1-add-style-guide.patch contains the initial css from the style guide.
> As we
> > make further style changes, this file will be updated.
> > 2-change-grays.patch changes the gray color elements in the app to the
> ones
> > in the new style guide.
> >
> > Thanks,
> > Shruti and Matt
> >
> >
> > --
> > Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
> > To make changes to your subscription:
> > http://www.postgresql.org/mailpref/pgadmin-hackers
> >
>
>
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
>
> --
> Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgadmin-hackers
>


[pgadmin-hackers] [pgAdmin4][Patch][RM_ 2368]: Allow cell editing on single click in edit grid

2017-06-07 Thread Surinder Kumar
Hi

Please find attached patch and review.

Thanks,
Surinder


RM_2368.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


[pgadmin-hackers] [pgAdmin4][Patch][RM_2461]: Unable to drop defaut value from the column in table

2017-06-06 Thread Surinder Kumar
Hi

Add drop column syntax for dropping default value of a column if default
value is kept empty.

Please find attached patch and review.

Thanks,
Surinder


RM_2461.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] Re: [pgAdmin4][Patch][Feature #1971]: Remember column sizes between executions of the same query in the query tool

2017-06-06 Thread Surinder Kumar
Hi All,

Please find updated patch which includes Jasmine test cases for functions
getHash and calculateColumnWidth

Thanks,
Surinder

On Mon, Jun 5, 2017 at 11:38 PM, Shruti B Iyer <si...@pivotal.io> wrote:

> Hi Surinder!
>
> We reviewed this patch. The changes look good and we especially like that
> you have extracted out the new utility functions and the epicRandomString
> function too.
>
> This patch will likely affect the Query Results patch that is currently
> under review
> <https://www.postgresql.org/message-id/flat/CAAtBm9V-tNQrtjxt4n8JJek5M4v9KW_h3sgbL1ydcBB%2BtLus2w%40mail.gmail.com#caatbm9v-tnqrtjxt4n8jjek5m4v9kw_h3sgbl1ydcbb+tlu...@mail.gmail.com>.
> In order to assist either us or yourself when making a merge between these
> patches, it would help to have jasmine unit testing for the two new
> functions, getHash and calculate_column_width.
>
> Also, we suggest that you rename calculate_column_width to
> calculateColumnWidth for consistency with javascript code style.
>
> Thanks,
> Shruti and Matt
>
> On Mon, Jun 5, 2017 at 9:16 AM Surinder Kumar <
> surinder.ku...@enterprisedb.com> wrote:
>
>> Staged changes are missed in previous patch, so please ignore.
>> Please find attached updated patch.
>>
>> On Mon, Jun 5, 2017 at 4:29 PM, Surinder Kumar <
>> surinder.ku...@enterprisedb.com> wrote:
>>
>>> Hi
>>>
>>> This patch contains two fixes:
>>>
>>> 1) In Query/tool or Edit grid, the width of table column header is fixed
>>> depending on the column type(int, boolean, char etc.) due to which the
>>> column name or type appears cut from right and doesn't looks good from user
>>> point of view. The main concern was to display as much as the content of
>>> column should be displayed.
>>>
>>> Now the width of column is decided using the text length of column name
>>> or column type so that the column takes exact width it required and it
>>> don't appears cut.
>>>
>>> 2) Remember column size after re-running a query.
>>>
>>> The approach is to extract table name from the query executed and use it
>>> to store its columns width.
>>> Whenever the column(s) width of a table is adjusted, the corresponding
>>> values are updated into the object and used every time the same query is
>>> executed.
>>>
>>> If a query is executed for e.g:
>>>
>>> SELECT generate_series(1, 1000) as id, generate_series(1, 1000) as name,
>>> generate_series(1, 1000) as age
>>>
>>> ​it ​
>>> displays 3 columns
>>> ​but don't have any table name. In that case,
>>>  i use a hash generator function which returns unique hash for a query
>>> written in query editor and adjusted column(s) width are stored against
>>> that hash in object.
>>>
>>> Is there any way to get temporary table name(avoiding unique hash) for
>>> such queries ?​
>>>
>>> Also, Moved utilities functions into pgadmin/static/utils.js
>>>
>>> Please find attached patch and review.
>>>
>>> Thanks,
>>> Surinder Kumar
>>>
>>
>>
>> --
>> Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
>> To make changes to your subscription:
>> http://www.postgresql.org/mailpref/pgadmin-hackers
>>
>


Feature_1971_with_jasmine_tests.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


[pgadmin-hackers] Re: [pgAdmin4][Patch][Feature #1971]: Remember column sizes between executions of the same query in the query tool

2017-06-05 Thread Surinder Kumar
Staged changes are missed in previous patch, so please ignore.
Please find attached updated patch.

On Mon, Jun 5, 2017 at 4:29 PM, Surinder Kumar <
surinder.ku...@enterprisedb.com> wrote:

> Hi
>
> This patch contains two fixes:
>
> 1) In Query/tool or Edit grid, the width of table column header is fixed
> depending on the column type(int, boolean, char etc.) due to which the
> column name or type appears cut from right and doesn't looks good from user
> point of view. The main concern was to display as much as the content of
> column should be displayed.
>
> Now the width of column is decided using the text length of column name or
> column type so that the column takes exact width it required and it don't
> appears cut.
>
> 2) Remember column size after re-running a query.
>
> The approach is to extract table name from the query executed and use it
> to store its columns width.
> Whenever the column(s) width of a table is adjusted, the corresponding
> values are updated into the object and used every time the same query is
> executed.
>
> If a query is executed for e.g:
>
> SELECT generate_series(1, 1000) as id, generate_series(1, 1000) as name,
> generate_series(1, 1000) as age
>
> ​it ​
> displays 3 columns
> ​but don't have any table name. In that case,
>  i use a hash generator function which returns unique hash for a query
> written in query editor and adjusted column(s) width are stored against
> that hash in object.
>
> Is there any way to get temporary table name(avoiding unique hash) for
> such queries ?​
>
> Also, Moved utilities functions into pgadmin/static/utils.js
>
> Please find attached patch and review.
>
> Thanks,
> Surinder Kumar
>


Feature_1971.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


[pgadmin-hackers] [pgAdmin4][Patch][Feature #1971]: Remember column sizes between executions of the same query in the query tool

2017-06-05 Thread Surinder Kumar
Hi

This patch contains two fixes:

1) In Query/tool or Edit grid, the width of table column header is fixed
depending on the column type(int, boolean, char etc.) due to which the
column name or type appears cut from right and doesn't looks good from user
point of view. The main concern was to display as much as the content of
column should be displayed.

Now the width of column is decided using the text length of column name or
column type so that the column takes exact width it required and it don't
appears cut.

2) Remember column size after re-running a query.

The approach is to extract table name from the query executed and use it to
store its columns width.
Whenever the column(s) width of a table is adjusted, the corresponding
values are updated into the object and used every time the same query is
executed.

If a query is executed for e.g:

SELECT generate_series(1, 1000) as id, generate_series(1, 1000) as name,
generate_series(1, 1000) as age

​it ​
displays 3 columns
​but don't have any table name. In that case,
 i use a hash generator function which returns unique hash for a query
written in query editor and adjusted column(s) width are stored against
that hash in object.

Is there any way to get temporary table name(avoiding unique hash) for such
queries ?​

Also, Moved utilities functions into pgadmin/static/utils.js

Please find attached patch and review.

Thanks,
Surinder Kumar


Feature_1971.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] [pgAdmin4][Patch]: Load module's JS files only when required

2017-06-05 Thread Surinder Kumar
Hi Dave,

Please find attached patch for minifying CSS files and optimize images
using Webpack.

*Steps to run:*

1) After applying patch, go to web directory and run npm install on
terminal to install packages which are used to parse/minify CSS files.

2) Run npm run build which creates dist folder inside web/pgadmin/static/
directory to store processed images, fonts and css files.

3. Set DEBUG = False in config_local.py and then run python pgAdmin.py to
start server.
I kept generated main.css and overrides.css conditional in base.html to
load them only when debug mode is False


After running "npm run build", following files/directories are generated:

1) main.css -  about 20 vendor CSS files are packed into this file and more
importantly the paths to images are preserved.

2) overrides.css - it contains bootstrap.overrides.css and pgadmin.css,
they has to be packed separately and loaded after all CSS files are loaded
because the purpose of these files is to override the vendor or modules css.

3) img - it contains the images used in CSS files. The name of image files
can also be hashed names for caching purpose which we can use.

4) fonts - it contains the fonts used in fontawesome.css and other css
files.

This is a simple patch to demonstrate how CSS files will be minified with
Webpack.

For now it minifies only vendor CSS files, I will add modules static files
in the list later on.

Any thoughts on minifying template CSS files which are built dynamically
and loaded with dependency on other modules?

Also, I looked into Flask-webpack which generates bundled assets using
Webpack(webpack.config.js) and provide additionally global template tags to
use in Jinja templates.

But it might not work with latest version of Webpack as this repo is not
updated since last 2 years. I need to check with latest version and I will
update on this.


Thanks
Surinder


On Mon, May 29, 2017 at 5:45 AM, Dave Page <dp...@pgadmin.org> wrote:

> On Fri, May 26, 2017 at 12:01 AM, Surinder Kumar
> <surinder.ku...@enterprisedb.com> wrote:
> > On Fri, May 26, 2017 at 3:02 AM, Dave Page <dp...@pgadmin.org> wrote:
> >>
> >> On Tue, May 23, 2017 at 4:21 PM, Dave Page <dp...@pgadmin.org> wrote:
> >> >
> >> > I'm actually thinking that maybe it would be easier to start with the
> >> > CSS files
> >>
> >> Which i did yesterday. However, it soon became obvious that that isn't
> >> so easy either, as the CSS files contain url references which need to
> >> be adjusted, which isn't trivial.
> >>
> >> However, I did find a flask-webpack module, which looks interesting:
> >>
> >> https://github.com/nickjj/flask-webpack
> >> https://nickjanetakis.com/blog/manage-your-assets-with-flask-webpack
> >>
> >> Surinder; when you have some free time, could you look into a simple
> >> PoC with the CSS files using that please?
> >
> > Ok. I will look
>
> BTW; if it looks like it will take a while to implement (as I
> suspect), we should consider polishing off your initial patch as an
> interim step. Any thoughts on how long RM2424 would take to resolve?
>
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>


bundle_css_using_webpack.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] [pgAdmin4] [PATCH] History Tab rewrite in React

2017-06-04 Thread Surinder Kumar
Hi

Review comments:

1) First patch contains changes related to copy row feature which is
already in process in another thread. Any reason to add those changes in
this patch as this patch is meant to contain infrastructure changes ?

2) Can the changes related to FeatureTest or Jasmine test be separated out
in another patch?


Thanks,
Surinder


On Thu, Jun 1, 2017 at 1:59 AM, Matthew Kleiman <mklei...@pivotal.io> wrote:

> Hey Surinder,
>
> Is it possible to run the task listed above by configuring them in
>> "scripts" in package.json file and running concurrently ?
>
>
> That would be cleaner than what we proposed. We could use the yarn run
> <https://yarnpkg.com/lang/en/docs/cli/run/> feature to do just what you
> are suggesting. It works the same as in npm.
> Something like the following:
> In package.json -
> "scripts": {
>   "linter": "eslint pgadmin/static/jsx/**/*.jsx
> pgadmin/static/js/selection/*.js regression/javascript/**/*.jsx
> regression/javascript/**/*.js *.js"
> }
>
> To call it on the command line -
> yarn run linter
>
> - Matt
>
> On Wed, May 31, 2017 at 12:35 AM, Surinder Kumar <
> surinder.ku...@enterprisedb.com> wrote:
>
>> On Wed, May 31, 2017 at 12:01 AM, Joao Pedro De Almeida Pereira <
>> jdealmeidapere...@pivotal.io> wrote:
>>
>>> The motivation is simple - we want a solution that works for the whole
>>>> app, can handle debug vs. release execution, pluggable modules, and
>>>> installations in read-only directories.
>>>
>>> With the current configuration of Grunt, all the requirements you
>>> mention are available.
>>> The tasks on Grunt should only be run under development or before we are
>>> creating the installer.
>>>
>>
>>
>>> The installer should pick up only the bundled Javascript and should
>>> install it in the correct folders, this way there is no need to rewrite or
>>> process files in read-only directories of the end user machine.
>>>
>>> Per the other thread on the subject (that Joao suggested continuing
>>>> discussion on), Surinder is currently looking into flask-webpack. I
>>>> spent some time playing with grunt and some other options last week.
>>>
>>> We should continue the discussion about flask-webpack or Grunt or any
>>> other Build system in the other thread, but we need to have some decision
>>> because this patch needs a build system.
>>> If we remove Grunt from this patch we will need to execute the following
>>> command every time the application run:
>>>
>>> yarn run eslint pgadmin/static/jsx/**/*.jsx
>>> pgadmin/static/js/selection/*.js regression/javascript/**/*.jsx
>>> regression/javascript/**/*.js *.js && yarn run webpack -- --config
>>> webpack.config.js && python web/pgAdmin4
>>>
>>> And to run the jasmine tests:
>>>
>>> yarn run eslint pgadmin/static/jsx/**/*.jsx
>>> pgadmin/static/js/selection/*.js regression/javascript/**/*.jsx
>>> regression/javascript/**/*.js *.js && yarn run karma start
>>>
>>> And to run the feature tests:
>>>
>>> yarn run eslint pgadmin/static/jsx/**/*.jsx
>>> pgadmin/static/js/selection/*.js regression/javascript/**/*.jsx
>>> regression/javascript/**/*.js *.js && yarn run webpack -- --config 
>>> webpack.config.js
>>> && python runtests.py
>>>
>>> Is this a solution that is acceptable?
>>>
>>
>> As per my knowledge, Grunt can run the tasks and bundle the JS and CSS
>> files (using r.js which is not preferred). But Webpack can not do both. It
>> can only bundle files, it has to be used with either Grunt or Gulp to
>> execute tasks.
>>
>> Is it possible to run the task listed above by configuring them in
>> "scripts" in package.json file and running concurrently ?
>>
>> scripts: {
>>  "task-name1": "yarn run eslint filename",
>> ​ ​
>> "task-name2": "yarn run karma start", so on...
>> }
>>
>> and run them using following command:
>> npm run task-name1
>>
>>
>>>
>>> However; this patch is supposed to be about the history tab rewrite.
>>>> Whatever solution we use for webpacking/transpiling/linting/minifying
>>>> etc, it should be a standalone change as it's decidedly non-trivial.
>>>
>>> We split this patch into 2 different commits:
>>> 1 - Add React and all the tools needed to

Re: [pgadmin-hackers] [pgAdmin4][Patch][RM_2400]: Columns with defaults set to NULL when removing contents after pasting in the edit grid

2017-06-02 Thread Surinder Kumar
Hi Dave,

Please find updated patch with following changes:

1) Locate grid row by div's style attribute 'top'(i.e. 'top:0px' for first
row), instead of by div class-name because the order of rendered rows is
not always same.

2) Increase the wait timeout of WebDriverWait to 5 seconds in
'_compare_cell_value(...)' method.

3) Add a new utils method 'find_by_css_selector' in pgadmin_page.py to
locate css element with wait_for method.

4) Add a new utils method 'wait_for_element_to_stale' in pgadmin_page.py.
It is useful when "StaleElementReferenceException" exception is raised and
element is not attached to the page while finding element by xpath.

5) Instead of finding each cell value by xpath and compare with actual
value, now a row is located using xpath and all of cell values are
extracted into an array and then compared with actual values. It eliminates
the use of wait_timeout.

Also, I added a print statement for debugging where a TimeoutException was
occurred last time.


On Sun, May 28, 2017 at 1:58 AM, Dave Page <dp...@pgadmin.org> wrote:

> Here's the screenshot.
>
> On Sat, May 27, 2017 at 4:26 PM, Dave Page <dp...@pgadmin.org> wrote:
> > Hi
> >
> > On Sat, May 27, 2017 at 4:03 PM, Surinder Kumar
> > <surinder.ku...@enterprisedb.com> wrote:
> >> Hi Dave
> >>
> >> Please find update Feature test cases patch.
> >>
> >> On Sun, May 28, 2017 at 12:40 AM, Dave Page <dp...@pgadmin.org> wrote:
> >>>
> >>> Thanks - I committed the code changes, as they seem to work very well.
> >>> The regression tests are failing for me though :-(. Can you take
> >>> another look please? Note that I'm running under Python 2.7 on Mal
> >>
> >> Actually i used the generic close_query_tool method to close view data
> panel
> >> which popup with unsaved changes. but in my case nothing popups as
> there as
> >> no unsaved changes, so clicking on [x] button close the panel. So I
> write
> >> close_data_grid method in pgadmin_page.py file.
> >
> > It passed with PG 9.4, but then failed (twice) under 9.6:
> >
> > ==
> > ERROR: runTest (pgadmin.feature_tests.view_data_dml_queries.
> CheckForViewDataTest)
> > Validate Insert, Update operations in View data with given test data
> > --
> > Traceback (most recent call last):
> >   File "/Users/dpage/git/pgadmin4/web/pgadmin/feature_tests/
> view_data_dml_queries.py",
> > line 105, in runTest
> > self._copy_paste_row()
> >   File "/Users/dpage/git/pgadmin4/web/pgadmin/feature_tests/
> view_data_dml_queries.py",
> > line 250, in _copy_paste_row
> > self._verify_row_data(False)
> >   File "/Users/dpage/git/pgadmin4/web/pgadmin/feature_tests/
> view_data_dml_queries.py",
> > line 275, in _verify_row_data
> > self._compare_cell_value(cell_xpath, config_data[str(idx)][1])
> >   File "/Users/dpage/git/pgadmin4/web/pgadmin/feature_tests/
> view_data_dml_queries.py",
> > line 142, in _compare_cell_value
> > CheckForViewDataTest.TIMEOUT_STRING
> >   File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-
> packages/selenium/webdriver/support/wait.py",
> > line 80, in until
> > raise TimeoutException(message, screen, stacktrace)
> > TimeoutException: Message: Timed out waiting for div element to appear
> >
> >
> > --
> >
> >
> > --
> > 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
>


Feature_test_cases_view_data_v5.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] [pgAdmin4][PATCH] Improvements to Query Results Grid User Experience

2017-06-01 Thread Surinder Kumar
Hi Robert,

On Jun 1, 2017 8:22 PM, "Robert Eckhardt" <reckha...@pivotal.io> wrote:
>
> Surindar,
>
> Have you sent this patch and I'm missing it or is it still in flight for
you?
I have found the solution, will test that patch and hopefully by tomorrow I
will send.
>
> -- Rob
>
> On Wed, May 31, 2017 at 1:02 AM, Surinder Kumar <
surinder.ku...@enterprisedb.com> wrote:
>>
>> Hi Joao
>>
>> On Wed, May 31, 2017 at 1:19 AM, Joao Pedro De Almeida Pereira <
jdealmeidapere...@pivotal.io> wrote:
>>>
>>> Hello
>>>
>>> We have rebased the patches against master again, which includes
Surinder's fix for RM2400. These patches should now apply against the HEAD
of master.
>>>>
>>>>
>>>> Given these issues, I think it would be sensible to add a feature test
>>>> to copy/paste a couple of existing rows in a table, blank out the pkey
>>>> values, save then refresh, and check everything looks right. Thoughts?
>>>
>>> Currently, the feature test, CopySelectedQueryResultsFeatureTest, only
covers copy functionality in the query tool. It sounds like we could use
some additional coverage around the Edit Table tool, which could include
paste rows functionality. Can we get this patch merged and create a RedMine
issue that enumerates the additional functionality we want to cover via
feature test?
>>
>> ​FeatureTest for edit Table tool and copy/paste rows are already
written, but there is some flakiness when executing. I will be sending that
patch again with fix.​
>>>
>>>
>>> Thanks,
>>> Joao & Matt
>>>
>>>
>>> On Sat, May 27, 2017 at 2:19 PM, Dave Page <dp...@pgadmin.org> wrote:
>>>>
>>>> On Sat, May 27, 2017 at 9:02 AM, Surinder Kumar
>>>> <surinder.ku...@enterprisedb.com> wrote:
>>>> > Hi Dave,
>>>> > On Sat, May 27, 2017 at 3:07 AM, Dave Page <dp...@pgadmin.org> wrote:
>>>> >>
>>>> >> Hi
>>>> >>
>>>> >> OK, so we're getting somewhere now :-). Here's what I found:
>>>> >>
>>>> >> - The grid looks and feels great now. Selection works nicely, and
>>>> >> copying rows seems to work well.
>>>> >>
>>>> >> - Patch 5 doesn't apply - but only to slick.grid.js. I manually
fixed
>>>> >> it for testing, but the patch really doesn't look like it was
created
>>>> >> from the version of the file from GIT HEAD with patches 1 - 4
applied.
>>>> >>
>>>> >> - There is a problem. I noticed that a) when copy/pasting rows, if I
>>>> >> blank out a key column with a default it gets set to [null] instead
of
>>>> >> [default] and b) inserting rows seems to get the values of the new
>>>> >> row(s) from the wrong place, resulting in duplicate key violations.
>>>> >
>>>> > This belongs to RM2400 - handle [default] and [null] while
copy/pasting
>>>> > rows. An updated patch and Feature tests are already sent.
>>>> > You can review and commit if looks good.
>>>>
>>>> That part, yes - but not mixing up the values.
>>>>
>>>>
>>>> >> Now, both of these issues sound very much like ones Surinder fixed
>>>> >> recently following other improvements to the grid to more properly
>>>> >> handle nulls and default values. I *think* these fixes were in
commit:
>>>> >> d7d4bf475bc5b131d9a76376ebfc87e004d92333. Perhaps there's been a
>>>> >> merging error in your development branch at some point?
>>>> >>
>>>> >> Given these issues, I think it would be sensible to add a feature
test
>>>> >> to copy/paste a couple of existing rows in a table, blank out the
pkey
>>>> >> values, save then refresh, and check everything looks right.
Thoughts?
>>>> >>
>>>> >> I'm looking forward to seeing this fully baked :-)
>>>> >>
>>>> >> Thanks!
>>>> >>
>>>> >> On Fri, May 26, 2017 at 11:23 AM, Joao Pedro De Almeida Pereira
>>>> >> <jdealmeidapere...@pivotal.io> wrote:
>>>> >> > Hello Dave,
>>>> >> >
>>>> >> > We created the previous patches using the command recommended in
the
>>>> >> > pgAdmin
>>>> >> > website, but apparently the diff doesn't work correctly w

Re: [pgadmin-hackers] [pgadmin-support] pgAdmin4 and boolean columns

2017-05-31 Thread Surinder Kumar
Adding pgadmin-hackers

On Wed, May 31, 2017 at 2:43 PM, Nigel Tucker <nigel@specialisedstructures.c
o.nz> wrote:

> Hi Surindar – nice to talk!
>
>
>
> Yep – I’m running 1.5 at present – the issue RM2218 sounds similar but
> isn’t actually the same – my issue was related to the number of times you
> have to select the Boolean cell to make it change. For instance if you
> select it three times rather than four it reverts to null.
>
>
>
> I just assume the intended action is that it starts as a default (maybe
> null); a single mouse click changes it to false, and a further mouse click
> change it to true, and then repeated mouse clicks toggle round the  three
> options – if of course null is a possible default for that cell.
>
>
>
> If the cell is NOT NULL by definition, the default should be false and it
> will just toggle between true and false.
>
>
>
> Cheers
>
>
>
> Nigel
>
>
>
>
>
>
>
> *Dr Nigel Tucker*
>
> System Architect
>
> Specialised Structures NZ
>
> Telephone Direct (NZ) +64 (0) 3 482 2473
>
>
>
>     [image: SS with Custom]
>
>
>
> *From:* pgadmin-support-ow...@postgresql.org [mailto:
> pgadmin-support-ow...@postgresql.org] *On Behalf Of *Surinder Kumar
> *Sent:* Wednesday, 31 May 2017 6:13 PM
> *To:* Nigel Tucker
> *Cc:* pgAdmin Support
> *Subject:* Re: [pgadmin-support] pgAdmin4 and boolean columns
>
>
>
> Hi Nigel,
>
>
>
> ​Already a similar issue RM2218
> <https://redmine.postgresql.org/issues/2218> logged which is resolved.
>
>
>
> Also, which version of pgAdmin4 you are using ?
>
>
>
> On Wed, May 31, 2017 at 3:00 AM, Nigel Tucker <
> ni...@specialisedstructures.co.nz> wrote:
>
> Hi,
>
>
>
> pgAdmin4 has difficulty with setting or changing Boolean check boxes in
> Windows 10.
>
>
>
> Double clicking on a Boolean cell initially null converts the display to
> an empty box, which on leaving that cell displays ‘false’.
>
> If you return to the box and click once on it, it switches to a ticked box
> – which on leaving the cell shows ‘null’.
>
> If however you double click on the cell, it converts to a ticked box which
> on leaving the cell shows true.
>
>
>
> So – the mechanism for converting a Boolean cell from true to false
> requires five button presses, and from false to true requires four button
> presses. This has to be excessive and makes direct editing any number of
> rows a real pain.
>
>
>
> Cheers
>
>
>
> Nigel
>
>
>
> *Dr Nigel Tucker*
>
> System Architect
>
> Specialised Structures NZ
>
> Telephone Direct (NZ) +64 (0) 3 482 2473
>
>
>
> [image: SS with Custom]
>
>
>
>
>


Re: [pgadmin-hackers] [pgAdmin4] [PATCH] History Tab rewrite in React

2017-05-30 Thread Surinder Kumar
On Wed, May 31, 2017 at 12:01 AM, Joao Pedro De Almeida Pereira <
jdealmeidapere...@pivotal.io> wrote:

> The motivation is simple - we want a solution that works for the whole
>> app, can handle debug vs. release execution, pluggable modules, and
>> installations in read-only directories.
>
> With the current configuration of Grunt, all the requirements you mention
> are available.
> The tasks on Grunt should only be run under development or before we are
> creating the installer.
>


> The installer should pick up only the bundled Javascript and should
> install it in the correct folders, this way there is no need to rewrite or
> process files in read-only directories of the end user machine.
>
> Per the other thread on the subject (that Joao suggested continuing
>> discussion on), Surinder is currently looking into flask-webpack. I
>> spent some time playing with grunt and some other options last week.
>
> We should continue the discussion about flask-webpack or Grunt or any
> other Build system in the other thread, but we need to have some decision
> because this patch needs a build system.
> If we remove Grunt from this patch we will need to execute the following
> command every time the application run:
>
> yarn run eslint pgadmin/static/jsx/**/*.jsx pgadmin/static/js/selection/*.js
> regression/javascript/**/*.jsx regression/javascript/**/*.js *.js && yarn
> run webpack -- --config webpack.config.js && python web/pgAdmin4
>
> And to run the jasmine tests:
>
> yarn run eslint pgadmin/static/jsx/**/*.jsx pgadmin/static/js/selection/*.js
> regression/javascript/**/*.jsx regression/javascript/**/*.js *.js && yarn
> run karma start
>
> And to run the feature tests:
>
> yarn run eslint pgadmin/static/jsx/**/*.jsx pgadmin/static/js/selection/*.js
> regression/javascript/**/*.jsx regression/javascript/**/*.js *.js && yarn
> run webpack -- --config webpack.config.js && python runtests.py
>
> Is this a solution that is acceptable?
>

As per my knowledge, Grunt can run the tasks and bundle the JS and CSS
files (using r.js which is not preferred). But Webpack can not do both. It
can only bundle files, it has to be used with either Grunt or Gulp to
execute tasks.

Is it possible to run the task listed above by configuring them in
"scripts" in package.json file and running concurrently ?

scripts: {
 "task-name1": "yarn run eslint filename",
​ ​
"task-name2": "yarn run karma start", so on...
}

and run them using following command:
npm run task-name1


>
> However; this patch is supposed to be about the history tab rewrite.
>> Whatever solution we use for webpacking/transpiling/linting/minifying
>> etc, it should be a standalone change as it's decidedly non-trivial.
>
> We split this patch into 2 different commits:
> 1 - Add React and all the tools needed to work with it, this includes
> Grunt, Webpack and ESLint
> 2 - Change the history tab
>
> Do you want a single commit for each of the following?
>   React (just adds the React library via yarn)
>   Webpack (adds Webpack library via yarn and creates the webpack.config.js)
>   ESLint (adds ESLint library via yarn, creates .eslintrc config file, and
> corrects all lint errors that previously existed)
>   Grunt (adds Grunt library via yarn and creates Gruntfile.js config,
> creating a pipeline of the previous three libraries/tasks)
>   Our change to History
>
> Thanks
> Joao & Matt
>
> On Tue, May 30, 2017 at 10:10 AM, Dave Page  wrote:
>
>> Hi
>>
>> On Tue, May 30, 2017 at 2:47 PM, Matthew Kleiman 
>> wrote:
>> > Hi Dave,
>> >
>> > We are currently using the Grunt taskrunner to run the following tasks:
>> >
>> > lint the javascript code
>> > start javascript tests
>> > invoke webpack to transpile and bundle js and jsx files
>> > minify javascript
>> >
>> > In order to remove Grunt from the application, we will need some other
>> tool
>> > to execute these listed tasks.
>> >
>> > There are other tools available, like Gulp.js, that we could use
>> instead of
>> > Grunt. We would like to understand your motivation for removing Grunt
>> so we
>> > can find a better solution.
>>
>> The motivation is simple - we want a solution that works for the whole
>> app, can handle debug vs. release execution, pluggable modules, and
>> installations in read-only directories.
>>
>> Per the other thread on the subject (that Joao suggested continuing
>> discussion on), Surinder is currently looking into flask-webpack. I
>> spent some time playing with grunt and some other options last week.
>>
>> However; this patch is supposed to be about the history tab rewrite.
>> Whatever solution we use for webpacking/transpiling/linting/minifying
>> etc, it should be a standalone change as it's decidedly non-trivial.
>>
>> --
>> Dave Page
>> Blog: http://pgsnake.blogspot.com
>> Twitter: @pgsnake
>>
>> EnterpriseDB UK: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>>
>
>


[pgadmin-hackers] [pgAdmin4][RM_2424]: Menu Items don't appear in tools menu for modules that are loaded using deps

2017-05-29 Thread Surinder Kumar
Hi

*Issue:*

If modules are loaded without any node dependency(i.e: on page load), the
function 'create_menu' is called implicitly to generate menu items.

But when the modules are loaded when its dependent node expands, the
function 'create_menus' has to explicitly call after 'add_menus' from
respective module's template files.

This patch is dependent on patch 'load_modules_js_when_required.patch'

Please find attached patch and review.


RM_2424.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] pgAdmin 4 commit: Cleanup handling of default/null values when data edi

2017-05-29 Thread Surinder Kumar
Hi Dave,

The grid was being re-rendered after add new row and copy/paste to add a
blank row in the end of grid, but in case of copy/paste batch operation it
should run once, so that code is moved out of addNewRow(...) and put into a
function grid.addBlankRow() and called separately for copy/paste after
batch operation is completed.

Now copy/paste with 10k records took 2 seconds.

Please find attached patch.


On Mon, May 29, 2017 at 5:19 AM, Dave Page  wrote:

> On Sun, May 28, 2017 at 1:25 PM, Harshal Dhumal
>  wrote:
> > Hi,
> >
> > This commit has some performance issues with row paste functionality.
> > For 2K copied rows with 3 columns (2 integer and one null column) it took
> > near about 10 seconds to complete paste operation. And entire application
> > becomes unresponsive for those 10 seconds.
> >
> > This is mainly because for each single pasted row entire grid is
> re-rendered
> > ( is what I see in code).
> > Ideally grid should be re-rendered only once after all rows are provided
> to
> > grid.
> >
> > below code snippet from _paste_rows function
> >
> > _.each(copied_rows, function(row) {
> > var new_row = arr_to_object(row);
> > new_row.is_row_copied = true;
> > row = new_row;
> > self.temp_new_rows.push(count);
> > grid.onAddNewRow.notify(
> >   {item: new_row, column: self.columns[0] , grid:grid}
> > )
> > grid.setSelectedRows([]);
> > count++;
> > });
> >
> > The statement
> >
> > grid.onAddNewRow.notify(
> >   {item: new_row, column: self.columns[0] , grid:grid}
> > )
> >
> > causes grid to re-render (as we listener on onAddNewRow event where we
> > re-render the grid)
>
> Copying that number of rows is an extreme case of course, but still...
> Is there an alternative way to batch notify?
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>


render_grid_after_batch_copy_paste_rows.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] [pgAdmin4][Patch][RM_2400]: Columns with defaults set to NULL when removing contents after pasting in the edit grid

2017-05-27 Thread Surinder Kumar
Hi Dave

Please find update Feature test cases patch.

On Sun, May 28, 2017 at 12:40 AM, Dave Page <dp...@pgadmin.org> wrote:

> Thanks - I committed the code changes, as they seem to work very well.
> The regression tests are failing for me though :-(. Can you take
> another look please? Note that I'm running under Python 2.7 on Mal
>
​Actually i used the generic close_query_tool method to close view data
panel which popup with unsaved changes. but in my case nothing popups as
there as no unsaved changes, so clicking on [x] button close the panel. So
I write close_data_grid method in pgadmin_page.py file.

>
> ==
> ERROR: runTest (pgadmin.feature_tests.view_da
> ta_dml_queries.CheckForViewDataTest)
> Validate Insert, Update operations in View data with given test data
> --
> Traceback (most recent call last):
>   File "/Users/dpage/git/pgadmin4/web/pgadmin/feature_tests/view_da
> ta_dml_queries.py",
> line 106, in runTest
> self.page.close_query_tool()
>   File "/Users/dpage/git/pgadmin4/web/regression/feature_utils/pgad
> min_page.py",
> line 68, in close_query_tool
> self.driver.switch_to.frame(self.driver.find_elements_by_tag
> _name("iframe")[0])
> IndexError: list index out of range
>
> On Sat, May 27, 2017 at 9:11 AM, Surinder Kumar
> <surinder.ku...@enterprisedb.com> wrote:
> > Hi Dave
> >
> > Please find updated Feature test case and review.
> >
> > This patch is dependent on RM_2400v2.patch
> >
> > On Fri, May 26, 2017 at 8:45 PM, Surinder Kumar
> > <surinder.ku...@enterprisedb.com> wrote:
> >>
> >> Hi Joao,
> >>
> >> On May 26, 2017 8:33 PM, "Joao Pedro De Almeida Pereira"
> >> <jdealmeidapere...@pivotal.io> wrote:
> >> >
> >> > Hi Surinder,
> >> > You are right, nevertheless that was not the only error we had on the
> >> > flaky tests.
> >> Okay, please send stack trace where test case fails..
> >>
> >> Thanks
> >> Surinder
> >>
> >>
> >> >
> >> > Thanks
> >> > Joao & Shruti
> >> >
> >> > On Fri, May 26, 2017 at 10:18 AM, Surinder Kumar
> >> > <surinder.ku...@enterprisedb.com> wrote:
> >> >>
> >> >> Hi Joao,
> >> >>
> >> >> Please apply patch RM_2400v2.patch first then apply Feature test
> cases
> >> >> patch.
> >> >>
> >> >>
> >> >> On May 26, 2017 7:42 PM, "Joao Pedro De Almeida Pereira"
> >> >> <jdealmeidapere...@pivotal.io> wrote:
> >> >>>
> >> >>> Hello Surinder,
> >> >>>
> >> >>> Thanks for updating the patch. After looking into the updated
> version,
> >> >>> we found the following issues.
> >> >>>
> >> >>>
> >> >>> The tests looked flaky. We ran the tests three times and each time
> we
> >> >>> had timeout issues.
> >> >>> It failed twice in the location mentioned below. It also failed
> >> >>> because the row1 cell2 values was [null] instead of the expected
> [default].
> >> >>>
> >> >>> Traceback (most recent call last): File
> >> >>> "/Users/pivotal/workspace/pgadmin4/web/pgadmin/feature_tests
> /view_data_dml_queries.py",
> >> >>> line 105, in runTest self._copy_paste_row() File
> >> >>> "/Users/pivotal/workspace/pgadmin4/web/pgadmin/feature_tests
> /view_data_dml_queries.py",
> >> >>> line 248, in _copy_paste_row self._compare_cell_value(row1_
> cell2_xpath,
> >> >>> "[default]") File
> >> >>> "/Users/pivotal/workspace/pgadmin4/web/pgadmin/feature_tests
> /view_data_dml_queries.py",
> >> >>> line 147, in _compare_cell_value CheckForViewDataTest.TIMEOUT_STRING
> File
> >> >>> "/Users/pivotal/.pyenv/versions/pgadmin/lib/python2.7/site-p
> ackages/selenium/webdriver/support/wait.py",
> >> >>> line 80, in until raise TimeoutException(message, screen,
> stacktrace)
> >> >>> TimeoutException: Message: Timed out waiting for div element to
> appear
> >> >>>
> >> >>>
> >> >>>
> >> >>> We also noticed that the function _wait is no 

Re: [pgadmin-hackers] [pgAdmin4][Patch][RM_2400]: Columns with defaults set to NULL when removing contents after pasting in the edit grid

2017-05-27 Thread Surinder Kumar
Hi Dave

Please find updated Feature test case and review.

This patch is dependent on RM_2400v2.patch

On Fri, May 26, 2017 at 8:45 PM, Surinder Kumar <
surinder.ku...@enterprisedb.com> wrote:

> Hi Joao,
>
> On May 26, 2017 8:33 PM, "Joao Pedro De Almeida Pereira" <
> jdealmeidapere...@pivotal.io> wrote:
> >
> > Hi Surinder,
> > You are right, nevertheless that was not the only error we had on the
> flaky tests.
> Okay, please send stack trace where test case fails..
>
> Thanks
> Surinder
>
> >
> > Thanks
> > Joao & Shruti
> >
> > On Fri, May 26, 2017 at 10:18 AM, Surinder Kumar <
> surinder.ku...@enterprisedb.com> wrote:
> >>
> >> Hi Joao,
> >>
> >> Please apply patch RM_2400v2.patch first then apply Feature test cases
> patch.
> >>
> >>
> >> On May 26, 2017 7:42 PM, "Joao Pedro De Almeida Pereira" <
> jdealmeidapere...@pivotal.io> wrote:
> >>>
> >>> Hello Surinder,
> >>>
> >>> Thanks for updating the patch. After looking into the updated version,
> we found the following issues.
> >>>
> >>>
> >>> The tests looked flaky. We ran the tests three times and each time we
> had timeout issues.
> >>> It failed twice in the location mentioned below. It also failed
> because the row1 cell2 values was [null] instead of the expected [default].
> >>>
> >>> Traceback (most recent call last): File "/Users/pivotal/workspace/
> pgadmin4/web/pgadmin/feature_tests/view_data_dml_queries.py", line 105,
> in runTest self._copy_paste_row() File "/Users/pivotal/workspace/
> pgadmin4/web/pgadmin/feature_tests/view_data_dml_queries.py", line 248,
> in _copy_paste_row self._compare_cell_value(row1_cell2_xpath,
> "[default]") File "/Users/pivotal/workspace/pgadmin4/web/pgadmin/feature_
> tests/view_data_dml_queries.py", line 147, in _compare_cell_value
> CheckForViewDataTest.TIMEOUT_STRING File "/Users/pivotal/.pyenv/
> versions/pgadmin/lib/python2.7/site-packages/selenium/webdriver/support/wait.py",
> line 80, in until raise TimeoutException(message, screen, stacktrace)
> TimeoutException: Message: Timed out waiting for div element to appear
> >>>
> >>> ​
> >>>
> >>> We also noticed that the function _wait is no longer used. Maybe we
> can remove it.
>
​Removed.​

> >>>
> >>> Thanks
> >>> Joao & Shruti
> >>>
> >>> On Fri, May 26, 2017 at 9:07 AM, Surinder Kumar <
> surinder.ku...@enterprisedb.com> wrote:
> >>>>
> >>>> Hi
> >>>>
> >>>> Please find updated patch.
> >>>>
> >>>> On Fri, May 26, 2017 at 3:15 AM, Joao Pedro De Almeida Pereira <
> jdealmeidapere...@pivotal.io> wrote:
> >>>>>
> >>>>> Hello Surinder,
> >>>>>
> >>>>> We are having issues running the tests, this is the error that we
> are getting:
> >>>>>
> >>>>>  File "/Users/pivotal/workspace/pgadmin4/web/regression/
> python_test_utils/test_utils.py", line 196, in create_table_with_query
> pg_cursor.execute(query) ProgrammingError: role "postgres" does not exist
> Traceback (most recent call last): File "/Users/pivotal/workspace/
> pgadmin4/web/regression/python_test_utils/test_utils.py", line 196, in
> create_table_with_query pg_cursor.execute(query) ProgrammingError: relation
> "defaults_id_seq" does not exist
> >>>>>
> >>>>> ​
> >>>>> ​Fixed.​
> >>>>>
> >>>>> There is already a function that waits for an element to be
> displayed on the screen. The function is: self.page.find_by_xpath
> >>>>>
> >>>>> In line 179 and 180, both functions do the same thing, why do we
> need to wait first and then wait again. Were you experiencing flakiness?
> >>>>
> >>>> I have to use another instance of webDriverWait because I was getting
> TimeoutException. I guess timeout of 10 seconds wasn't enough to search the
> element in DOM.
> >>>>>
> >>>>>
> >>>>> Does _check_xss_in_view_data method checks for Cross Site Scripting?
> >>>>
> >>>> ​I forgot to change the method name.​
> >>>>>
> >>>>>
> >>>>> Was there any reason to duplicate self.page._connects_to_server and
> self.page._close_query_

Re: [pgadmin-hackers] [pgAdmin4][Patch][RM_2400]: Columns with defaults set to NULL when removing contents after pasting in the edit grid

2017-05-26 Thread Surinder Kumar
Hi Joao,

On May 26, 2017 8:33 PM, "Joao Pedro De Almeida Pereira" <
jdealmeidapere...@pivotal.io> wrote:
>
> Hi Surinder,
> You are right, nevertheless that was not the only error we had on the
flaky tests.
Okay, please send stack trace where test case fails..

Thanks
Surinder
>
> Thanks
> Joao & Shruti
>
> On Fri, May 26, 2017 at 10:18 AM, Surinder Kumar <
surinder.ku...@enterprisedb.com> wrote:
>>
>> Hi Joao,
>>
>> Please apply patch RM_2400v2.patch first then apply Feature test cases
patch.
>>
>>
>> On May 26, 2017 7:42 PM, "Joao Pedro De Almeida Pereira" <
jdealmeidapere...@pivotal.io> wrote:
>>>
>>> Hello Surinder,
>>>
>>> Thanks for updating the patch. After looking into the updated version,
we found the following issues.
>>>
>>>
>>> The tests looked flaky. We ran the tests three times and each time we
had timeout issues.
>>> It failed twice in the location mentioned below. It also failed because
the row1 cell2 values was [null] instead of the expected [default].
>>>
>>> Traceback (most recent call last): File
"/Users/pivotal/workspace/pgadmin4/web/pgadmin/feature_tests/view_data_dml_queries.py",
line 105, in runTest self._copy_paste_row() File
"/Users/pivotal/workspace/pgadmin4/web/pgadmin/feature_tests/view_data_dml_queries.py",
line 248, in _copy_paste_row self._compare_cell_value(row1_cell2_xpath,
"[default]") File
"/Users/pivotal/workspace/pgadmin4/web/pgadmin/feature_tests/view_data_dml_queries.py",
line 147, in _compare_cell_value CheckForViewDataTest.TIMEOUT_STRING File
"/Users/pivotal/.pyenv/versions/pgadmin/lib/python2.7/site-packages/selenium/webdriver/support/wait.py",
line 80, in until raise TimeoutException(message, screen, stacktrace)
TimeoutException: Message: Timed out waiting for div element to appear
>>>
>>> ​
>>>
>>> We also noticed that the function _wait is no longer used. Maybe we can
remove it.
>>>
>>> Thanks
>>> Joao & Shruti
>>>
>>> On Fri, May 26, 2017 at 9:07 AM, Surinder Kumar <
surinder.ku...@enterprisedb.com> wrote:
>>>>
>>>> Hi
>>>>
>>>> Please find updated patch.
>>>>
>>>> On Fri, May 26, 2017 at 3:15 AM, Joao Pedro De Almeida Pereira <
jdealmeidapere...@pivotal.io> wrote:
>>>>>
>>>>> Hello Surinder,
>>>>>
>>>>> We are having issues running the tests, this is the error that we are
getting:
>>>>>
>>>>>  File
"/Users/pivotal/workspace/pgadmin4/web/regression/python_test_utils/test_utils.py",
line 196, in create_table_with_query pg_cursor.execute(query)
ProgrammingError: role "postgres" does not exist Traceback (most recent
call last): File
"/Users/pivotal/workspace/pgadmin4/web/regression/python_test_utils/test_utils.py",
line 196, in create_table_with_query pg_cursor.execute(query)
ProgrammingError: relation "defaults_id_seq" does not exist
>>>>>
>>>>> ​
>>>>> ​Fixed.​
>>>>>
>>>>> There is already a function that waits for an element to be displayed
on the screen. The function is: self.page.find_by_xpath
>>>>>
>>>>> In line 179 and 180, both functions do the same thing, why do we need
to wait first and then wait again. Were you experiencing flakiness?
>>>>
>>>> I have to use another instance of webDriverWait because I was getting
TimeoutException. I guess timeout of 10 seconds wasn't enough to search the
element in DOM.
>>>>>
>>>>>
>>>>> Does _check_xss_in_view_data method checks for Cross Site Scripting?
>>>>
>>>> ​I forgot to change the method name.​
>>>>>
>>>>>
>>>>> Was there any reason to duplicate self.page._connects_to_server and
self.page._close_query_tool?
>>>>
>>>> ​Fixed.
>>>>
>>>> I got following exception when I used ​"self.page._close_query_tool":
>>>>>
>>>>> Traceback (most recent call last):
>>>>> File
"/Users/surinder/Documents/Projects/pgadmin4/web/pgadmin/feature_tests/view_data_dml_queries.py",
line 125, in runTest
>>>>> self.page.close_query_tool()
>>>>> File
"/Users/surinder/Documents/Projects/pgadmin4/web/regression/feature_utils/pgadmin_page.py",
line 66, in close_query_tool
>>>>>
self.driver.switch_to.frame(self.driver.find_elements_by_tag_name("iframe")[0])
>>>>> F

Re: [pgadmin-hackers] [pgAdmin4][Patch][RM_2400]: Columns with defaults set to NULL when removing contents after pasting in the edit grid

2017-05-26 Thread Surinder Kumar
Hi Joao,

Please apply patch RM_2400v2.patch first then apply Feature test cases
patch.

On May 26, 2017 7:42 PM, "Joao Pedro De Almeida Pereira" <
jdealmeidapere...@pivotal.io> wrote:

Hello Surinder,

Thanks for updating the patch. After looking into the updated version, we
found the following issues.


The tests looked flaky. We ran the tests three times and each time we had
timeout issues.
It failed twice in the location mentioned below. It also failed because the
row1 cell2 values was [null] instead of the expected [default].

Traceback (most recent call last):
  File 
"/Users/pivotal/workspace/pgadmin4/web/pgadmin/feature_tests/view_data_dml_queries.py",
line 105, in runTest
self._copy_paste_row()
  File 
"/Users/pivotal/workspace/pgadmin4/web/pgadmin/feature_tests/view_data_dml_queries.py",
line 248, in _copy_paste_row
self._compare_cell_value(row1_cell2_xpath, "[default]")
  File 
"/Users/pivotal/workspace/pgadmin4/web/pgadmin/feature_tests/view_data_dml_queries.py",
line 147, in _compare_cell_value
CheckForViewDataTest.TIMEOUT_STRING
  File 
"/Users/pivotal/.pyenv/versions/pgadmin/lib/python2.7/site-packages/selenium/webdriver/support/wait.py",
line 80, in until
raise TimeoutException(message, screen, stacktrace)
TimeoutException: Message: Timed out waiting for div element to appear

​

We also noticed that the function _wait is no longer used. Maybe we can
remove it.

Thanks
Joao & Shruti

On Fri, May 26, 2017 at 9:07 AM, Surinder Kumar <
surinder.ku...@enterprisedb.com> wrote:

> Hi
>
> Please find updated patch.
>
> On Fri, May 26, 2017 at 3:15 AM, Joao Pedro De Almeida Pereira <
> jdealmeidapere...@pivotal.io> wrote:
>
>> Hello Surinder,
>>
>> We are having issues running the tests, this is the error that we are
>> getting:
>>
>>   File 
>> "/Users/pivotal/workspace/pgadmin4/web/regression/python_test_utils/test_utils.py",
>>  line 196, in create_table_with_query
>> pg_cursor.execute(query)
>> ProgrammingError: role "postgres" does not exist
>>
>> Traceback (most recent call last):
>>   File 
>> "/Users/pivotal/workspace/pgadmin4/web/regression/python_test_utils/test_utils.py",
>>  line 196, in create_table_with_query
>> pg_cursor.execute(query)
>> ProgrammingError: relation "defaults_id_seq" does not exist
>>
>> ​
>> ​Fixed.​
>>
>> There is already a function that waits for an element to be displayed on
>> the screen. The function is: self.page.find_by_xpath
>>
>> In line 179 and 180, both functions do the same thing, why do we need to
>> wait first and then wait again. Were you experiencing flakiness?
>>
> I have to use another instance of webDriverWait because I was getting
> TimeoutException. I guess timeout of 10 seconds wasn't enough to search the
> element in DOM.
>
>>
>> Does _check_xss_in_view_data method checks for Cross Site Scripting?
>>
> ​I forgot to change the method name.​
>
>>
>> Was there any reason to duplicate self.page._connects_to_server and
>> self.page._close_query_tool?
>>
> ​Fixed.
>
> I got following exception when I used ​"self.page._close_query_tool":
>
>> Traceback (most recent call last):
>> File "/Users/surinder/Documents/Projects/pgadmin4/web/pgadmin/fea
>> ture_tests/view_data_dml_queries.py", line 125, in runTest
>> self.page.close_query_tool()
>> File "/Users/surinder/Documents/Projects/pgadmin4/web/regression/
>> feature_utils/pgadmin_page.py", line 66, in close_query_tool
>> self.driver.switch_to.frame(self.driver.find_elements_by_tag
>> _name("iframe")[0])
>> File "/Users/surinder/Documents/Workspaces/PEM_35/lib/python3.5/s
>> ite-packages/selenium/webdriver/remote/switch_to.py", line 87, in frame
>> self._driver.execute(Command.SWITCH_TO_FRAME, {'id': frame_reference})
>> File "/Users/surinder/Documents/Workspaces/PEM_35/lib/python3.5/s
>> ite-packages/selenium/webdriver/remote/webdriver.py", line 238, in
>> execute
>> self.error_handler.check_response(response)
>> File "/Users/surinder/Documents/Workspaces/PEM_35/lib/python3.5/s
>> ite-packages/selenium/webdriver/remote/errorhandler.py", line 193, in
>> check_response
>> raise exception_class(message, screen, stacktrace)
>> selenium.common.exceptions.WebDriverException: Message: unknown error:
>> Runtime.evaluate threw exception: Error: element is not attached to the
>> page document
>> at Cache.retrieveItem (:173:17)
>> at unwrap (:293:20)
>> at unwrap (:297:19)
>> at callFunction (

Re: [pgadmin-hackers] [pgAdmin4][Patch][RM_2400]: Columns with defaults set to NULL when removing contents after pasting in the edit grid

2017-05-26 Thread Surinder Kumar
Hi

Please find updated patch.

On Fri, May 26, 2017 at 3:15 AM, Joao Pedro De Almeida Pereira <
jdealmeidapere...@pivotal.io> wrote:

> Hello Surinder,
>
> We are having issues running the tests, this is the error that we are
> getting:
>
>   File 
> "/Users/pivotal/workspace/pgadmin4/web/regression/python_test_utils/test_utils.py",
>  line 196, in create_table_with_query
> pg_cursor.execute(query)
> ProgrammingError: role "postgres" does not exist
>
> Traceback (most recent call last):
>   File 
> "/Users/pivotal/workspace/pgadmin4/web/regression/python_test_utils/test_utils.py",
>  line 196, in create_table_with_query
> pg_cursor.execute(query)
> ProgrammingError: relation "defaults_id_seq" does not exist
>
> ​
> ​Fixed.​
>
> There is already a function that waits for an element to be displayed on
> the screen. The function is: self.page.find_by_xpath
>
> In line 179 and 180, both functions do the same thing, why do we need to
> wait first and then wait again. Were you experiencing flakiness?
>
I have to use another instance of webDriverWait because I was getting
TimeoutException. I guess timeout of 10 seconds wasn't enough to search the
element in DOM.

>
> Does _check_xss_in_view_data method checks for Cross Site Scripting?
>
​I forgot to change the method name.​

>
> Was there any reason to duplicate self.page._connects_to_server and
> self.page._close_query_tool?
>
​Fixed.

I got following exception when I used ​"self.page._close_query_tool":

> Traceback (most recent call last):
> File "/Users/surinder/Documents/Projects/pgadmin4/web/pgadmin/fea
> ture_tests/view_data_dml_queries.py", line 125, in runTest
> self.page.close_query_tool()
> File "/Users/surinder/Documents/Projects/pgadmin4/web/regression/
> feature_utils/pgadmin_page.py", line 66, in close_query_tool
> self.driver.switch_to.frame(self.driver.find_elements_by_tag
> _name("iframe")[0])
> File "/Users/surinder/Documents/Workspaces/PEM_35/lib/python3.5/
> site-packages/selenium/webdriver/remote/switch_to.py", line 87, in frame
> self._driver.execute(Command.SWITCH_TO_FRAME, {'id': frame_reference})
> File "/Users/surinder/Documents/Workspaces/PEM_35/lib/python3.5/
> site-packages/selenium/webdriver/remote/webdriver.py", line 238, in
> execute
> self.error_handler.check_response(response)
> File "/Users/surinder/Documents/Workspaces/PEM_35/lib/python3.5/
> site-packages/selenium/webdriver/remote/errorhandler.py", line 193, in
> check_response
> raise exception_class(message, screen, stacktrace)
> selenium.common.exceptions.WebDriverException: Message: unknown error:
> Runtime.evaluate threw exception: Error: element is not attached to the
> page document
> at Cache.retrieveItem (:173:17)
> at unwrap (:293:20)
> at unwrap (:297:19)
> at callFunction (:343:29)
> at apply.ELEMENT (:357:23)
> at :358:3
> (Session info: chrome=58.0.3029.110)
> (Driver info: chromedriver=2.29.461585 
> (0be2cd95f834e9ee7c46bcc7cf405b483f5ae83b),platform=Mac
> OS X 10.10.2 x86_64)


I replaced this method with the one I was using in the test file and It is
working for every test case.

>
> The method _verify_insert_data looks more or less the same code as in the
> end of _copy_paste_row, should this be merged?
>
​Yes, I have merged.

Thanks​

>
> Thanks,
> Joao & Shruti
>
>
> On Thu, May 25, 2017 at 4:41 PM, Dave Page <dp...@pgadmin.org> wrote:
>
>> Hi
>>
>> The tests failed on both PG 9.4 and 9.6 for me :-(
>>
>> ==
>> ERROR: runTest (pgadmin.feature_tests.view_da
>> ta_dml_queries.CheckForViewDataTest)
>> Validate Insert, Update operations in View data with given test data
>> --
>> Traceback (most recent call last):
>>   File "/Users/dpage/git/pgadmin4/web/pgadmin/feature_tests/view_da
>> ta_dml_queries.py",
>> line 120, in runTest
>> self._verify_insert_data()
>>   File "/Users/dpage/git/pgadmin4/web/pgadmin/feature_tests/view_da
>> ta_dml_queries.py",
>> line 316, in _verify_insert_data
>> self._compare_cell_value(cell_xpath, config_data[str(idx)][1])
>>   File "/Users/dpage/git/pgadmin4/web/pgadmin/feature_tests/view_da
>> ta_dml_queries.py",
>> line 165, in _compare_cell_value
>> "Timed out waiting for element to appear"
>>   File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packa
>> ges/selenium/webdriver/support/wait.py",
>> line 80, in unt

Re: [pgadmin-hackers] [pgAdmin4][Patch]: Load module's JS files only when required

2017-05-25 Thread Surinder Kumar
On Fri, May 26, 2017 at 3:02 AM, Dave Page  wrote:

> On Tue, May 23, 2017 at 4:21 PM, Dave Page  wrote:
> >
> > I'm actually thinking that maybe it would be easier to start with the
> > CSS files
>
> Which i did yesterday. However, it soon became obvious that that isn't
> so easy either, as the CSS files contain url references which need to
> be adjusted, which isn't trivial.
>
> However, I did find a flask-webpack module, which looks interesting:
>
> https://github.com/nickjj/flask-webpack
> https://nickjanetakis.com/blog/manage-your-assets-with-flask-webpack
>
> Surinder; when you have some free time, could you look into a simple
> PoC with the CSS files using that please?
>
​Ok. I will look

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


Re: [pgadmin-hackers] [pgAdmin4][Patch]: Load module's JS files only when required

2017-05-22 Thread Surinder Kumar
Hi

On Mon, May 22, 2017 at 4:22 PM, Dave Page <dp...@pgadmin.org> wrote:

> Hi
>
> On Monday, May 22, 2017, Surinder Kumar <surinder.ku...@enterprisedb.com>
> wrote:
>
>> Hi
>>
>> As per pgAdmin4 design, template JS files can either be preloaded or load
>> when a specific node expands (by adding for e.g.: when: 'server').
>>
>> The JS files of several modules found to be loaded when pgAdmin4 loads
>> which results in increasing:
>>
>>- the number of http requests
>>- latency(greater request time)
>>- pgAdmin4 load time
>>
>> *Tested on Firefox:*
>>
>> Before applying patch
>>
>>- http requests - 143
>>- Content size - 3.4 MB
>>- Load time: 4.1s (onload: 524ms)
>>
>> After applying patch
>>
>>- http requests: 68
>>- Content size: 2.1 MB
>>- Load time: 2.84s (onload: 481ms)
>>
>> This is great work!
>
> However (sorry!) - I'm planning on working on an alternative change on my
> flight in a couple of hours. Joao has broken the Grunt code out of the
> History tab patch for me to work with - the idea is something like:
>
> - We continue to migrate all the JS out of templates and into static files
> whereever possible, using the client-side translation.
>
​Yes. It will be then easier to cover most of the JS code for minify if
client side ​translation is used.

>
> - We then have a set of Grunt tasks that will collect all the static JS,
> minimise it, and pack it into a single file to load at startup.
>
​I wrote few grunt tasks using r.js optimizer this weekend which:

1. Finds all static JS file recursively into the modules using regex
pattern and then creates the tasks to minify each JS file and store its
'min.js' in same directory and loads min.js when current_app.debug is False
else returns JS file.

2. A task to merge given list of CSS files into a single file and then
minify using 'grunt-contrib-cssmin' task and then insert that file with

[pgadmin-hackers] [pgAdmin4][Patch]: Load module's JS files only when required

2017-05-21 Thread Surinder Kumar
Hi

As per pgAdmin4 design, template JS files can either be preloaded or load
when a specific node expands (by adding for e.g.: when: 'server').

The JS files of several modules found to be loaded when pgAdmin4 loads
which results in increasing:

   - the number of http requests
   - latency(greater request time)
   - pgAdmin4 load time

*Tested on Firefox:*

Before applying patch

   - http requests - 143
   - Content size - 3.4 MB
   - Load time: 4.1s (onload: 524ms)

After applying patch

   - http requests: 68
   - Content size: 2.1 MB
   - Load time: 2.84s (onload: 481ms)


Also, I found the http request for gravtar takes much time(depending on
internet speed) to load which increases load time.
https://secure.gravatar.com/avatar/d30aea269994f01256a99a8e7154a328?s=100=retro=g

Shouldn't the gravatar image be replaced with custom image ? I don't see
its any use except displaying for user.

*Patch changes:*

1) Load following modules JS when 'servers' node expands:

   -  Roles
   -  FileManager
   -  Backup
   -  Datagrid
   -  Grant wizard
   -  Import/Export, Maintenance & restore
   -  Sqleditor

2) Load Debugger JS when database node expands

3) Load Flotr2 when render function is called in dashboard.js

4) Load BigNumber library when sorting is performed on Statistics tab in
backgrid.pgadmin.js

5) Remove 'backgrid.select.all' from dependency list(user_management.js) as
it had no use.

After applying this patch, Menu items such "Query tool", "Grant wizard"
don't appear in Tools menu.
I have logged an RM2424  to
track this.

Please find attached patch and review.

Thanks
Surinder


load_module_js_when_required.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] [pgAdmin4][Patch][RM_2400]: Columns with defaults set to NULL when removing contents after pasting in the edit grid

2017-05-19 Thread Surinder Kumar
Hi

Please find updated patch and review.

On Thu, May 18, 2017 at 7:36 PM, Joao Pedro De Almeida Pereira <
jdealmeidapere...@pivotal.io> wrote:

> Hello Hackers,
>
> We reviewed the PR, and there are a lot of new lines of code in this
> patch, are we sure that we can have a good coverage of the functionality
> just by doing feature tests?
> Adding more code to a 3.5k+ lines file doesn't look like a good option, do
> you think it is possible to extract some of the functionality to their own
> files and have test around those functionalities?​
>
​To improve the code readability, reduce code complexity and to make code
testable, the code must be splitted component wise.
Here is my suggestion:

1. The code for classes like “SQLEditorView” and “SqlEditorController” can
be moved into two files like "editor_view.js and “editor_controller.js" and
called from within "sqleditor.js".

2. All utilities functions can be moved into separate utils file and can
write test cases.

3. Slickgrid listener functions such as:
​
onBeforeEditCell, onKeyDown,
​ ​
onCellChange, onAddNewRow
​
can be moved into
​ a file and write test cases around.

This needs discussion. Any suggestion?

>
> Do we really need to have an epicRandomString function in our code? Would
> it be better to use a library that would provide us that functionality out
> of the box?
>
We are using "epicRandomString function" to uniquely identify each record,
I talked to Harshal who is eliminating the use of this function and instead
maintaining counter for the rows added/updated/deleted.

> The functions this.applyValue in slick.pgadmin.editors.js that were
> change in this patch are exactly the same, can we extract that code into a
> single function instead of repeating the code?
>
​I have moved common logic into a new function.​

>
> Using feature tests is a good option to ensure that the integration of all
> the components of the application is working as expected, but in order to
> tests behaviors that are edge cases the Unit Tests are much cheaper to run
> and create.
>
​I will write test cases for functions once they are moved into their
separate files as discussed above.

>
> Thanks
> Joao & Shruti
>
>
> On Thu, May 18, 2017 at 1:22 AM, Surinder Kumar <
> surinder.ku...@enterprisedb.com> wrote:
>
>> Hi Dave,
>>
>> Please review the updated patch.
>>
>> On Wed, May 17, 2017 at 8:46 PM, Dave Page <dp...@pgadmin.org> wrote:
>>
>>> Hi
>>>
>>> On Wed, May 17, 2017 at 3:08 PM, Surinder Kumar <
>>> surinder.ku...@enterprisedb.com> wrote:
>>>
>>>> Hi Dave,
>>>>
>>>> *Implementation:*
>>>>
>>>> 1) Took a flag 'is_row_copied' for each copied row:
>>>>
>>>>  - to distinguish it from add/update row.
>>>>  - to write code specific to copied row only as it requires different
>>>> logic than add row.
>>>>
>>>> 2) After pasting an existing row:
>>>>
>>>>  - If a user clear the cell value, it must set cell to [default] value
>>>> if default value is explicitly given for column while creating table
>>>> otherwise [null].
>>>>
>>>>  - Again, if a user entered a value in same cell, then removes that
>>>> value, set it to [null] (the same behaviour is for add row).
>>>>
>>>> 3) Took a 2-dimensional array "grid.copied_rows" to keep track the
>>>> changes of each row's cell so that changes made to each cell are
>>>> independent and removed once data is saved.
>>>>
>>>> 4) On pasting a row, the cell must be highlighted with light green
>>>> colour, so triggers an addNewRow event. Now copied row will add to grid
>>>> instead of re-rendering all rows again.
>>>>
>>>> 5) Moved the common logic into functions.
>>>>
>>>> This patch pass the feature test cases and jasmine test case.
>>>> Also I will add the test cases for copy row and send an updated patch.
>>>>
>>>> Please find attached patch and review.
>>>>
>>>
>>> Looks good. I saw the following issues:
>>>
>>> - The "new" row is not available once I've created the first new row, or
>>> pasted some.
>>>
>> ​Fixed.
>>
>>>
>>> - Rows are pasted in reverse order.
>>>
>> ​Fixed.
>>
>>>
>>> - If I copy/paste a new row that has yet to be saved, none of the values
>>> are actually copied.
>>>
>> ​Fixed.​
>>
>>>
>>&

[pgadmin-hackers] [pgAdmin4][Patch][RM_2400]: Columns with defaults set to NULL when removing contents after pasting in the edit grid

2017-05-17 Thread Surinder Kumar
Hi Dave,

*Implementation:*

1) Took a flag 'is_row_copied' for each copied row:

 - to distinguish it from add/update row.
 - to write code specific to copied row only as it requires different logic
than add row.

2) After pasting an existing row:

 - If a user clear the cell value, it must set cell to [default] value if
default value is explicitly given for column while creating table otherwise
[null].

 - Again, if a user entered a value in same cell, then removes that value,
set it to [null] (the same behaviour is for add row).

3) Took a 2-dimensional array "grid.copied_rows" to keep track the changes
of each row's cell so that changes made to each cell are independent and
removed once data is saved.

4) On pasting a row, the cell must be highlighted with light green colour,
so triggers an addNewRow event. Now copied row will add to grid instead of
re-rendering all rows again.

5) Moved the common logic into functions.

This patch pass the feature test cases and jasmine test case.
Also I will add the test cases for copy row and send an updated patch.

Please find attached patch and review.


Thanks,
Surinder Kumar


RM_2400.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] Re: [pgAdmin4][Patch][RM2399]: Disabled row's background color disappeared on save in View data

2017-05-15 Thread Surinder Kumar
Hi,

The array temp_new_rows is used to keep track to new added rows in View
data. It is used to add 'disabled_row'class for new rows to highlight when
grid renders after delete/copy/add row operation.

Please find attached patch.

On Mon, May 15, 2017 at 10:14 PM, Surinder Kumar <
surinder.ku...@enterprisedb.com> wrote:

> Hi Joao,
>
> The single cell selection works for me using Cmd+C. Not reproducible for
> me.
>
> Please provide steps to reproduce.
>
>
>
>
> On Mon, May 15, 2017 at 9:58 PM, Harshal Dhumal <
> harshal.dhu...@enterprisedb.com> wrote:
>
>> Hi,
>>
>> Issue caused because variable temp_new_rows was access before it was
>> initialised. Attached patch fixes this issue.
>>
>> --
>> *Harshal Dhumal*
>> *Sr. Software Engineer*
>>
>> EnterpriseDB India: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>>
>> On Mon, May 15, 2017 at 9:28 PM, Dave Page <dp...@pgadmin.org> wrote:
>>
>>> Aww, nuts. I thought we had tests for that? Did we miss that particular
>>> case?
>>>
>>> Anyway, copying of a single value still works (with Cmd+C), so I'm not
>>> inclined to re-wrap everything for this unless someone can get a patch to
>>> me by ~9AM UK time tomorrow. Surinder?
>>>
>>> On Mon, May 15, 2017 at 4:50 PM, Joao Pedro De Almeida Pereira <
>>> jdealmeidapere...@pivotal.io> wrote:
>>>
>>>> Hi hackers,
>>>>
>>>> We were checking out the selection functionality after this
>>>> commit--looks like selection no longer works for single cells.
>>>>
>>>> If you press a cell in the grid the following message is console logged:
>>>>
>>>> sqleditor.js:869 Uncaught TypeError: Cannot read property 'indexOf' of 
>>>> undefined
>>>> at SlickGrid. (sqleditor.js:869)
>>>> at Event.notify (slick.core.js:143)
>>>> at trigger (slick.grid.js:1067)
>>>> at setActiveCellInternal (slick.grid.js:2693)
>>>> at HTMLDivElement.handleClick (slick.grid.js:2469)
>>>> at HTMLDivElement.dispatch (jquery-1.11.2.js:4665)
>>>> at HTMLDivElement.$event.dispatch (jquery.event.drag-2.2.js:374)
>>>> at HTMLDivElement.elemData.handle (jquery-1.11.2.js:4333)
>>>>
>>>> ​
>>>>
>>>> Thanks
>>>> George & Joao
>>>>
>>>> On Mon, May 15, 2017 at 10:05 AM, Dave Page <dp...@pgadmin.org> wrote:
>>>>
>>>>> I've committed a modified version of this patch following some
>>>>> discussion on IM with Surinder.
>>>>>
>>>>> Thanks Surinder!
>>>>>
>>>>> On Mon, May 15, 2017 at 10:56 AM, Surinder Kumar <
>>>>> surinder.ku...@enterprisedb.com> wrote:
>>>>>
>>>>>> Hi
>>>>>>
>>>>>> The regression test cases for 'copy row' was failing.
>>>>>> This patch was assuming that each selected row will have primary key
>>>>>> due to selection was not working. Fixed.
>>>>>>
>>>>>> Please find revised patch.
>>>>>>
>>>>>> Thanks
>>>>>> Surinder Kumar
>>>>>>
>>>>>> On Mon, May 15, 2017 at 1:13 PM, Surinder Kumar <
>>>>>> surinder.ku...@enterprisedb.com> wrote:
>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> This patch contains following changes:
>>>>>>>
>>>>>>> 1) When a new row is added, allow to delete if changes are not saved.
>>>>>>>
>>>>>>> 2) Disable new row selection if primary key is not given but changes
>>>>>>> are saved on server.
>>>>>>>
>>>>>>> 3) Copy and paste one or more rows, then add new row doesn't
>>>>>>> work(entered value doesn't appear).
>>>>>>>
>>>>>>> 4) After deleting a row, add new row doesn't work.
>>>>>>>
>>>>>>> 5) New row added with explicitly given primary key should not
>>>>>>> disabled.
>>>>>>>
>>>>>>>
>>>>>>> Please review.
>>>>>>>
>>>>>>> Thanks,
>>>>>>> Surinder Kumar
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org
>>>>>> )
>>>>>> To make changes to your subscription:
>>>>>> http://www.postgresql.org/mailpref/pgadmin-hackers
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> 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
>>>
>>
>>
>


track_new_rows_minor_fix.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] Re: [pgAdmin4][Patch][RM2399]: Disabled row's background color disappeared on save in View data

2017-05-15 Thread Surinder Kumar
Hi Joao,

The single cell selection works for me using Cmd+C. Not reproducible for me.

Please provide steps to reproduce.




On Mon, May 15, 2017 at 9:58 PM, Harshal Dhumal <
harshal.dhu...@enterprisedb.com> wrote:

> Hi,
>
> Issue caused because variable temp_new_rows was access before it was
> initialised. Attached patch fixes this issue.
>
> --
> *Harshal Dhumal*
> *Sr. Software Engineer*
>
> EnterpriseDB India: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
> On Mon, May 15, 2017 at 9:28 PM, Dave Page <dp...@pgadmin.org> wrote:
>
>> Aww, nuts. I thought we had tests for that? Did we miss that particular
>> case?
>>
>> Anyway, copying of a single value still works (with Cmd+C), so I'm not
>> inclined to re-wrap everything for this unless someone can get a patch to
>> me by ~9AM UK time tomorrow. Surinder?
>>
>> On Mon, May 15, 2017 at 4:50 PM, Joao Pedro De Almeida Pereira <
>> jdealmeidapere...@pivotal.io> wrote:
>>
>>> Hi hackers,
>>>
>>> We were checking out the selection functionality after this
>>> commit--looks like selection no longer works for single cells.
>>>
>>> If you press a cell in the grid the following message is console logged:
>>>
>>> sqleditor.js:869 Uncaught TypeError: Cannot read property 'indexOf' of 
>>> undefined
>>> at SlickGrid. (sqleditor.js:869)
>>> at Event.notify (slick.core.js:143)
>>> at trigger (slick.grid.js:1067)
>>> at setActiveCellInternal (slick.grid.js:2693)
>>> at HTMLDivElement.handleClick (slick.grid.js:2469)
>>> at HTMLDivElement.dispatch (jquery-1.11.2.js:4665)
>>> at HTMLDivElement.$event.dispatch (jquery.event.drag-2.2.js:374)
>>> at HTMLDivElement.elemData.handle (jquery-1.11.2.js:4333)
>>>
>>> ​
>>>
>>> Thanks
>>> George & Joao
>>>
>>> On Mon, May 15, 2017 at 10:05 AM, Dave Page <dp...@pgadmin.org> wrote:
>>>
>>>> I've committed a modified version of this patch following some
>>>> discussion on IM with Surinder.
>>>>
>>>> Thanks Surinder!
>>>>
>>>> On Mon, May 15, 2017 at 10:56 AM, Surinder Kumar <
>>>> surinder.ku...@enterprisedb.com> wrote:
>>>>
>>>>> Hi
>>>>>
>>>>> The regression test cases for 'copy row' was failing.
>>>>> This patch was assuming that each selected row will have primary key
>>>>> due to selection was not working. Fixed.
>>>>>
>>>>> Please find revised patch.
>>>>>
>>>>> Thanks
>>>>> Surinder Kumar
>>>>>
>>>>> On Mon, May 15, 2017 at 1:13 PM, Surinder Kumar <
>>>>> surinder.ku...@enterprisedb.com> wrote:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> This patch contains following changes:
>>>>>>
>>>>>> 1) When a new row is added, allow to delete if changes are not saved.
>>>>>>
>>>>>> 2) Disable new row selection if primary key is not given but changes
>>>>>> are saved on server.
>>>>>>
>>>>>> 3) Copy and paste one or more rows, then add new row doesn't
>>>>>> work(entered value doesn't appear).
>>>>>>
>>>>>> 4) After deleting a row, add new row doesn't work.
>>>>>>
>>>>>> 5) New row added with explicitly given primary key should not
>>>>>> disabled.
>>>>>>
>>>>>>
>>>>>> Please review.
>>>>>>
>>>>>> Thanks,
>>>>>> Surinder Kumar
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
>>>>> To make changes to your subscription:
>>>>> http://www.postgresql.org/mailpref/pgadmin-hackers
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Dave Page
>>>> Blog: http://pgsnake.blogspot.com
>>>> Twitter: @pgsnake
>>>>
>>>> EnterpriseDB UK: http://www.enterprisedb.com
>>>> The Enterprise PostgreSQL Company
>>>>
>>>
>>>
>>
>>
>> --
>> Dave Page
>> Blog: http://pgsnake.blogspot.com
>> Twitter: @pgsnake
>>
>> EnterpriseDB UK: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>>
>
>


[pgadmin-hackers] Re: [pgAdmin4][Patch][RM2399]: Disabled row's background color disappeared on save in View data

2017-05-15 Thread Surinder Kumar
Hi

The regression test cases for 'copy row' was failing.
This patch was assuming that each selected row will have primary key due to
selection was not working. Fixed.

Please find revised patch.

Thanks
Surinder Kumar

On Mon, May 15, 2017 at 1:13 PM, Surinder Kumar <
surinder.ku...@enterprisedb.com> wrote:

> Hi,
>
> This patch contains following changes:
>
> 1) When a new row is added, allow to delete if changes are not saved.
>
> 2) Disable new row selection if primary key is not given but changes are
> saved on server.
>
> 3) Copy and paste one or more rows, then add new row doesn't work(entered
> value doesn't appear).
>
> 4) After deleting a row, add new row doesn't work.
>
> 5) New row added with explicitly given primary key should not disabled.
>
>
> Please review.
>
> Thanks,
> Surinder Kumar
>


RM_2399_v1.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


[pgadmin-hackers] [pgAdmin4][Patch][RM2399]: Disabled row's background color disappeared on save in View data

2017-05-15 Thread Surinder Kumar
Hi,

This patch contains following changes:

1) When a new row is added, allow to delete if changes are not saved.

2) Disable new row selection if primary key is not given but changes are
saved on server.

3) Copy and paste one or more rows, then add new row doesn't work(entered
value doesn't appear).

4) After deleting a row, add new row doesn't work.

5) New row added with explicitly given primary key should not disabled.


Please review.

Thanks,
Surinder Kumar


RM_2399.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] pgAdmin 4 commit: Improve handling of nulls and default values in the d

2017-05-12 Thread Surinder Kumar
Hi Dave,

Please find attached patch and review.

Also, I found an issue <https://redmine.postgresql.org/issues/2399> which
logged and will work on it.

On Fri, May 12, 2017 at 5:19 PM, Surinder Kumar <
surinder.ku...@enterprisedb.com> wrote:

> On Fri, May 12, 2017 at 5:00 PM, Dave Page <dp...@pgadmin.org> wrote:
>
>>
>>
>> On Fri, May 12, 2017 at 12:19 PM, Harshal Dhumal <
>> harshal.dhu...@enterprisedb.com> wrote:
>>
>>> Hi,
>>>
>>> Below code snippet from above commit assumes that we have to disable
>>> last row after saving.
>>>
>>> @@ -2320,6
>>> <https://git.postgresql.org/gitweb/?p=pgadmin4.git;a=blob;f=web/pgadmin/tools/sqleditor/templates/sqleditor/js/sqleditor.js;h=2062aa2bb909794e5d2c339aec62d2d4e8ffbc28#l2320>
>>> +2340,10
>>> <https://git.postgresql.org/gitweb/?p=pgadmin4.git;a=blob;f=web/pgadmin/tools/sqleditor/templates/sqleditor/js/sqleditor.js;h=ba9dd4339b8d6287f454ddbde1826be1a2bea0f6;hb=4f9628ed436de53b1ab1a06b123755a86a8f2288#l2340>
>>> @@ define(
>>>grid.setSelectedRows([]);
>>>  }
>>>
>>> +// Add last row(new row) to keep track of it
>>> +if (is_added) {
>>> +  self.rows_to_disable.push(grid.getDat
>>> aLength()-1);
>>> +}
>>>
>>>  However this is not the case all the time
>>>
>>> For e.g
>>> Table has some data already and If user adds new row (do not save) and
>>> then copy past few exiting rows (at this point  newly added row no longer
>>> remains at last position). And after saving it disable last row which is
>>> not the newly added row.
>>>
>>
>> Hmm, good point. Can you/Surinder work up a fix for that in time for the
>> release please?
>>
> ​Sure Dave, I am working on it.​
>
>>
>> --
>> Dave Page
>> Blog: http://pgsnake.blogspot.com
>> Twitter: @pgsnake
>>
>> EnterpriseDB UK: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>>
>
>


fix_disable_row_after_paste_row.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] pgAdmin 4 commit: Improve handling of nulls and default values in the d

2017-05-12 Thread Surinder Kumar
On Fri, May 12, 2017 at 5:00 PM, Dave Page  wrote:

>
>
> On Fri, May 12, 2017 at 12:19 PM, Harshal Dhumal <
> harshal.dhu...@enterprisedb.com> wrote:
>
>> Hi,
>>
>> Below code snippet from above commit assumes that we have to disable last
>> row after saving.
>>
>> @@ -2320,6
>> 
>> +2340,10
>> 
>> @@ define(
>>grid.setSelectedRows([]);
>>  }
>>
>> +// Add last row(new row) to keep track of it
>> +if (is_added) {
>> +  self.rows_to_disable.push(grid.getDataLength()-1);
>> +}
>>
>>  However this is not the case all the time
>>
>> For e.g
>> Table has some data already and If user adds new row (do not save) and
>> then copy past few exiting rows (at this point  newly added row no longer
>> remains at last position). And after saving it disable last row which is
>> not the newly added row.
>>
>
> Hmm, good point. Can you/Surinder work up a fix for that in time for the
> release please?
>
​Sure Dave, I am working on it.​

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


Re: [pgadmin-hackers] [pgAdmin4][Patch][RM2257]: Query tool - Insert row doesn't use default values

2017-05-12 Thread Surinder Kumar
Hi Dave,

On Fri, May 12, 2017 at 3:41 PM, Dave Page <dp...@pgadmin.org> wrote:

> Hi,
>
> Couple of comments:
>
> - Can we improve the speed of this test? Perhaps by adding multiple rows
> to the table at once, then checking the result after a single save/refresh?
> We need to keep the feature tests as fast as possible to ensure they remain
> practical to run.
>
​Sure. I will do this and send updated patch.​

>
> - I get the following failure under Python 2. It passes under Python 3 as
> you might imagine given the assertion error.
>
​I will check.​

>
> Thanks!
>
> 2017-05-12 11:00:00,860:ERROR:STDERR:==
> 
> 2017-05-12 11:00:00,861:ERROR:STDERR:FAIL: runTest
> (pgadmin.feature_tests.view_data_dml_queries.CheckForViewDataTest)
> 2017-05-12 11:00:00,861:ERROR:STDERR:Validate Insert, Update operations
> in View data with given test data
> 2017-05-12 11:00:00,861:ERROR:STDERR:--
> 
> 2017-05-12 11:00:00,861:ERROR:STDERR:Traceback (most recent call last):
> 2017-05-12 11:00:00,861:ERROR:STDERR:  File "/Users/dpage/git/pgadmin4/web
> /pgadmin/feature_tests/view_data_dml_queries.py", line 160, in runTest
> 2017-05-12 11:00:00,861:ERROR:STDERR:self._update_row_in_table(key)
> 2017-05-12 11:00:00,861:ERROR:STDERR:  File "/Users/dpage/git/pgadmin4/web
> /pgadmin/feature_tests/view_data_dml_queries.py", line 432, in
> _update_row_in_table
> 2017-05-12 11:00:00,861:ERROR:STDERR:self._verify_update_data(table,
> row)
> 2017-05-12 11:00:00,861:ERROR:STDERR:  File "/Users/dpage/git/pgadmin4/web
> /pgadmin/feature_tests/view_data_dml_queries.py", line 477, in
> _verify_update_data
> 2017-05-12 11:00:00,861:ERROR:STDERR:self.assertEquals(cell2,
> test_verify_data['data_default_nulls'])
> 2017-05-12 11:00:00,861:ERROR:STDERR:AssertionError: "''" != u''
> 2017-05-12 11:00:00,861:ERROR:STDERR:--
> 
> 2017-05-12 11:00:00,861:ERROR:STDERR:Ran 6 tests in 208.850s
> 2017-05-12 11:00:00,861:ERROR:STDERR:FAILED
> 2017-05-12 11:00:00,861:ERROR:STDERR: (failures=1)
> On Wed, May 10, 2017 at 3:02 PM, Surinder Kumar <
> surinder.ku...@enterprisedb.com> wrote:
>
>> Hi Dave,
>>
>> Please find attached patch for Feature test cases for RM_2257
>>
>> *Implementation detail:*
>>
>>  - Added a test_data.json file which contains Insert and Update test
>> related input data
>>
>>  - First of all, we create three tables such as
>>  a) defaults_text
>>  b) defaults_boolean
>>  c) defaults_number
>>  d) defaults_json
>>  These tables has columns with different constraints (default value,
>> not_null etc) to test with various input test data.
>>
>> - Test cases for insert are executed first and then test cases for update.
>>
>> Please review the patch.
>>
>>
>> On Wed, May 10, 2017 at 2:22 PM, Surinder Kumar <
>> surinder.ku...@enterprisedb.com> wrote:
>>
>>> Hi Dave,
>>>
>>> Please find attached patch for RM only.
>>>
>>> *Changes:*
>>>
>>>  - All formatters now handles both [null] and [default] values
>>>
>>>  - the cell values are validated on server side as in pgAdmin3.
>>>
>>>  - added light grey color for cells with [null] and [default]
>>> placeholders.
>>>
>>> On Wed, May 10, 2017 at 2:12 PM, Dave Page <dp...@pgadmin.org> wrote:
>>>
>>>>
>>>>
>>>> On Wed, May 10, 2017 at 9:39 AM, Surinder Kumar <
>>>> surinder.ku...@enterprisedb.com> wrote:
>>>>
>>>>> Hi Dave,
>>>>>
>>>>> On Wed, May 10, 2017 at 2:06 PM, Dave Page <dp...@pgadmin.org> wrote:
>>>>>
>>>>>> Any chance we can get this wrapped up today Surinder?
>>>>>>
>>>>> ​I have fixed RM case, I am currently writing its feature test cases
>>>>> which is taking some time.
>>>>> Should I send patch for RM case only?​ I will try to complete test
>>>>> cases by today eod.
>>>>>
>>>>
>>>> Yes please.
>>>>
>>>> Thanks!
>>>>
>>>> --
>>>> Dave Page
>>>> Blog: http://pgsnake.blogspot.com
>>>> Twitter: @pgsnake
>>>>
>>>> EnterpriseDB UK: http://www.enterprisedb.com
>>>> The Enterprise PostgreSQL Company
>>>>
>>>
>>>
>>
>
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>


Re: [pgadmin-hackers] [pgAdmin4][Patch][RM2257]: Query tool - Insert row doesn't use default values

2017-05-11 Thread Surinder Kumar
Hi Dave,

Please find updated patch

On Thu, May 11, 2017 at 2:29 PM, Dave Page <dp...@pgadmin.org> wrote:

> Ooops, managed to hit send too soon.
>
> ... it leads to failed updates such as:
>
> 2017-05-11 09:55:47,570: SQL pgadmin: Execute (void) for server #1 -
> CONN:2096775 (Query-id: 4540472):
> UPDATE public.defaults SET
> data_default_no_nulls = 'asas' WHERE
> ;
> 2017-05-11 09:55:47,577: ERROR pgadmin:
> Failed to execute query (execute_void) for the server #1 - CONN:2096775
> (Query-id: 4540472):
> Error Message:ERROR:  syntax error at or near ";"
> LINE 3: ;
>
​The new rows added is kept disabled untill grid is not refreshed.

>
>
> On Thu, May 11, 2017 at 9:58 AM, Dave Page <dp...@pgadmin.org> wrote:
>
>> Hi
>>
>> There seems to be couple of bugs in this;
>>
>> - When creating a new row with my test table, if I click in the id
>> column, don't change anything, then click in another column, the ID column
>> value changes from [default] to [null], making it impossible to save that
>> row with the default value. In this case I would expect it to stay at
>> [default] unless I explicitly entered a value.
>>
> ​Fixed.​

>
>> - When I add a new row, but leave the id as [default], the row is saved,
>> but the [default] marker changes from gray to black (but only in the id
>> column.
>>
> ​I forgot to add 'grey_color' class for numeric type fields. Now added.​

>
>> - I'm able to edit a freshly added row immediately after saving but
>> before refreshing. This shouldn't be allowed if we don't know what the
>> primary key value is, as it leads to failed updates such as:
>>
>>
>> On Wed, May 10, 2017 at 9:52 AM, Surinder Kumar <
>> surinder.ku...@enterprisedb.com> wrote:
>>
>>> Hi Dave,
>>>
>>> Please find attached patch for RM only.
>>>
>>> *Changes:*
>>>
>>>  - All formatters now handles both [null] and [default] values
>>>
>>>  - the cell values are validated on server side as in pgAdmin3.
>>>
>>>  - added light grey color for cells with [null] and [default]
>>> placeholders.
>>>
>>> On Wed, May 10, 2017 at 2:12 PM, Dave Page <dp...@pgadmin.org> wrote:
>>>
>>>>
>>>>
>>>> On Wed, May 10, 2017 at 9:39 AM, Surinder Kumar <
>>>> surinder.ku...@enterprisedb.com> wrote:
>>>>
>>>>> Hi Dave,
>>>>>
>>>>> On Wed, May 10, 2017 at 2:06 PM, Dave Page <dp...@pgadmin.org> wrote:
>>>>>
>>>>>> Any chance we can get this wrapped up today Surinder?
>>>>>>
>>>>> ​I have fixed RM case, I am currently writing its feature test cases
>>>>> which is taking some time.
>>>>> Should I send patch for RM case only?​ I will try to complete test
>>>>> cases by today eod.
>>>>>
>>>>
>>>> Yes please.
>>>>
>>>> Thanks!
>>>>
>>>> --
>>>> Dave Page
>>>> Blog: http://pgsnake.blogspot.com
>>>> Twitter: @pgsnake
>>>>
>>>> EnterpriseDB UK: http://www.enterprisedb.com
>>>> The Enterprise PostgreSQL Company
>>>>
>>>
>>>
>>
>>
>> --
>> Dave Page
>> Blog: http://pgsnake.blogspot.com
>> Twitter: @pgsnake
>>
>> EnterpriseDB UK: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>>
>
>
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>


RM_2257_v4.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] [pgAdmin4][Patch][RM2257]: Query tool - Insert row doesn't use default values

2017-05-10 Thread Surinder Kumar
Hi Dave,

Please find attached patch for Feature test cases for RM_2257

*Implementation detail:*

 - Added a test_data.json file which contains Insert and Update test
related input data

 - First of all, we create three tables such as
 a) defaults_text
 b) defaults_boolean
 c) defaults_number
 d) defaults_json
 These tables has columns with different constraints (default value,
not_null etc) to test with various input test data.

- Test cases for insert are executed first and then test cases for update.

Please review the patch.


On Wed, May 10, 2017 at 2:22 PM, Surinder Kumar <
surinder.ku...@enterprisedb.com> wrote:

> Hi Dave,
>
> Please find attached patch for RM only.
>
> *Changes:*
>
>  - All formatters now handles both [null] and [default] values
>
>  - the cell values are validated on server side as in pgAdmin3.
>
>  - added light grey color for cells with [null] and [default] placeholders.
>
> On Wed, May 10, 2017 at 2:12 PM, Dave Page <dp...@pgadmin.org> wrote:
>
>>
>>
>> On Wed, May 10, 2017 at 9:39 AM, Surinder Kumar <
>> surinder.ku...@enterprisedb.com> wrote:
>>
>>> Hi Dave,
>>>
>>> On Wed, May 10, 2017 at 2:06 PM, Dave Page <dp...@pgadmin.org> wrote:
>>>
>>>> Any chance we can get this wrapped up today Surinder?
>>>>
>>> ​I have fixed RM case, I am currently writing its feature test cases
>>> which is taking some time.
>>> Should I send patch for RM case only?​ I will try to complete test cases
>>> by today eod.
>>>
>>
>> Yes please.
>>
>> Thanks!
>>
>> --
>> Dave Page
>> Blog: http://pgsnake.blogspot.com
>> Twitter: @pgsnake
>>
>> EnterpriseDB UK: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>>
>
>


features_test_cases_RM_2257_v1.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] [pgAdmin4][Patch][RM2257]: Query tool - Insert row doesn't use default values

2017-05-10 Thread Surinder Kumar
Hi Dave,

Please find attached patch for RM only.

*Changes:*

 - All formatters now handles both [null] and [default] values

 - the cell values are validated on server side as in pgAdmin3.

 - added light grey color for cells with [null] and [default] placeholders.

On Wed, May 10, 2017 at 2:12 PM, Dave Page <dp...@pgadmin.org> wrote:

>
>
> On Wed, May 10, 2017 at 9:39 AM, Surinder Kumar <
> surinder.ku...@enterprisedb.com> wrote:
>
>> Hi Dave,
>>
>> On Wed, May 10, 2017 at 2:06 PM, Dave Page <dp...@pgadmin.org> wrote:
>>
>>> Any chance we can get this wrapped up today Surinder?
>>>
>> ​I have fixed RM case, I am currently writing its feature test cases
>> which is taking some time.
>> Should I send patch for RM case only?​ I will try to complete test cases
>> by today eod.
>>
>
> Yes please.
>
> Thanks!
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>


RM_2257_v3.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] [pgAdmin4][Patch][RM2257]: Query tool - Insert row doesn't use default values

2017-05-10 Thread Surinder Kumar
Hi Dave,

On Wed, May 10, 2017 at 2:06 PM, Dave Page <dp...@pgadmin.org> wrote:

> Any chance we can get this wrapped up today Surinder?
>
​I have fixed RM case, I am currently writing its feature test cases which
is taking some time.
Should I send patch for RM case only?​ I will try to complete test cases by
today eod.

>
> On Tue, May 9, 2017 at 11:29 AM, Dave Page <dp...@pgadmin.org> wrote:
>
>>
>>
>> On Tue, May 9, 2017 at 11:03 AM, Surinder Kumar <
>> surinder.ku...@enterprisedb.com> wrote:
>>
>>> Hi Dave,
>>>
>>> On Mon, May 8, 2017 at 4:37 PM, Dave Page <dp...@pgadmin.org> wrote:
>>>
>>>>
>>>>
>>>> On Mon, May 8, 2017 at 11:51 AM, Surinder Kumar <
>>>> surinder.ku...@enterprisedb.com> wrote:
>>>>
>>>>> Hi
>>>>>
>>>>> On Mon, May 8, 2017 at 3:51 PM, Dave Page <dp...@pgadmin.org> wrote:
>>>>>
>>>>>> Hi
>>>>>>
>>>>>> On Mon, May 8, 2017 at 11:13 AM, Surinder Kumar <
>>>>>> surinder.ku...@enterprisedb.com> wrote:
>>>>>>
>>>>>>> Hi Dave,
>>>>>>>
>>>>>>> On Mon, May 8, 2017 at 3:28 PM, Dave Page <dp...@pgadmin.org> wrote:
>>>>>>>
>>>>>>>> Hi
>>>>>>>>
>>>>>>>> On Fri, May 5, 2017 at 12:52 PM, Surinder Kumar <
>>>>>>>> surinder.ku...@enterprisedb.com> wrote:
>>>>>>>>
>>>>>>>>> Hi Dave,
>>>>>>>>>
>>>>>>>>> The support to handle [null] and [default] values is added for
>>>>>>>>> following formatters:
>>>>>>>>>  - JsonFormatter
>>>>>>>>>  - NumbersFormatter
>>>>>>>>>  - CheckmarkFormatter
>>>>>>>>>  - TextFormatter
>>>>>>>>>
>>>>>>>>> Previously when a new row is added, it was not validating each and
>>>>>>>>> every cell for columns with attribute not_null = true.
>>>>>>>>> Introduced a new function validateRow(...) which is called on
>>>>>>>>> adding a new row, it validates each cell with column having
>>>>>>>>> attribute(not_null=true). the corresponding cell will highlighted and 
>>>>>>>>> save
>>>>>>>>> button will be disabled if value is [null].
>>>>>>>>>
>>>>>>>>
>>>>>>>> I'm not sure that behaviour is right. What I now see (given the
>>>>>>>> table below) is that:
>>>>>>>>
>>>>>>>> - If I click in the id field of a new row, it forces me to enter a
>>>>>>>> value or hit escape. Why is it trying to force me? It's a serial 
>>>>>>>> field, so
>>>>>>>> will get a value on save anyway.
>>>>>>>>
>>>>>>> ​Yes, It is because I am validating all cell values after it
>>>>>>> renders. It will reverted back.
>>>>>>>
>>>>>>>>
>>>>>>>> - If I do enter a value in the ID field, focus jumps over all the
>>>>>>>> other fields with either a default or no 'not null' option to the
>>>>>>>> data_no_nulls column. Focus should always go to the next field.
>>>>>>>>
>>>>>>>> I think this addition can just be removed - I'm pretty sure the
>>>>>>>> previous behaviour would have been what we want, with the additional
>>>>>>>> formatters fixed.
>>>>>>>>
>>>>>>> ​But If i remove this addition, the value for column like
>>>>>>> 'data_no_nulls' ​will be set to '' (blank string), then on save its 
>>>>>>> value
>>>>>>> will be validated on the server side and whatever the error message is 
>>>>>>> will
>>>>>>> be returned back (the same behaviour as in pgAdmin3)
>>>>>>>
>>>>>>
>>>>>> Which is fine I think. If you want to leave the validation there,
>>>>>> that's also fine - but, it a) shouldn't require me to press Esc if I 
>>>>>> decide
&

Re: [pgadmin-hackers] [pgAdmin4][Patch][RM2257]: Query tool - Insert row doesn't use default values

2017-05-09 Thread Surinder Kumar
Hi Dave,

On Mon, May 8, 2017 at 4:37 PM, Dave Page <dp...@pgadmin.org> wrote:

>
>
> On Mon, May 8, 2017 at 11:51 AM, Surinder Kumar <
> surinder.ku...@enterprisedb.com> wrote:
>
>> Hi
>>
>> On Mon, May 8, 2017 at 3:51 PM, Dave Page <dp...@pgadmin.org> wrote:
>>
>>> Hi
>>>
>>> On Mon, May 8, 2017 at 11:13 AM, Surinder Kumar <
>>> surinder.ku...@enterprisedb.com> wrote:
>>>
>>>> Hi Dave,
>>>>
>>>> On Mon, May 8, 2017 at 3:28 PM, Dave Page <dp...@pgadmin.org> wrote:
>>>>
>>>>> Hi
>>>>>
>>>>> On Fri, May 5, 2017 at 12:52 PM, Surinder Kumar <
>>>>> surinder.ku...@enterprisedb.com> wrote:
>>>>>
>>>>>> Hi Dave,
>>>>>>
>>>>>> The support to handle [null] and [default] values is added for
>>>>>> following formatters:
>>>>>>  - JsonFormatter
>>>>>>  - NumbersFormatter
>>>>>>  - CheckmarkFormatter
>>>>>>  - TextFormatter
>>>>>>
>>>>>> Previously when a new row is added, it was not validating each and
>>>>>> every cell for columns with attribute not_null = true.
>>>>>> Introduced a new function validateRow(...) which is called on adding
>>>>>> a new row, it validates each cell with column having
>>>>>> attribute(not_null=true). the corresponding cell will highlighted and 
>>>>>> save
>>>>>> button will be disabled if value is [null].
>>>>>>
>>>>>
>>>>> I'm not sure that behaviour is right. What I now see (given the table
>>>>> below) is that:
>>>>>
>>>>> - If I click in the id field of a new row, it forces me to enter a
>>>>> value or hit escape. Why is it trying to force me? It's a serial field, so
>>>>> will get a value on save anyway.
>>>>>
>>>> ​Yes, It is because I am validating all cell values after it renders.
>>>> It will reverted back.
>>>>
>>>>>
>>>>> - If I do enter a value in the ID field, focus jumps over all the
>>>>> other fields with either a default or no 'not null' option to the
>>>>> data_no_nulls column. Focus should always go to the next field.
>>>>>
>>>>> I think this addition can just be removed - I'm pretty sure the
>>>>> previous behaviour would have been what we want, with the additional
>>>>> formatters fixed.
>>>>>
>>>> ​But If i remove this addition, the value for column like
>>>> 'data_no_nulls' ​will be set to '' (blank string), then on save its value
>>>> will be validated on the server side and whatever the error message is will
>>>> be returned back (the same behaviour as in pgAdmin3)
>>>>
>>>
>>> Which is fine I think. If you want to leave the validation there, that's
>>> also fine - but, it a) shouldn't require me to press Esc if I decide not to
>>> fill in that value yet, and b) shouldn't change the tab order of the
>>> fields. It's also broken of course, in that it was trying to force me to
>>> enter a value for a not-null field with a default.
>>>
>> ​Yes, I will check if we just highlight the field and don't force the
>> user to ​enter value.
>> This will enable user to edit any field using TAB key even if required
>> field is highlighted red.
>> Should the save button remains disable untill user enters any valid value
>> in 'data_no_nulls' column ?
>>
>
> I think that's fine, yes - as long as we get the validation right :-)
>
​For highlighting the error field and enable user to navigate to other
cells using TAB key,
I spend some time looking and debugging into the code and found that it
requires lot of changes in slick.grid.js core functions as there are no
event listeners provided to ​listen and changes in core file is not
preferred. It may also break other functionalities as code is quite complex.
So, I think we should validate data on server side and display any error
messages on UI.

>
>>>
>>
>>>>>
>>>>>>
>>>>>> Now I will add more feature test cases for remaining formatters. Will
>>>>>> send separate patch for feature test cases once completed.
>>>>>>
>>>>>
>>>>> Thanks.
>>>>>
>>>>>
&g

Re: [pgadmin-hackers] [pgAdmin4][Patch][RM2257]: Query tool - Insert row doesn't use default values

2017-05-08 Thread Surinder Kumar
Hi

On Mon, May 8, 2017 at 3:51 PM, Dave Page <dp...@pgadmin.org> wrote:

> Hi
>
> On Mon, May 8, 2017 at 11:13 AM, Surinder Kumar <
> surinder.ku...@enterprisedb.com> wrote:
>
>> Hi Dave,
>>
>> On Mon, May 8, 2017 at 3:28 PM, Dave Page <dp...@pgadmin.org> wrote:
>>
>>> Hi
>>>
>>> On Fri, May 5, 2017 at 12:52 PM, Surinder Kumar <
>>> surinder.ku...@enterprisedb.com> wrote:
>>>
>>>> Hi Dave,
>>>>
>>>> The support to handle [null] and [default] values is added for
>>>> following formatters:
>>>>  - JsonFormatter
>>>>  - NumbersFormatter
>>>>  - CheckmarkFormatter
>>>>  - TextFormatter
>>>>
>>>> Previously when a new row is added, it was not validating each and
>>>> every cell for columns with attribute not_null = true.
>>>> Introduced a new function validateRow(...) which is called on adding a
>>>> new row, it validates each cell with column having
>>>> attribute(not_null=true). the corresponding cell will highlighted and save
>>>> button will be disabled if value is [null].
>>>>
>>>
>>> I'm not sure that behaviour is right. What I now see (given the table
>>> below) is that:
>>>
>>> - If I click in the id field of a new row, it forces me to enter a value
>>> or hit escape. Why is it trying to force me? It's a serial field, so will
>>> get a value on save anyway.
>>>
>> ​Yes, It is because I am validating all cell values after it renders. It
>> will reverted back.
>>
>>>
>>> - If I do enter a value in the ID field, focus jumps over all the other
>>> fields with either a default or no 'not null' option to the data_no_nulls
>>> column. Focus should always go to the next field.
>>>
>>> I think this addition can just be removed - I'm pretty sure the previous
>>> behaviour would have been what we want, with the additional formatters
>>> fixed.
>>>
>> ​But If i remove this addition, the value for column like 'data_no_nulls'
>> ​will be set to '' (blank string), then on save its value will be validated
>> on the server side and whatever the error message is will be returned back
>> (the same behaviour as in pgAdmin3)
>>
>
> Which is fine I think. If you want to leave the validation there, that's
> also fine - but, it a) shouldn't require me to press Esc if I decide not to
> fill in that value yet, and b) shouldn't change the tab order of the
> fields. It's also broken of course, in that it was trying to force me to
> enter a value for a not-null field with a default.
>
​Yes, I will check if we just highlight the field and don't force the user
to ​enter value.
This will enable user to edit any field using TAB key even if required
field is highlighted red.
Should the save button remains disable untill user enters any valid value
in 'data_no_nulls' column ?

>
>

>>>
>>>>
>>>> Now I will add more feature test cases for remaining formatters. Will
>>>> send separate patch for feature test cases once completed.
>>>>
>>>
>>> Thanks.
>>>
>>>
>>>>
>>>> Please review updated patch.
>>>>
>>>>
>>>> On Tue, May 2, 2017 at 5:57 PM, Surinder Kumar <
>>>> surinder.ku...@enterprisedb.com> wrote:
>>>>
>>>>> Hi Dave,
>>>>>
>>>>> On Tue, May 2, 2017 at 5:21 PM, Dave Page <dp...@pgadmin.org> wrote:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> This is looking much better now :-). Couple of thoughts and a bug:
>>>>>>
>>>>>> - Only the TextFormatter seems to handle both [null] and [default]
>>>>>> values. Shouldn't all formatters do so (including Json and Checkmark)?
>>>>>>
>>>>> ​Yes, I will apply the same changes for other formatters too.​
>>>>>
>>>>>> For example, "serial" columns currently get displayed as [null] when
>>>>>> left blank, but I would expect to see [default].
>>>>>>
>>>>>> - I would suggest we put [null] and [default] in a lighter colour -
>>>>>> #99.
>>>>>>
>>>>>> - With the feature test patch added, I seem to be consistently
>>>>>> getting the following failure (immediately after your new tests run):
>>>>>>
>>>>>&

Re: [pgadmin-hackers] [pgAdmin4][Patch][RM2257]: Query tool - Insert row doesn't use default values

2017-05-08 Thread Surinder Kumar
Hi Dave,

On Mon, May 8, 2017 at 3:28 PM, Dave Page <dp...@pgadmin.org> wrote:

> Hi
>
> On Fri, May 5, 2017 at 12:52 PM, Surinder Kumar <
> surinder.ku...@enterprisedb.com> wrote:
>
>> Hi Dave,
>>
>> The support to handle [null] and [default] values is added for following
>> formatters:
>>  - JsonFormatter
>>  - NumbersFormatter
>>  - CheckmarkFormatter
>>  - TextFormatter
>>
>> Previously when a new row is added, it was not validating each and every
>> cell for columns with attribute not_null = true.
>> Introduced a new function validateRow(...) which is called on adding a
>> new row, it validates each cell with column having
>> attribute(not_null=true). the corresponding cell will highlighted and save
>> button will be disabled if value is [null].
>>
>
> I'm not sure that behaviour is right. What I now see (given the table
> below) is that:
>
> - If I click in the id field of a new row, it forces me to enter a value
> or hit escape. Why is it trying to force me? It's a serial field, so will
> get a value on save anyway.
>
​Yes, It is because I am validating all cell values after it renders. It
will reverted back.

>
> - If I do enter a value in the ID field, focus jumps over all the other
> fields with either a default or no 'not null' option to the data_no_nulls
> column. Focus should always go to the next field.
>
> I think this addition can just be removed - I'm pretty sure the previous
> behaviour would have been what we want, with the additional formatters
> fixed.
>
​But If i remove this addition, the value for column like 'data_no_nulls'
​will be set to '' (blank string), then on save its value will be validated
on the server side and whatever the error message is will be returned back
(the same behaviour as in pgAdmin3)

>
>
>>
>> Now I will add more feature test cases for remaining formatters. Will
>> send separate patch for feature test cases once completed.
>>
>
> Thanks.
>
>
>>
>> Please review updated patch.
>>
>>
>> On Tue, May 2, 2017 at 5:57 PM, Surinder Kumar <
>> surinder.ku...@enterprisedb.com> wrote:
>>
>>> Hi Dave,
>>>
>>> On Tue, May 2, 2017 at 5:21 PM, Dave Page <dp...@pgadmin.org> wrote:
>>>
>>>> Hi,
>>>>
>>>> This is looking much better now :-). Couple of thoughts and a bug:
>>>>
>>>> - Only the TextFormatter seems to handle both [null] and [default]
>>>> values. Shouldn't all formatters do so (including Json and Checkmark)?
>>>>
>>> ​Yes, I will apply the same changes for other formatters too.​
>>>
>>>> For example, "serial" columns currently get displayed as [null] when
>>>> left blank, but I would expect to see [default].
>>>>
>>>> - I would suggest we put [null] and [default] in a lighter colour -
>>>> #99.
>>>>
>>>> - With the feature test patch added, I seem to be consistently getting
>>>> the following failure (immediately after your new tests run):
>>>>
>>>> ==
>>>> ERROR: runTest (pgadmin.feature_tests.xss_che
>>>> cks_panels_and_query_tool_test.CheckForXssFeatureTest)
>>>> Test XSS check for panels and query tool
>>>> --
>>>> Traceback (most recent call last):
>>>>   File 
>>>> "/Users/dpage/git/pgadmin4/web/regression/feature_utils/base_feature_test.py",
>>>> line 42, in setUp
>>>> self._screenshot()
>>>>   File 
>>>> "/Users/dpage/git/pgadmin4/web/regression/feature_utils/base_feature_test.py",
>>>> line 92, in _screenshot
>>>> python_version))
>>>>   File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packa
>>>> ges/selenium/webdriver/remote/webdriver.py", line 802, in
>>>> get_screenshot_as_file
>>>> png = self.get_screenshot_as_png()
>>>>   File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packa
>>>> ges/selenium/webdriver/remote/webdriver.py", line 821, in
>>>> get_screenshot_as_png
>>>> return base64.b64decode(self.get_screenshot_as_base64().encode('asc
>>>> ii'))
>>>>   File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packa
>>>> ges/selenium/webdriver/remote/we

Re: [pgadmin-hackers] [pgAdmin4][Patch][RM2257]: Query tool - Insert row doesn't use default values

2017-05-05 Thread Surinder Kumar
Hi Dave,

The support to handle [null] and [default] values is added for following
formatters:
 - JsonFormatter
 - NumbersFormatter
 - CheckmarkFormatter
 - TextFormatter

Previously when a new row is added, it was not validating each and every
cell for columns with attribute not_null = true.
Introduced a new function validateRow(...) which is called on adding a new
row, it validates each cell with column having attribute(not_null=true).
the corresponding cell will highlighted and save button will be disabled if
value is [null].

Now I will add more feature test cases for remaining formatters. Will send
separate patch for feature test cases once completed.

Please review updated patch.


On Tue, May 2, 2017 at 5:57 PM, Surinder Kumar <
surinder.ku...@enterprisedb.com> wrote:

> Hi Dave,
>
> On Tue, May 2, 2017 at 5:21 PM, Dave Page <dp...@pgadmin.org> wrote:
>
>> Hi,
>>
>> This is looking much better now :-). Couple of thoughts and a bug:
>>
>> - Only the TextFormatter seems to handle both [null] and [default]
>> values. Shouldn't all formatters do so (including Json and Checkmark)?
>>
> ​Yes, I will apply the same changes for other formatters too.​
>
>> For example, "serial" columns currently get displayed as [null] when left
>> blank, but I would expect to see [default].
>>
>> - I would suggest we put [null] and [default] in a lighter colour -
>> #99.
>>
>> - With the feature test patch added, I seem to be consistently getting
>> the following failure (immediately after your new tests run):
>>
>> ==
>> ERROR: runTest (pgadmin.feature_tests.xss_che
>> cks_panels_and_query_tool_test.CheckForXssFeatureTest)
>> Test XSS check for panels and query tool
>> --
>> Traceback (most recent call last):
>>   File 
>> "/Users/dpage/git/pgadmin4/web/regression/feature_utils/base_feature_test.py",
>> line 42, in setUp
>> self._screenshot()
>>   File 
>> "/Users/dpage/git/pgadmin4/web/regression/feature_utils/base_feature_test.py",
>> line 92, in _screenshot
>> python_version))
>>   File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packa
>> ges/selenium/webdriver/remote/webdriver.py", line 802, in
>> get_screenshot_as_file
>> png = self.get_screenshot_as_png()
>>   File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packa
>> ges/selenium/webdriver/remote/webdriver.py", line 821, in
>> get_screenshot_as_png
>> return base64.b64decode(self.get_screenshot_as_base64().encode('
>> ascii'))
>>   File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packa
>> ges/selenium/webdriver/remote/webdriver.py", line 831, in
>> get_screenshot_as_base64
>> return self.execute(Command.SCREENSHOT)['value']
>>   File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packa
>> ges/selenium/webdriver/remote/webdriver.py", line 238, in execute
>> self.error_handler.check_response(response)
>>   File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packa
>> ges/selenium/webdriver/remote/errorhandler.py", line 193, in
>> check_response
>> raise exception_class(message, screen, stacktrace)
>> UnexpectedAlertPresentException: Alert Text: None
>> Message: unexpected alert open: {Alert text : Are you sure you wish to
>> close the pgAdmin 4 browser?}
>>   (Session info: chrome=58.0.3029.81)
>>   (Driver info: chromedriver=2.29.461585 
>> (0be2cd95f834e9ee7c46bcc7cf405b483f5ae83b),platform=Mac
>> OS X 10.12.3 x86_64)
>>
>>
>> ==
>> ERROR: runTest (pgadmin.feature_tests.xss_che
>> cks_pgadmin_debugger_test.CheckDebuggerForXssFeatureTest)
>> Test table DDL generation
>> --
>> Traceback (most recent call last):
>>   File 
>> "/Users/dpage/git/pgadmin4/web/regression/feature_utils/base_feature_test.py",
>> line 42, in setUp
>> self._screenshot()
>>   File 
>> "/Users/dpage/git/pgadmin4/web/regression/feature_utils/base_feature_test.py",
>> line 92, in _screenshot
>> python_version))
>>   File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packa
>> ges/selenium/webdriver/remote/webdriver.py", line 802, in
>> get_screenshot_as_file
>> png = self.get_screenshot_as_png()
>>   File "/Users/dpage/.virtuale

Re: [pgadmin-hackers] [pgAdmin4][Patch][RM2257]: Query tool - Insert row doesn't use default values

2017-05-02 Thread Surinder Kumar
Hi Dave,

On Tue, May 2, 2017 at 5:21 PM, Dave Page <dp...@pgadmin.org> wrote:

> Hi,
>
> This is looking much better now :-). Couple of thoughts and a bug:
>
> - Only the TextFormatter seems to handle both [null] and [default] values.
> Shouldn't all formatters do so (including Json and Checkmark)?
>
​Yes, I will apply the same changes for other formatters too.​

> For example, "serial" columns currently get displayed as [null] when left
> blank, but I would expect to see [default].
>
> - I would suggest we put [null] and [default] in a lighter colour -
> #99.
>
> - With the feature test patch added, I seem to be consistently getting the
> following failure (immediately after your new tests run):
>
> ==
> ERROR: runTest (pgadmin.feature_tests.xss_checks_panels_and_query_tool_
> test.CheckForXssFeatureTest)
> Test XSS check for panels and query tool
> --
> Traceback (most recent call last):
>   File 
> "/Users/dpage/git/pgadmin4/web/regression/feature_utils/base_feature_test.py",
> line 42, in setUp
> self._screenshot()
>   File 
> "/Users/dpage/git/pgadmin4/web/regression/feature_utils/base_feature_test.py",
> line 92, in _screenshot
> python_version))
>   File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-
> packages/selenium/webdriver/remote/webdriver.py", line 802, in
> get_screenshot_as_file
> png = self.get_screenshot_as_png()
>   File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-
> packages/selenium/webdriver/remote/webdriver.py", line 821, in
> get_screenshot_as_png
> return base64.b64decode(self.get_screenshot_as_base64().encode(
> 'ascii'))
>   File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-
> packages/selenium/webdriver/remote/webdriver.py", line 831, in
> get_screenshot_as_base64
> return self.execute(Command.SCREENSHOT)['value']
>   File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-
> packages/selenium/webdriver/remote/webdriver.py", line 238, in execute
> self.error_handler.check_response(response)
>   File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-
> packages/selenium/webdriver/remote/errorhandler.py", line 193, in
> check_response
> raise exception_class(message, screen, stacktrace)
> UnexpectedAlertPresentException: Alert Text: None
> Message: unexpected alert open: {Alert text : Are you sure you wish to
> close the pgAdmin 4 browser?}
>   (Session info: chrome=58.0.3029.81)
>   (Driver info: chromedriver=2.29.461585 
> (0be2cd95f834e9ee7c46bcc7cf405b483f5ae83b),platform=Mac
> OS X 10.12.3 x86_64)
>
>
> ==
> ERROR: runTest (pgadmin.feature_tests.xss_checks_pgadmin_debugger_test.
> CheckDebuggerForXssFeatureTest)
> Test table DDL generation
> --
> Traceback (most recent call last):
>   File 
> "/Users/dpage/git/pgadmin4/web/regression/feature_utils/base_feature_test.py",
> line 42, in setUp
> self._screenshot()
>   File 
> "/Users/dpage/git/pgadmin4/web/regression/feature_utils/base_feature_test.py",
> line 92, in _screenshot
> python_version))
>   File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-
> packages/selenium/webdriver/remote/webdriver.py", line 802, in
> get_screenshot_as_file
> png = self.get_screenshot_as_png()
>   File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-
> packages/selenium/webdriver/remote/webdriver.py", line 821, in
> get_screenshot_as_png
> return base64.b64decode(self.get_screenshot_as_base64().encode(
> 'ascii'))
>   File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-
> packages/selenium/webdriver/remote/webdriver.py", line 831, in
> get_screenshot_as_base64
> return self.execute(Command.SCREENSHOT)['value']
>   File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-
> packages/selenium/webdriver/remote/webdriver.py", line 238, in execute
> self.error_handler.check_response(response)
>   File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-
> packages/selenium/webdriver/remote/errorhandler.py", line 193, in
> check_response
> raise exception_class(message, screen, stacktrace)
> UnexpectedAlertPresentException: Alert Text: None
> Message: unexpected alert open: {Alert text : Are you sure you wish to
> close the pgAdmin 4 browser?}
>   (Session info: chrome=58.0.3029.81)
>   (Driver info: c

[pgadmin-hackers] [pgAdmin4][Patch]: Delete row server error not shown to GUI user

2017-04-28 Thread Surinder Kumar
Hi

The variable list_of_rowid doesn't keep track of rows to be deleted.
If this list is empty simply return 0 since '_rowid' is being used to
highlight the row for which error is occurred in only insert and update
operation.

Please find attached patch and review.

Thanks,
Surinder Kumar


RM_2356.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] [pgAdmin4][Patch][RM2257]: Query tool - Insert row doesn't use default values

2017-04-28 Thread Surinder Kumar
Hi Dave,

Please find updated patch for RM case and a separate patch for Feature
tests.

*Python:*

- Added [default] label for cells with default values while inserting a new
row.

- Introduced a FieldValidator function for cells that don't allow null
values. If user tries to insert null value, field with be highlighted with
redborders around.

​-
If a cell contains blank string('') and when we set it to null, the change
into the cell is not detected. It was because the comparison
for (defaultValue == null) return true if defaultValue is undefined. Hence
_.isNull(value) is used to fix this.

*Feature Test cases:*

 - Introduced a new method create_table_with_query(server, db_name, query)
in test_utils.py which executes the given query on connected server.

 - Added a new file test_data.json that has test data for test cases.


On Fri, Apr 7, 2017 at 2:21 PM, Dave Page <dp...@pgadmin.org> wrote:

> Hi
>
> On Sat, Apr 1, 2017 at 12:45 PM, Surinder Kumar
> <surinder.ku...@enterprisedb.com> wrote:
> > Hi
> >
> > Issues fixed:
> >
> > 1. If a column is defined with a default modifier, there is now way to
> > insert the row with those defaults.
> > The column will be left blank and it will take default value
> automatically.
> >
> > 2. If a column has a not-null constraint then an error is returned and
> the
> > row is not inserted.
> > The column will be left blank
> >
> > The default values for new added rows will be displayed on
> refresh/execute.
> >
> > Please find attached patch and review.
>
> This largely works as expected, but there is some weirdness. I have a
> test table that looks like this:
>
> CREATE TABLE public.defaults
> (
> id bigint NOT NULL DEFAULT nextval('defaults_id_seq'::regclass),
> data_default_nulls text COLLATE pg_catalog."default" DEFAULT
> 'abc123'::text,
> data_default_no_nulls text COLLATE pg_catalog."default" NOT NULL
> DEFAULT 'def456'::text,
> data_nulls text COLLATE pg_catalog."default",
> data_no_nulls text COLLATE pg_catalog."default" NOT NULL,
> CONSTRAINT defaults_pkey PRIMARY KEY (id)
> )
>
> Remember that the expected behaviour is:
>
> - Set a value to empty to update the column to null.
> - Set a value to '' to update the column to an empty string
> - Set a value to anything else to update the column to that value
>
> 1) In a row with values in each column, if I try to set the value of
> data_default_nulls to null, the query executed is:
>
> UPDATE public.defaults SET
> data_default_nulls = '' WHERE
> id = '2';
>
> 2) If I do the same in the data_nulls column, the value is immediately
> shown as [null] and the query executed is:
>
> UPDATE public.defaults SET
> data_nulls = NULL WHERE
> id = '2';
>
> 3) If I then edit the value in data_default_nulls, it shows the
> current value as ''. Removing the quotes (to set it to null) doesn't
> get detected as a change.
>
​​Taken care.

>
> 4) When I manually executed "update defaults set data_default_nulls =
> null where id = 2" in a query tool window, I got:
>
> 2017-04-07 09:43:02,987: INFO werkzeug: 127.0.0.1 - - [07/Apr/2017
> 09:43:02] "GET /sqleditor/columns/8745675 HTTP/1.1" 500 -
> Traceback (most recent call last):
>   File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-
> packages/flask/app.py",
> line 2000, in __call__
> return self.wsgi_app(environ, start_response)
>   File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-
> packages/flask/app.py",
> line 1991, in wsgi_app
> response = self.make_response(self.handle_exception(e))
>   File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-
> packages/flask/app.py",
> line 1567, in handle_exception
> reraise(exc_type, exc_value, tb)
>   File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-
> packages/flask/app.py",
> line 1988, in wsgi_app
> response = self.full_dispatch_request()
>   File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-
> packages/flask/app.py",
> line 1641, in full_dispatch_request
> rv = self.handle_user_exception(e)
>   File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-
> packages/flask/app.py",
> line 1544, in handle_user_exception
> reraise(exc_type, exc_value, tb)
>   File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-
> packages/flask/app.py",
> line 1639, in full_dispatch_request
> rv = self.dispatch_request()
>   File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-
> packages/flask/app.py",
> line 1625, in dispatch_request
>

Re: [pgadmin-hackers] [pgAdmin4][Patch]: RM#2333 - Server Activity data is not updating when server is disconnected in Dashboards

2017-04-12 Thread Surinder Kumar
Hi Dave,

Please find rebased patch.

On Wed, Apr 12, 2017 at 5:44 PM, Dave Page <dp...@pgadmin.org> wrote:

> Can you rebase this please?
>
> On Tue, Apr 11, 2017 at 1:23 PM, Surinder Kumar
> <surinder.ku...@enterprisedb.com> wrote:
> > Hi Dave,
> >
> > On Tue, Apr 11, 2017 at 4:28 PM, Dave Page <dp...@pgadmin.org> wrote:
> >>
> >> On Tue, Apr 11, 2017 at 10:51 AM, Surinder Kumar
> >> <surinder.ku...@enterprisedb.com> wrote:
> >> > Hi
> >> >
> >> > When a server is disconnected, listen to
> >> > 'pgadmin:server:disconnect'event
> >> > and trigger refresh button of Server Activity data.
> >>
> >> I don't see any reason to do that - it's not auto-refreshed data, so
> >> why clear it?
> >
> > Hmm. i agree.
> >>
> >>
> >> > Also, on server disconnect, an unused event 'server-disconnected' is
> >> > being
> >> > triggered.
> >> > instead it should trigger ''pgadmin:server:disconnect'event.
> >
> > Please find attached patch for same.
> >>
> >>
> >> Please submit that as a separate cleanup patch.
> >>
> >> Thanks.
> >>
> >> --
> >> Dave Page
> >> Blog: http://pgsnake.blogspot.com
> >> Twitter: @pgsnake
> >>
> >> EnterpriseDB UK: http://www.enterprisedb.com
> >> The Enterprise PostgreSQL Company
> >
> >
>
>
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>


cleanup_server_js_v1.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] [pgAdmin4][Patch]: RM#2333 - Server Activity data is not updating when server is disconnected in Dashboards

2017-04-11 Thread Surinder Kumar
Hi Dave,

On Tue, Apr 11, 2017 at 4:28 PM, Dave Page <dp...@pgadmin.org> wrote:

> On Tue, Apr 11, 2017 at 10:51 AM, Surinder Kumar
> <surinder.ku...@enterprisedb.com> wrote:
> > Hi
> >
> > When a server is disconnected, listen to 'pgadmin:server:disconnect'
> event
> > and trigger refresh button of Server Activity data.
>
> I don't see any reason to do that - it's not auto-refreshed data, so
> why clear it?
>
​Hmm. i agree.​

>
> > Also, on server disconnect, an unused event 'server-disconnected' is
> being
> > triggered.
> > instead it should trigger ''pgadmin:server:disconnect'event.
>
​Please find attached patch for same.​

>
> Please submit that as a separate cleanup patch.
>
> Thanks.
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>


cleanup_server_js.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


[pgadmin-hackers] [pgAdmin4][Patch]: RM#2333 - Server Activity data is not updating when server is disconnected in Dashboards

2017-04-11 Thread Surinder Kumar
Hi

When a server is disconnected, listen to 'pgadmin:server:disconnect'event
and trigger refresh button of Server Activity data.

Also, on server disconnect, an unused event 'server-disconnected' is being
triggered.
instead it should trigger ''pgadmin:server:disconnect'event.

Please find attached patch and review.

Thanks,
Surinder Kumar


RM_2333.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


[pgadmin-hackers] [pgAdmin4][Patch][RM2257]: Query tool - Insert row doesn't use default values

2017-04-01 Thread Surinder Kumar
Hi

Issues fixed:

1. If a column is defined with a default modifier, there is now way to
insert the row with those defaults.
The column will be left blank and it will take default value automatically.

2. If a column has a not-null constraint then an error is returned and the
row is not inserted.
The column will be left blank
​ ​

​The default values for new added rows will be displayed on refresh/execute.

Please find attached patch and review.


Thanks
Surinder


RM_2257.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


[pgadmin-hackers] [pgAdmin4][Patch]: RM#2205 - Indeterminate state for [null] values in boolean type cell doesn't show up

2017-02-24 Thread Surinder Kumar
Hi

While looking into issue 2199 <https://redmine.postgresql.org/issues/2199>,
I found while performing select query in query tool, the checkbox
indeterminate state doesn't show up for [null] value on double click.

Please find attached patch and review.

Thanks
Surinder Kumar


RM2205.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] [pgAdmin4][Patch]: RM2039 - Big (numeric) numbers are sometimes rounded up when displayed

2017-02-24 Thread Surinder Kumar
Hi Dave,

Please find updated patch.

*Changes:*

1) Add typecaster for numeric and double precision.

2) As numeric data is typecasted into string type, we need not to do
parseInt value in javascript.

3) Remove redundant code for registering new types.


On Mon, Jan 9, 2017 at 9:11 AM, Dave Page <dp...@pgadmin.org> wrote:

> Hi
>
> On Friday, December 23, 2016, Surinder Kumar <
> surinder.ku...@enterprisedb.com> wrote:
>
>> Hi,
>>
>> Added 'numeric' type into string typecaster to prevent python from
>> rounded up.
>>
>> Please find attached patch and review.
>>
>
> I'm still seeing rounding with this patch applied - e.g. with:
>
> select 12345678901234567890::numeric
>
> Something in the JS perhaps?
>
>
>


RM2039_v2.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


[pgadmin-hackers] [pgAdmin4][Patch]: Expanded columns under table are in the wrong order

2017-02-24 Thread Surinder Kumar
Hi,

The sorting for the object types 'column' and 'catalog_object_column' is
not required as their columns need to display as per their order of
creation.
For other nodes sorting will work.

Please find attached patch and review.

Thanks,
Surinder Kumar


RM_2185.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


[pgadmin-hackers] [pgAdmin4][Patch]: RM2115 - Wrong SQL displayed for exclusion constraints with gist method

2017-02-10 Thread Surinder Kumar
Hi

The Macro template was referring to the old code that's why it generates
wrong sql.
Now the changes made in RM1840 are incorporated into macro template as well.

Please find attached patch.

Thanks
Surinder Kumar


RM2115.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


[pgadmin-hackers] [pgAdmin4][Patch]: Fixes RM2126 - Duplicate values displayed for functions and procedures in Preferences

2017-02-10 Thread Surinder Kumar
Hi

*Issue:* The function and procedure nodes displayed under schema nodes and
packages node, so both were sharing same name.

*Solution:*
Overrides the *register_preferences* method for *EdbFuncModule* and
*EdbProcModule* class and update their labels.

Please find attached patch and review.

Thanks
Surinder Kumar


RM2126.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] [pgAdmin4][Patch]: Fix RM1790 - [Web] Support setting a field's value to "null"

2017-02-04 Thread Surinder Kumar
Hi Dave,

I have overriden the checkbox editor to add 'indeterminate' state of
checkbox other than checked and unchecked which gives the user capability
to set [null] value
for boolean types.

Please find updated patch and review.

On Sat, Feb 4, 2017 at 6:47 PM, Dave Page <dp...@pgadmin.org> wrote:

> BTW, this may help: https://css-tricks.com/indeterminate-checkboxes/

​That's actually the solution. It works.
Thanks.​

>
>
> On Sat, Feb 4, 2017 at 1:15 PM, Dave Page <dp...@pgadmin.org> wrote:
> > Hi,
> >
> > This seems to work nicely now for text and int fields etc. but you
> > haven't handled booleans. They should have a 3 state checkbox in edit
> > mode (checked == true, clear == false, blurred == null (see pgAdmin
> > 3).
> >
> > I've committed the patch, but can you please get me an additional one
> > for boolean support for Monday morning my time please?
>
​Thanks.​

> >
> > Thanks!
> >
> > On Sat, Feb 4, 2017 at 5:34 AM, Surinder Kumar
> > <surinder.ku...@enterprisedb.com> wrote:
> >> Hi Dave,
> >>
> >> Please find updated patch and review.
> >>
> >> On Fri, Feb 3, 2017 at 2:43 PM, Dave Page <dp...@pgadmin.org> wrote:
> >>>
> >>> On Fri, Feb 3, 2017 at 7:28 AM, Surinder Kumar
> >>> <surinder.ku...@enterprisedb.com> wrote:
> >>> > Hi Dave,
> >>> >
> >>> > On Mon, Jan 30, 2017 at 6:18 PM, Dave Page <dp...@pgadmin.org>
> wrote:
> >>> >>
> >>> >> On Fri, Jan 27, 2017 at 10:32 AM, Surinder Kumar
> >>> >> <surinder.ku...@enterprisedb.com> wrote:
> >>> >> > Hi Dave,
> >>> >> >
> >>> >> > Please find updated patch.
> >>> >> >
> >>> >> > On Mon, Jan 16, 2017 at 10:01 PM, Dave Page <dp...@pgadmin.org>
> >>> >> > wrote:
> >>> >> >>
> >>> >> >> Hi
> >>> >> >>
> >>> >> >> On Fri, Jan 13, 2017 at 9:24 AM, Surinder Kumar
> >>> >> >> <surinder.ku...@enterprisedb.com> wrote:
> >>> >> >> > Hi
> >>> >> >> >
> >>> >> >> > Please find attached patch and review.
> >>> >> >> >
> >>> >> >> > On Sun, Jan 8, 2017 at 3:27 PM, Dave Page <dp...@pgadmin.org>
> >>> >> >> > wrote:
> >>> >> >> >>
> >>> >> >> >> Hi
> >>> >> >> >>
> >>> >> >> >> On Friday, December 23, 2016, Surinder Kumar
> >>> >> >> >> <surinder.ku...@enterprisedb.com> wrote:
> >>> >> >> >>>
> >>> >> >> >>> Forgot to attach patch in last thread. please find patch.
> >>> >> >> >>
> >>> >> >> >>
> >>> >> >> >> It looks good for the most part, except:
> >>> >> >> >>
> >>> >> >> >> 1) You missed the part we discussed about being able to set a
> >>> >> >> >> value
> >>> >> >> >> to
> >>> >> >> >> ''
> >>> >> >> >> (the literal string containing two single quotes) by entering
> >>> >> >> >> \'\'
> >>> >> >> >> (and
> >>> >> >> >> of
> >>> >> >> >> course, the follow-on cases to allow setting a value to \'\'
> by
> >>> >> >> >> entering
> >>> >> >> >> \\'\\' etc).
> >>> >> >> >
> >>> >> >> > Fixed.
> >>> >> >>
> >>> >> >> That doesn't seem right to me - the code you've written looks
> like
> >>> >> >> it'll try to escape anything for use in a string literal, not
> just
> >>> >> >> '\'\ or \\'\\' etc.
> >>> >> >
> >>> >> > Now the implementation is that It will find and unescape the
> string
> >>> >> > literals
> >>> >> > like '\'\ or \\'\\' etc.
> >>> >>
> >>> >> I ran some tests:
> >>> >>
> >>> >> - Setting a field to '' resulted in the following SQL:
> >&

Re: [pgadmin-hackers] [pgAdmin4][Patch]: Fix RM1790 - [Web] Support setting a field's value to "null"

2017-02-03 Thread Surinder Kumar
Hi Dave,

Please find updated patch and review.

On Fri, Feb 3, 2017 at 2:43 PM, Dave Page <dp...@pgadmin.org> wrote:

> On Fri, Feb 3, 2017 at 7:28 AM, Surinder Kumar
> <surinder.ku...@enterprisedb.com> wrote:
> > Hi Dave,
> >
> > On Mon, Jan 30, 2017 at 6:18 PM, Dave Page <dp...@pgadmin.org> wrote:
> >>
> >> On Fri, Jan 27, 2017 at 10:32 AM, Surinder Kumar
> >> <surinder.ku...@enterprisedb.com> wrote:
> >> > Hi Dave,
> >> >
> >> > Please find updated patch.
> >> >
> >> > On Mon, Jan 16, 2017 at 10:01 PM, Dave Page <dp...@pgadmin.org>
> wrote:
> >> >>
> >> >> Hi
> >> >>
> >> >> On Fri, Jan 13, 2017 at 9:24 AM, Surinder Kumar
> >> >> <surinder.ku...@enterprisedb.com> wrote:
> >> >> > Hi
> >> >> >
> >> >> > Please find attached patch and review.
> >> >> >
> >> >> > On Sun, Jan 8, 2017 at 3:27 PM, Dave Page <dp...@pgadmin.org>
> wrote:
> >> >> >>
> >> >> >> Hi
> >> >> >>
> >> >> >> On Friday, December 23, 2016, Surinder Kumar
> >> >> >> <surinder.ku...@enterprisedb.com> wrote:
> >> >> >>>
> >> >> >>> Forgot to attach patch in last thread. please find patch.
> >> >> >>
> >> >> >>
> >> >> >> It looks good for the most part, except:
> >> >> >>
> >> >> >> 1) You missed the part we discussed about being able to set a
> value
> >> >> >> to
> >> >> >> ''
> >> >> >> (the literal string containing two single quotes) by entering \'\'
> >> >> >> (and
> >> >> >> of
> >> >> >> course, the follow-on cases to allow setting a value to \'\' by
> >> >> >> entering
> >> >> >> \\'\\' etc).
> >> >> >
> >> >> > Fixed.
> >> >>
> >> >> That doesn't seem right to me - the code you've written looks like
> >> >> it'll try to escape anything for use in a string literal, not just
> >> >> '\'\ or \\'\\' etc.
> >> >
> >> > Now the implementation is that It will find and unescape the string
> >> > literals
> >> > like '\'\ or \\'\\' etc.
> >>
> >> I ran some tests:
> >>
> >> - Setting a field to '' resulted in the following SQL:
> >>
> >> UPDATE public.emp SET
> >> job = '' WHERE
> >> empno = 7369;
> >>
> >> - Setting a field to \"\" resulted in the following SQL:
> >>
> >> UPDATE public.emp SET
> >> job = '""' WHERE
> >> empno = 7499;
> >>
> >> - Setting a field to \'\' displayed \'\' in the grid until refreshed
> >> when the value vanished. The SQL it ran was:
> >
> > In current behaviour, we are saving the value provided by user and we are
> > not refreshing the grid with new values.
> > Should we do refresh along with save?
>
> Why would you save the value provided? The point is to escape the
> quotes with the slashes - i.e. to store the literal string '' (two
> single quotes), the user enters \'\' (because entering just two single
> quotes is how we enter an empty string).
>
​Implemented accordingly.​ I have tested all cases you provided and they
are working.
If there is still anything not working. Please let me know. I will fix.

>
> I'm not sure why this is so hard - the original request was to make it
> work like pgAdmin III. That's well defined and documented behaviour -
> I even copied/pasted the description from the docs on this thread.
>
> >>
> >> UPDATE public.emp SET
> >> job = '' WHERE
> >> empno = 7499;
> >>
> >> To be clear, here's what I'm expecting:
> >>
> >> Input: 
> >> Display: [null]
> >> SQL: UPDATE t SET c = NULL WHERE k  = 
> >>
> >> Input: ''
> >> Display:
> >> SQL: UPDATE t SET c = '' WHERE k  = 
> >>
> >> Input: \'\'
> >> Display: ''
> >> SQL: UPDATE t SET c = '' WHERE k  = 
> >>
> >> Input: \\'\\'
> >> Display: \'\'
> >> SQL: UPDATE t SET c = '\''\''' WHERE k  = 
> >>
> >> --
> >> 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
>


RM1790_v4.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] [pgAdmin4][Patch]: Fix RM1790 - [Web] Support setting a field's value to "null"

2017-02-02 Thread Surinder Kumar
Hi Dave,

On Mon, Jan 30, 2017 at 6:18 PM, Dave Page <dp...@pgadmin.org> wrote:

> On Fri, Jan 27, 2017 at 10:32 AM, Surinder Kumar
> <surinder.ku...@enterprisedb.com> wrote:
> > Hi Dave,
> >
> > Please find updated patch.
> >
> > On Mon, Jan 16, 2017 at 10:01 PM, Dave Page <dp...@pgadmin.org> wrote:
> >>
> >> Hi
> >>
> >> On Fri, Jan 13, 2017 at 9:24 AM, Surinder Kumar
> >> <surinder.ku...@enterprisedb.com> wrote:
> >> > Hi
> >> >
> >> > Please find attached patch and review.
> >> >
> >> > On Sun, Jan 8, 2017 at 3:27 PM, Dave Page <dp...@pgadmin.org> wrote:
> >> >>
> >> >> Hi
> >> >>
> >> >> On Friday, December 23, 2016, Surinder Kumar
> >> >> <surinder.ku...@enterprisedb.com> wrote:
> >> >>>
> >> >>> Forgot to attach patch in last thread. please find patch.
> >> >>
> >> >>
> >> >> It looks good for the most part, except:
> >> >>
> >> >> 1) You missed the part we discussed about being able to set a value
> to
> >> >> ''
> >> >> (the literal string containing two single quotes) by entering \'\'
> (and
> >> >> of
> >> >> course, the follow-on cases to allow setting a value to \'\' by
> >> >> entering
> >> >> \\'\\' etc).
> >> >
> >> > Fixed.
> >>
> >> That doesn't seem right to me - the code you've written looks like
> >> it'll try to escape anything for use in a string literal, not just
> >> '\'\ or \\'\\' etc.
> >
> > Now the implementation is that It will find and unescape the string
> literals
> > like '\'\ or \\'\\' etc.
>
> I ran some tests:
>
> - Setting a field to '' resulted in the following SQL:
>
> UPDATE public.emp SET
> job = '' WHERE
> empno = 7369;
>
> - Setting a field to \"\" resulted in the following SQL:
>
> UPDATE public.emp SET
> job = '""' WHERE
> empno = 7499;
>
> - Setting a field to \'\' displayed \'\' in the grid until refreshed
> when the value vanished. The SQL it ran was:
>
​In current behaviour, we are saving the value provided by user and we are
not refreshing the grid with new values.
​Should we do refresh along with save?

>
> UPDATE public.emp SET
> job = '' WHERE
> empno = 7499;
>
> To be clear, here's what I'm expecting:
>
> Input: 
> Display: [null]
> SQL: UPDATE t SET c = NULL WHERE k  = 
>
> Input: ''
> Display:
> SQL: UPDATE t SET c = '' WHERE k  = 
>
> Input: \'\'
> Display: ''
> SQL: UPDATE t SET c = '' WHERE k  = 
>
> Input: \\'\\'
> Display: \'\'
> SQL: UPDATE t SET c = '\''\''' WHERE k  = 
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>


[pgadmin-hackers] [pgAdmin4][Patch]: RM2047 - Allow user to move panel over the menu bar

2017-01-29 Thread Surinder Kumar
Hi Dave,

*Solution:*
Setting z-index: 10 of .pg-navbar menu class to allow panel float over the
menu bar.

Please find attached patch.

Thanks,
Surinder Kumar


RM2047.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] [pgAdmin4][Patch]: Fix RM1790 - [Web] Support setting a field's value to "null"

2017-01-27 Thread Surinder Kumar
Hi Dave,

Please find updated patch.

On Mon, Jan 16, 2017 at 10:01 PM, Dave Page <dp...@pgadmin.org> wrote:

> Hi
>
> On Fri, Jan 13, 2017 at 9:24 AM, Surinder Kumar
> <surinder.ku...@enterprisedb.com> wrote:
> > Hi
> >
> > Please find attached patch and review.
> >
> > On Sun, Jan 8, 2017 at 3:27 PM, Dave Page <dp...@pgadmin.org> wrote:
> >>
> >> Hi
> >>
> >> On Friday, December 23, 2016, Surinder Kumar
> >> <surinder.ku...@enterprisedb.com> wrote:
> >>>
> >>> Forgot to attach patch in last thread. please find patch.
> >>
> >>
> >> It looks good for the most part, except:
> >>
> >> 1) You missed the part we discussed about being able to set a value to
> ''
> >> (the literal string containing two single quotes) by entering \'\' (and
> of
> >> course, the follow-on cases to allow setting a value to \'\' by entering
> >> \\'\\' etc).
> >
> > Fixed.
>
> That doesn't seem right to me - the code you've written looks like
> it'll try to escape anything for use in a string literal, not just
> '\'\ or \\'\\' etc.
>
​Now the implementation is that It will find and unescape the string
literals like ​'\'\ or \\'\\' etc.

>
> >> 2) Could you please update the appropriate doc page to explain how this
> >> all works? You can lift the text from the pgAdmin 3 docs for the most
> part.
> >
> > I will send a separate patch for it.
> >>
> >>
> >> Thanks.
> >>
> >>>
> >>>
> >>> On Fri, Dec 23, 2016 at 11:24 AM, Surinder Kumar
> >>> <surinder.ku...@enterprisedb.com> wrote:
> >>>>
> >>>> On Fri, Dec 23, 2016 at 11:11 AM, Surinder Kumar
> >>>> <surinder.ku...@enterprisedb.com> wrote:
> >>>>>
> >>>>> Hi Dave,
> >>>>>
> >>>>> Please find updated patch.
> >>>>>
> >>>>> Changes implemented:
> >>>>>
> >>>>> 1) To enter an empty string in string/character type, user need to
> >>>>> enter '' (two single quotes).
> >>>>> 2) To enter null values in Integer/String type, user need to keep the
> >>>>> field blank.
> >>>>> 3) Null values will be represented as [null].
> >>>>>
> >>>>> Please find attached patch and review.
> >>>>>
> >>>>> On Fri, Dec 9, 2016 at 2:23 PM, Surinder Kumar
> >>>>> <surinder.ku...@enterprisedb.com> wrote:
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>> On Mon, Dec 5, 2016 at 11:09 PM, Dave Page <dp...@pgadmin.org>
> wrote:
> >>>>>>>
> >>>>>>> Hi
> >>>>>>>
> >>>>>>> On Friday, December 2, 2016, Surinder Kumar
> >>>>>>> <surinder.ku...@enterprisedb.com> wrote:
> >>>>>>>>
> >>>>>>>> Hi
> >>>>>>>>
> >>>>>>>> Issue:
> >>>>>>>> - On viewing table data, If we edit a column and set value of
> >>>>>>>> column(type: text) to "null", It always takes it as empty string.
> It doesn't
> >>>>>>>> honour null values.
> >>>>>>>>
> >>>>>>>> Solution:
> >>>>>>>> - Take a flag "is_null" for columns with data type 'text', then on
> >>>>>>>> GUI, whilst user edits a text field, an additional option with
> >>>>>>>> checkbox(is_null ?) is given to take null values. If checkbox is
> checked, on
> >>>>>>>> JS side we check "is_null" flag and pass field value to null if
> selected.
> >>>>>>>>
> >>>>>>>> Please find patch and review.
> >>>>>>>
> >>>>>>>
> >>>>>>> A nice solution, but there are some problems I think;
> >>>>>>>
> >>>>>>> - How do I set a field that doesn't use the text editor to null?
> e.g.
> >>>>>>> an integer? If I try to set one to blank, I get an error that it's
> invalid
> >>>>>>> input syntax for an integer.
> >>>>>>
> >>>>>> It seems p

Re: [pgadmin-hackers] [pgAdmin4][Patch]: RM1840 - cannot create gist index due to enforced ASC, DESC options in generated SQL

2017-01-19 Thread Surinder Kumar
Hi Dave,

The last patch was for exclusion constraint only. The same issue issue is
reported RM2061 <https://redmine.postgresql.org/issues/2061> for index.
So, this patch takes care of both issues.

Added a flag '*is_sort_nulls_applicable*' which is set to true for access
method 'btree'.
If its is true, the values for options 'ASC/DESC' and 'NULLS' are included
in 'create' sql for exclusion and index otherwise not.

Please find updated patch and review.

On Tue, Jan 17, 2017 at 3:43 PM, Dave Page <dp...@pgadmin.org> wrote:

> Hi
>
> On Tue, Jan 17, 2017 at 9:52 AM, Surinder Kumar
> <surinder.ku...@enterprisedb.com> wrote:
> > Hi
> > On Tue, Jan 17, 2017 at 3:08 PM, Dave Page <dp...@pgadmin.org> wrote:
> >>
> >> Hi
> >>
> >> On Fri, Jan 13, 2017 at 6:50 AM, Surinder Kumar
> >> <surinder.ku...@enterprisedb.com> wrote:
> >> > Hi
> >> >
> >> > Please find updated patch following changes:
> >> > 1) Keep field 'opclass' combo box enabled.
> >>
> >> That doesn't seem to be working.
>
​It is now fixed in the updated patch.​

> >
> > Is the field 'opclass' is not enabled for you?.
>
> No.
>
> > Can you please tell in which scenario it doesn't gets enabled? so that I
> can
> > fix it.
>
> PostgreSQL 9.4, table:
>
> CREATE TABLE public.foo
> (
> id text COLLATE pg_catalog."default" NOT NULL,
> data1 text COLLATE pg_catalog."default",
> CONSTRAINT foo_pkey1 PRIMARY KEY (id),
> CONSTRAINT gerp1 UNIQUE (id, data1)
> )
>
> 1) Right-click, Create index
>
> 2) Name: 
>
> 3) Access method: gist
>
> 4) Add column. Select id (note the opclass field is not enabled)
>
> 5) Add column. Select data1 (note the opclass field is not enabled).
>
> 6) Click save, and behold the following error in all it's glory :-)
>
> ERROR: data type text has no default operator class for access method
> "gist"
> HINT: You must specify an operator class for the index or define a
> default operator class for the data type.​

​Thanks for steps.​

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


RM1840_V2.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] [pgAdmin4][Patch]: RM1840 - cannot create gist index due to enforced ASC, DESC options in generated SQL

2017-01-12 Thread Surinder Kumar
Hi

Please find updated patch following changes:
1) Keep field 'opclass' combo box enabled.
2) Keep ASC/DESC and NULLs FIRST/LAST options disable for access methods
other than 'btree'.
3) Add validation for name field.


On Fri, Nov 25, 2016 at 5:16 PM, Dave Page <dp...@pgadmin.org> wrote:

> On Thu, Nov 24, 2016 at 12:13 PM, Surinder Kumar
> <surinder.ku...@enterprisedb.com> wrote:
> > Hi
> >
> > Please find updated patch with change.
> >
> > On Fri, Oct 21, 2016 at 9:16 PM, Dave Page <dp...@pgadmin.org> wrote:
> >>
> >> On Fri, Oct 21, 2016 at 4:42 PM, Surinder Kumar
> >> <surinder.ku...@enterprisedb.com> wrote:
> >> > On Fri, Oct 21, 2016 at 8:52 PM, Dave Page <dp...@pgadmin.org> wrote:
> >> >>
> >> >> Hi
> >> >>
> >> >> On Fri, Oct 21, 2016 at 4:16 PM, Surinder Kumar
> >> >> <surinder.ku...@enterprisedb.com> wrote:
> >> >> > Hi
> >> >> >
> >> >> > This fix is for exclusion constraint.
> >> >> > The options like "order" and "nulls" must be conditional. i.e.
> >> >> > include
> >> >> > only
> >> >> > when access method type is other than "gist".
> >> >>
> >> >> When creating an index, the asc/desc options are disabled if gist/gin
> >> >> used. I think they also should be here.
> >> >>
> >> >> Also, what about gin indexes in this case?
> >> >
> >> > As per documentation,
> >> > The access method must support amgettuple (see Chapter 52); at present
> >> > this
> >> > means GIN cannot be used
> >>
> >> OK, but this patch (unlike the last one) only seems to check for gist.
> >
> > I have modified the code so It will check for 'gist' and 'spgist'
>
> Hi,
>
> This still doesn't seem right to me. For example, if I choose an
> access method that doesn't have a default operator class for the
> selected data type, Postgres asks me to explicitly choose one, which I
> now can't because the combo box is disabled. Conversely, whilst the
> opclass should probably not be disabled, the ASC/DESC and NULLs
> FIRST/LAST options probably should be disabled (right now, they're
> just ignored).
>
> Thoughts?
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>


RM1840_V1.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] [pgAdmin4][Patch]: RM1938 - Backgrid sorting not working for Integer/Number types

2017-01-09 Thread Surinder Kumar
Hi Dave,

I just missed the code for swapping left and right values if order is
descending. It's fixed.
Please find attached patch and review.

On Mon, Jan 9, 2017 at 9:05 AM, Dave Page <dp...@pgadmin.org> wrote:

> Hi
>
> On Friday, January 6, 2017, Surinder Kumar <surinder.kumar@enterprisedb.
> com> wrote:
>
>> Hi,
>>
>> As the type of data we get from server side is of string type, due to
>> which the sorting for Integer/Number type columns is not working.
>>
>> To fix this issue, we are using BigNumber JS library.
>> We are overriding Backgrid's sort and make_comparator method in
>> backgrid.pgadmin.js.
>>
>> When sorting is performed based on column we identify the column
>> type(integer/number) and then convert its value into BigInteger and the
>> sorts data.
>>
>> This patch is dependent on patch sent for "Adding support for BigNumber
>> JS library".
>>
>> Also, thanks to Murtuza for help.
>>
>> Please find attached patch and review.
>>
>
> This works fine for ascending sorts, but if i click the row header a
> second time for a descending sort, the order isn't reversed as expected.
>
> Thanks, Dave.
>
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
>


RM1938_v1.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


[pgadmin-hackers] [pgAdmin4][Patch]: RM1938 - Backgrid sorting not working for Integer/Number types

2017-01-06 Thread Surinder Kumar
Hi,

As the type of data we get from server side is of string type, due to which
the sorting for Integer/Number type columns is not working.

To fix this issue, we are using BigNumber JS library.
We are overriding Backgrid's sort and make_comparator method in
backgrid.pgadmin.js.

When sorting is performed based on column we identify the column
type(integer/number) and then convert its value into BigInteger and the
sorts data.

This patch is dependent on patch sent for "Adding support for BigNumber JS
library".

Also, thanks to Murtuza for help.

Please find attached patch and review.


Thanks,
Surinder Kumar


RM1938.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


[pgadmin-hackers] [pgAdmin4][Patch]: RM1830 - Error generating reversed engineering sql

2016-12-30 Thread Surinder Kumar
Hi,

This issue is due to syntax error in query. The issue was found in sql
template files for
"post8_4", "post9_0" and "post9_1" servers.

Please find attached patch and review.

Thanks,
Surinder Kumar


RM1830.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


[pgadmin-hackers] [pgAdmin4][Patch]: RM1832 - Dependency information not displayed for Synonym node

2016-12-30 Thread Surinder Kumar
Hi,

Issue: It was python list index error - when we try to access an empty list.
This case is handled in the patch.

Please find attached patch and review.

Thanks,
Surinder Kumar


RM1832.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


[pgadmin-hackers] [pgAdmin4][Patch]: RM#2033 - Image missing for dependents objects in dependents tab

2016-12-30 Thread Surinder Kumar
Hi,

The icons for unique constraint and exclusion constraint were not
displaying due to incorrect object names given for icon. This is now fixed.

Please find attached patch and review.

Thanks,
Surinder Kumar


RM2033.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


[pgadmin-hackers] [pgAdmin4][Patch]: RM2039 - Big (numeric) numbers are sometimes rounded up when displayed

2016-12-23 Thread Surinder Kumar
Hi,

Added 'numeric' type into string typecaster to prevent python from rounded
up.

Please find attached patch and review.

Thanks,
Surinder Kumar


RM2039.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


[pgadmin-hackers] [pgAdmin4][Patch]: RM 2012 - Disable Save button if name is empty in Server-group

2016-12-23 Thread Surinder Kumar
Hi,

The issue is with validation which is now fixed.

Please find attached patch and review.


Thanks,
Surinder Kumar


RM2012.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


[pgadmin-hackers] [pgAdmin4][Patch]: RM2000 - Add support for "effective_io_concurrency" tablespace option under parameter tab in tablespace

2016-12-23 Thread Surinder Kumar
Hi,

As per docs, for postgres version 9.5 , only two tablespaces options are
supported "*seq_page_cost and random_page_cost*"

And for 9.6 , the support for "*effective_io_concurrency*" is also added.

The required changes are implemented in code and tested against
postgresql-9.5, 9.6 & edb-ppas 9.5 and 9.6

Please find patch and review.


Thanks,
Surinder Kumar


RM2000.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] [pgAdmin4][Patch]: Fix RM1790 - [Web] Support setting a field's value to "null"

2016-12-22 Thread Surinder Kumar
Forgot to attach patch in last thread. please find patch.

On Fri, Dec 23, 2016 at 11:24 AM, Surinder Kumar <
surinder.ku...@enterprisedb.com> wrote:

> On Fri, Dec 23, 2016 at 11:11 AM, Surinder Kumar <
> surinder.ku...@enterprisedb.com> wrote:
>
>> Hi Dave,
>>
>> Please find updated patch.
>>
>> *Changes implemented:*
>>
>> 1) To enter an empty string in string/character type, user need to enter
>> '' (two single quotes).
>> 2) To enter null values in Integer/String type, user need to keep the
>> field blank.
>> 3) Null values will be represented as *[null]*.
>>
>> Please find attached patch and review.
>>
>> On Fri, Dec 9, 2016 at 2:23 PM, Surinder Kumar <
>> surinder.ku...@enterprisedb.com> wrote:
>>
>>>
>>>
>>> On Mon, Dec 5, 2016 at 11:09 PM, Dave Page <dp...@pgadmin.org> wrote:
>>>
>>>> Hi
>>>>
>>>> On Friday, December 2, 2016, Surinder Kumar <
>>>> surinder.ku...@enterprisedb.com> wrote:
>>>>
>>>>> Hi
>>>>>
>>>>> *Issue:*
>>>>> - On viewing table data, If we edit a column and set value
>>>>> of column(type: text) to "null", It always takes it as empty string. It
>>>>> doesn't honour null values.
>>>>>
>>>>> Solution:
>>>>> - Take a flag "*is_null*" for columns with data type 'text', then on
>>>>> GUI, whilst user edits a text field, an additional option with
>>>>> checkbox(is_null ?) is given to take null values. If checkbox is checked,
>>>>> on JS side we check "*is_null*" flag and pass field value to null if
>>>>> selected.
>>>>>
>>>>> Please find patch and review.
>>>>>
>>>>
>>>> A nice solution, but there are some problems I think;
>>>>
>>>> - How do I set a field that doesn't use the text editor to null? e.g.
>>>> an integer? If I try to set one to blank, I get an error that it's invalid
>>>> input syntax for an integer.
>>>>
>>> ​It seems possible by writing custom editor which will convert empty
>>> string to null before save operation.​
>>>
>> ​Now If you set blank for integer field, field will set to null.
>>
>>>
>>>> - When null values are first displayed, they are shown as blank
>>>> entries. If I then set one to null, it displays "null". It should always
>>>> display consistently - I'd suggest "[null]"
>>>>
>>> ​Ok. But the issue is if we display "[null]" in cell for null entry. How
>>> would we distinguish If it is user entered string(as user can also enter
>>> "[null]") or it represent null value ?​ (Ashesh's concern)
>>>
>> ​Now null values will be represented in field as [null]. ​
>>
>>>
>>>> Whilst I like the way this works in part, I think it's going to be
>>>> inconsistent in the way it would be displayed. I think we need to follow
>>>> the pgAdmin III way of handling this. The docs say the following:
>>>>
>>>> 
>>>> If an SQL NULL is to be written to the table, simply leave the field
>>>> empty. If you store a new row, this will let the server fill in the default
>>>> value for that column. If you store a change to an existing row, the value
>>>> NULL will explicitly be written. ​
>>>>
>>>
>>>> ...
>>>>
>>>> If you want pgAdmin III to write an empty string to the table, you
>>>> enter the special string ‘’ (two single quotes) in the field. If you want
>>>> to write a string containing solely two single quotes to the table, you
>>>> need to escape these quotes, by typing \‘\’
>>>>
>>> ​To write an empty string, now user can enter ''​ (two single quotes),
>> it will be treated as empty string.
>>
>>> 
>>>>
>>>> In other words, if an empty value is included for a new row, that
>>>> column will be omitted from the INSERT statement, allowing the server to
>>>> use a default, or set it to blank.
>>>>
>>>> For existing rows, an empty value for any data type is updated as NULL
>>>> - e.g. col = NULL.
>>>>
>>>> For character/string types, if the user enters '', then an empty string
>>>> is written to the column when either inserting or updating.
>&g

Re: [pgadmin-hackers] [pgAdmin4][Patch]: Fix RM1790 - [Web] Support setting a field's value to "null"

2016-12-22 Thread Surinder Kumar
On Fri, Dec 23, 2016 at 11:11 AM, Surinder Kumar <
surinder.ku...@enterprisedb.com> wrote:

> Hi Dave,
>
> Please find updated patch.
>
> *Changes implemented:*
>
> 1) To enter an empty string in string/character type, user need to enter
> '' (two single quotes).
> 2) To enter null values in Integer/String type, user need to keep the
> field blank.
> 3) Null values will be represented as *[null]*.
>
> Please find attached patch and review.
>
> On Fri, Dec 9, 2016 at 2:23 PM, Surinder Kumar <
> surinder.ku...@enterprisedb.com> wrote:
>
>>
>>
>> On Mon, Dec 5, 2016 at 11:09 PM, Dave Page <dp...@pgadmin.org> wrote:
>>
>>> Hi
>>>
>>> On Friday, December 2, 2016, Surinder Kumar <
>>> surinder.ku...@enterprisedb.com> wrote:
>>>
>>>> Hi
>>>>
>>>> *Issue:*
>>>> - On viewing table data, If we edit a column and set value
>>>> of column(type: text) to "null", It always takes it as empty string. It
>>>> doesn't honour null values.
>>>>
>>>> Solution:
>>>> - Take a flag "*is_null*" for columns with data type 'text', then on
>>>> GUI, whilst user edits a text field, an additional option with
>>>> checkbox(is_null ?) is given to take null values. If checkbox is checked,
>>>> on JS side we check "*is_null*" flag and pass field value to null if
>>>> selected.
>>>>
>>>> Please find patch and review.
>>>>
>>>
>>> A nice solution, but there are some problems I think;
>>>
>>> - How do I set a field that doesn't use the text editor to null? e.g. an
>>> integer? If I try to set one to blank, I get an error that it's invalid
>>> input syntax for an integer.
>>>
>> ​It seems possible by writing custom editor which will convert empty
>> string to null before save operation.​
>>
> ​Now If you set blank for integer field, field will set to null.
>
>>
>>> - When null values are first displayed, they are shown as blank entries.
>>> If I then set one to null, it displays "null". It should always display
>>> consistently - I'd suggest "[null]"
>>>
>> ​Ok. But the issue is if we display "[null]" in cell for null entry. How
>> would we distinguish If it is user entered string(as user can also enter
>> "[null]") or it represent null value ?​ (Ashesh's concern)
>>
> ​Now null values will be represented in field as [null]. ​
>
>>
>>> Whilst I like the way this works in part, I think it's going to be
>>> inconsistent in the way it would be displayed. I think we need to follow
>>> the pgAdmin III way of handling this. The docs say the following:
>>>
>>> 
>>> If an SQL NULL is to be written to the table, simply leave the field
>>> empty. If you store a new row, this will let the server fill in the default
>>> value for that column. If you store a change to an existing row, the value
>>> NULL will explicitly be written. ​
>>>
>>
>>> ...
>>>
>>> If you want pgAdmin III to write an empty string to the table, you enter
>>> the special string ‘’ (two single quotes) in the field. If you want to
>>> write a string containing solely two single quotes to the table, you need
>>> to escape these quotes, by typing \‘\’
>>>
>> ​To write an empty string, now user can enter ''​ (two single quotes), it
> will be treated as empty string.
>
>> 
>>>
>>> In other words, if an empty value is included for a new row, that column
>>> will be omitted from the INSERT statement, allowing the server to use a
>>> default, or set it to blank.
>>>
>>> For existing rows, an empty value for any data type is updated as NULL -
>>> e.g. col = NULL.
>>>
>>> For character/string types, if the user enters '', then an empty string
>>> is written to the column when either inserting or updating.
>>>
>>
>>> If the user wishes to insert the literal string '' (i.e. 2 single
>>> quotes), then \'\' must be entered, and pgAdmin converts that to ''.
>>>
>>
>>> To enter a literal string of \'\', then the user enters \\'\\', for
>>> \\'\\' they enter '' and so on.
>>>
>> ​If a user enters a literal string \'\', this value is escaped by adding
> slashes on python side and unescaped by removing added slashes when
> returned to display.​
> the entered values are already escaped, user need not to escape values.
>
>> ​This behaviour seems to working wine in pgAdmin3 query tool but not on
>> viewing data by right click context menu.​​
>>
>
>> *​In view data:​*
>> ​When user enter literal strings like '', ​\'\'
>> ​ &
>> \\'\\', it displays these strings as it is after saving. It seems
>> conversion doesn't happen.
>> so which one is correct to follow in pgAdmin4?
>>
>>
>>>
>>> Thanks.
>>>
>>>
>>> --
>>> Dave Page
>>> Blog: http://pgsnake.blogspot.com
>>> Twitter: @pgsnake
>>>
>>> EnterpriseDB UK: http://www.enterprisedb.com
>>> The Enterprise PostgreSQL Company
>>>
>>>
>>
>


[pgadmin-hackers] [pgAdmin4][Patch]: Fix RM1790 - [Web] Support setting a field's value to "null"

2016-12-02 Thread Surinder Kumar
Hi

*Issue:*
- On viewing table data, If we edit a column and set value of column(type:
text) to "null", It always takes it as empty string. It doesn't honour null
values.

Solution:
- Take a flag "*is_null*" for columns with data type 'text', then on GUI,
whilst user edits a text field, an additional option with checkbox(is_null
?) is given to take null values. If checkbox is checked, on JS side we
check "*is_null*" flag and pass field value to null if selected.

Please find patch and review.


Thanks,
Surinder Kumar


RM1790.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] Re: [pgAdmin4][Patch]: Fixes #1986 - Properly handle non-ascii characters while loading & saving file

2016-11-28 Thread Surinder Kumar
Hi Dave,

The issues for RM#1986 & RM#1940 has been fixed and combined into a single
patch as they are related.

This patch is tested on Mac OSX, Ubuntu and Windows (py27 and py35).
Everything is working fine.
If there is still any issue. Please let me know.

​Please find updated patch and review.​


On Fri, Nov 25, 2016 at 3:23 PM, Dave Page <dp...@pgadmin.org> wrote:

> Hi
>
> On Thu, Nov 24, 2016 at 10:11 AM, Surinder Kumar
> <surinder.ku...@enterprisedb.com> wrote:
> > Please ignore above patch. because it breaks when we save a file with
> name
> > containing ascii chars in py35
> > It is fixed. Please find attached patch and review.
> >
> > On Thu, Nov 24, 2016 at 2:56 PM, Surinder Kumar
> > <surinder.ku...@enterprisedb.com> wrote:
> >>
> >> Hi
> >>
> >> Issue:
> >> The content will not write to disk if it contains ascii characters.
> >>
> >> Solution:
> >> Encode/Decode the content before writing/reading the file.
> >>
> >> By the way, the file/folder name should also encode/decode, a similar
> >> issue is already logged
> >> #1940. I will work on it.
> >>
> >> Please find attached path and review.
>
> I'm running into all sorts of problems testing this. I'm on Mac, using
> Apple's Python 2.7.10 build.
>
> 1) Sometimes when opening the file manager to open a file, I get the
> following exception. It appears (but I'm not certain) to be when I've
> already opened a file with non-ASCII chars in the name and I've been
> prompted to discard the changes.
>
> 2016-11-25 09:42:20,087: INFO werkzeug: 127.0.0.1 - - [25/Nov/2016
> 09:42:20] "GET /file_manager/ HTTP/1.1" 500 -
> Traceback (most recent call last):
>   File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packa
> ges/flask/app.py",
> line 2000, in __call__
> return self.wsgi_app(environ, start_response)
>   File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packa
> ges/flask/app.py",
> line 1991, in wsgi_app
> response = self.make_response(self.handle_exception(e))
>   File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packa
> ges/flask/app.py",
> line 1567, in handle_exception
> reraise(exc_type, exc_value, tb)
>   File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packa
> ges/flask/app.py",
> line 1988, in wsgi_app
> response = self.full_dispatch_request()
>   File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packa
> ges/flask/app.py",
> line 1643, in full_dispatch_request
> response = self.process_response(response)
>   File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packa
> ges/flask/app.py",
> line 1864, in process_response
> self.save_session(ctx.session, response)
>   File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packa
> ges/flask/app.py",
> line 926, in save_session
> return self.session_interface.save_session(self, session, response)
>   File "/Users/dpage/git/pgadmin4/web/pgadmin/utils/session.py", line
> 267, in save_session
> self.manager.put(session)
>   File "/Users/dpage/git/pgadmin4/web/pgadmin/utils/session.py", line
> 144, in put
> self.parent.put(session)
>   File "/Users/dpage/git/pgadmin4/web/pgadmin/utils/session.py", line
> 220, in put
> f
> RuntimeError: dictionary changed size during iteration
>
​I tried to reproduce with given steps. but unfortunately I couldn't
reproduce.​ If possible please provide more information.

>
> 2) If I use "Save As" and select an existing file with non-ASCII chars
> in the name, the filename box shows an encoded filename. See
> screenshot 1.
>
​Fixed.​

>
> 3) If I open an existing file with non-ASCII chars in the name, the
> title of the Query Tool tab is shown encoded. See screenshot 2. Note
> that if I save a new file, the name is displayed correctly.
>
​Fixed.​

>
> 4) Just selecting a file to open (without then clicking open) in the
> file manager gives the following exception:
>
> 2016-11-25 09:51:37,585: INFO werkzeug: 127.0.0.1 - - [25/Nov/2016
> 09:51:37] "POST /file_manager/filemanager/2265288/ HTTP/1.1" 500 -
> Traceback (most recent call last):
>   File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packa
> ges/flask/app.py",
> line 2000, in __call__
> return self.wsgi_app(environ, start_response)
>   File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packa
> ges/flask/app.py",
> line 1991, in wsgi_app
> response = self.make_response(self.handle_exception(e))
>   File "/U

Re: [pgadmin-hackers] [pgAdmin4][Patch]: RM1840 - cannot create gist index due to enforced ASC, DESC options in generated SQL

2016-11-24 Thread Surinder Kumar
Hi

Please find updated patch with change.

On Fri, Oct 21, 2016 at 9:16 PM, Dave Page <dp...@pgadmin.org> wrote:

> On Fri, Oct 21, 2016 at 4:42 PM, Surinder Kumar
> <surinder.ku...@enterprisedb.com> wrote:
> > On Fri, Oct 21, 2016 at 8:52 PM, Dave Page <dp...@pgadmin.org> wrote:
> >>
> >> Hi
> >>
> >> On Fri, Oct 21, 2016 at 4:16 PM, Surinder Kumar
> >> <surinder.ku...@enterprisedb.com> wrote:
> >> > Hi
> >> >
> >> > This fix is for exclusion constraint.
> >> > The options like "order" and "nulls" must be conditional. i.e. include
> >> > only
> >> > when access method type is other than "gist".
> >>
> >> When creating an index, the asc/desc options are disabled if gist/gin
> >> used. I think they also should be here.
> >>
> >> Also, what about gin indexes in this case?
> >
> > As per documentation,
> > The access method must support amgettuple (see Chapter 52); at present
> this
> > means GIN cannot be used
>
> OK, but this patch (unlike the last one) only seems to check for gist.
>
​I have modified the code so It will check for 'gist' and 'spgist'

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


RM1840_exclusion_constraint_v2.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


[pgadmin-hackers] [pgAdmin4][Patch]: Fixes #1940 - Handle non-ascii characters in file/folder names

2016-11-24 Thread Surinder Kumar
Hi

This patch handles encode/decode issues for files names when following
operations are performed such as "create/rename/delete/download/upload" or
browsing a file etc.

*Changes in code:*
1) Removed cleanstring() js function which converts ascii characters into
its alphabetical characters.
We support ascii characters for file/folder name.
2) Read/Write file in bytes mode(rb/wb) as file need not be always text
file.
3) The title of query tab is currently shown encoded, it should be decoded
while displaying in tab title.

Please find attached patch and review.


Thanks,
Surinder Kumar


RM_1940.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


[pgadmin-hackers] Re: [pgAdmin4][Patch]: Fixes #1986 - Properly handle non-ascii characters while loading & saving file

2016-11-24 Thread Surinder Kumar
Please ignore above patch. because it breaks when we save a file with name
containing ascii chars in py35
It is fixed. Please find attached patch and review.

On Thu, Nov 24, 2016 at 2:56 PM, Surinder Kumar <
surinder.ku...@enterprisedb.com> wrote:

> Hi
>
> *Issue:*
> The content will not write to disk if it contains ascii characters.
>
> *Solution:*
> Encode/Decode the content before writing/reading the file.
>
> By the way, the file/folder name should also encode/decode, a similar
> issue is already logged
> #1940 <https://redmine.postgresql.org/issues/1940>. I will work on it.
>
> Please find attached path and review.
>
>
> Thanks,
> Surinder Kumar
>
>
>


RM1986_v2.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


[pgadmin-hackers] [pgAdmin4][Patch]: Fixes #1986 - Properly handle non-ascii characters while loading & saving file

2016-11-24 Thread Surinder Kumar
Hi

*Issue:*
The content will not write to disk if it contains ascii characters.

*Solution:*
Encode/Decode the content before writing/reading the file.

By the way, the file/folder name should also encode/decode, a similar issue
is already logged
#1940 <https://redmine.postgresql.org/issues/1940>. I will work on it.

Please find attached path and review.


Thanks,
Surinder Kumar


RM1986.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] [pgAdmin4][Patch]: RM1840 - cannot create gist index due to enforced ASC, DESC options in generated SQL

2016-10-21 Thread Surinder Kumar
On Fri, Oct 21, 2016 at 8:52 PM, Dave Page <dp...@pgadmin.org> wrote:

> Hi
>
> On Fri, Oct 21, 2016 at 4:16 PM, Surinder Kumar
> <surinder.ku...@enterprisedb.com> wrote:
> > Hi
> >
> > This fix is for exclusion constraint.
> > The options like "order" and "nulls" must be conditional. i.e. include
> only
> > when access method type is other than "gist".
>
> When creating an index, the asc/desc options are disabled if gist/gin
> used. I think they also should be here.
>
> Also, what about gin indexes in this case?
>
​As per documentation
<https://www.postgresql.org/docs/9.2/static/sql-createtable.html#SQL-CREATETABLE-EXCLUDE>,
​
*The access method must support amgettuple (see Chapter 52
<https://www.postgresql.org/docs/9.2/static/indexam.html>); at present this
means GIN cannot be used*

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


Re: [pgadmin-hackers] [pgAdmin4][Patch]: RM1840 - cannot create gist index due to enforced ASC, DESC options in generated SQL

2016-10-21 Thread Surinder Kumar
Hi

This fix is for exclusion constraint.
The options like "order" and "nulls" must be conditional. i.e. include only
when access method type is other than "gist".

Please find attached patch and review.

On Fri, Oct 21, 2016 at 4:38 PM, Dave Page <dp...@pgadmin.org> wrote:

> Thanks, applied.
>
> On Thu, Oct 20, 2016 at 7:47 AM, Surinder Kumar
> <surinder.ku...@enterprisedb.com> wrote:
> > Hi,
> >
> > The options like "sort" and "nulls" must be conditional. i.e. include
> only
> > when access method type is other than "gist" or "gin".
> >
> > Please find attached patch and review.
> >
> > Thanks,
> > Surinder Kumar
> >
> >
> >
> > --
> > Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
> > To make changes to your subscription:
> > http://www.postgresql.org/mailpref/pgadmin-hackers
> >
>
>
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>


RM1840_same_fix_for_exclusion_constraint.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] [pgAdmin4][Patch]: Select2 control destroy issue [Minor fix]

2016-10-21 Thread Surinder Kumar
​I missed to add the check "destroy only if select2 has destroy property'.
in previous patch.
It was reproducible when I select access method of exclusion constraint
from combo box.

Please find attached patch and review.

On Sat, Oct 15, 2016 at 12:50 AM, Dave Page <dp...@pgadmin.org> wrote:

> Thanks, applied.
>
>
> On Friday, October 14, 2016, Surinder Kumar <surinder.kumar@enterprisedb.
> com> wrote:
>
>> Hi
>>
>> While clicking on Select2 control, it tries to destroy the control and
>> thus it doesn't get this object sometimes and throws error.
>>
>> It should attempt to destroy the select2 object only if this object is
>> not undefined.
>> Adds proper check to handle the case.
>>
>> Please find minor 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
>
>


select2_control_destroy_issue_v2.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


[pgadmin-hackers] [pgAdmin4][Patch]: RM1837 - FTS directory refresh not working

2016-10-21 Thread Surinder Kumar
Hi

The schema was supposed to be returned from nodes.sql but it wasn't.
I have verified refresh of other nodes which is working fine.

Please find attached patch and review.

Thanks
Surinder Kumar


RM1837.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


[pgadmin-hackers] [pgAdmin4][Patch]: RM1867 - User can not drop package body under properties section

2016-10-21 Thread Surinder Kumar
Hi

While editing the package properties, if pkg body is empty, It should drop
the package. but it wasn't generating drop package query.

Please find attached patch and review.


Thanks,
Surinder Kumar


RM1867.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


[pgadmin-hackers] [pgAdmin4][Patch]: RM1822 - 'ascii' codec can't decode byte

2016-10-20 Thread Surinder Kumar
Hi

I am able to reproduce the issue by changing server username to "Суриндер"
in russian locale.
Steps:
1) Rename server username to "Суриндер" by editing server properties.
2) Double click on sever. Enter password in Prompt dialog.
3) Click OK. Now It will throw "UnicodeDecode Error".

I have decoded the error message displayed for python2.

Please find attached patch and review.

Thanks
Surinder Kumar


RM1822.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


[pgadmin-hackers] [pgAdmin4][Patch]: RM1858 - File Manager does not honour the file type while traversing the directories

2016-10-20 Thread Surinder Kumar
Hi,

When a File Manager is closed by clicking cancel button. Its dom element
not destroyed.. So on traversing into directories, when it tries to get
currently selected file type, it looks into the dom element but it gets dom
of previous dialogs not of currently dialog.

Now whenever an instance of File Manager is closed. its dom elements are
also destroyed.

Please find attached patch and review.


Thanks,
Surinder Kumar


RM1858.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


[pgadmin-hackers] [pgAdmin4][Patch]: RM 1574 - sql is not displayed in SQL pane for security label in both PG and EPAS/PPAS server

2016-10-20 Thread Surinder Kumar
Hi,

Code to parse security privileges was missing. So, its sql wasn't displayed.

Please find attached patch and review.

Thanks,
Surinder Kumar


RM1574.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


  1   2   3   4   >