Re: [pgAdmin4][RM#3055] Allow user to sort the data in View data mode

2018-03-28 Thread Dave Page
On Wed, Mar 28, 2018 at 1:37 AM, Robert Eckhardt 
wrote:

>
>
> On Tue, Mar 27, 2018 at 9:54 AM, Murtuza Zabuawala <
> murtuza.zabuaw...@enterprisedb.com> wrote:
>
>>
>>
>> On Tue, Mar 27, 2018 at 7:06 PM, Robert Eckhardt 
>> wrote:
>>
>>>
>>>
>>> On Tue, Mar 27, 2018 at 6:25 AM, Murtuza Zabuawala <
>>> murtuza.zabuaw...@enterprisedb.com> wrote:
>>>
 On Tue, Mar 27, 2018 at 3:13 PM, Dave Page  wrote:

>
>
> On Mon, Mar 26, 2018 at 9:26 PM, Robert Eckhardt  > wrote:
>
>>
>>
>> On Mon, Mar 26, 2018 at 2:07 PM, Joao De Almeida Pereira <
>> jdealmeidapere...@pivotal.io> wrote:
>>
>>> Hi Hackers,
>>>
>>> @Murtuza: The patch codewise looks good. Nice to see that we are
>>> using axios instead of jquery ajax calls and that there is some coverage
>>> for the change.
>>> Nevertheless the Javascript testing looks a bit slim and could be
>>> improved. Also the DataSorting class could have some other member 
>>> functions
>>> like the model validation could be extracted out so that it is easily
>>> tested.
>>>
>>>
>>> @Hackers: This was how we tried to test this feature:
>>> 1 - Started pgAdmin
>>> 2 - Opened the query tool for a specific server
>>> 3 - Executed a SQL statment
>>> 4 - Pressed the column header to try to order, nothing happened
>>> 5 - Right clicked the column header to see if it was there the
>>> option, nothing
>>>
>>> This is the behavior that we were expecting, not to have to open
>>> Data View and then press the icon that is not even near the grid in 
>>> order
>>> to sort the column. Is this really the way we want people to use the 
>>> grid
>>> in pgAdmin? Should it be more intuitive?
>>>
>>
>> Have we considered making the grid behave more like excel or other
>> grids? I think that having the ascending and descending inside the column
>> header, we could similarly provide filtering. Something that would give
>> users a more intuitive place to look.
>>
>
> Doing the sorting via header clicks is convenient but very
> restrictive. How do you specify multiple columns to sort by for example?
> The current design allows you to select columns and the sort order as you
> see fit.
>

>>> Honestly I'm not sold on my idea, I was just proposing an alternative in
>>> an effort to start a discussion about the user experience. Ideally what I'd
>>> like to see, maybe this happened, is some user research. When we initial
>>> worked on refactoring the results grid we made a bunch of changes. One of
>>> the things we intended to do was to follow up to see how people were using
>>> the grid now so that we could better understand how it was now being used
>>> in order to design and implement features just like this. Clearly we
>>> haven't gotten there yet.
>>>
>>>

 Another reason we can't use that because w
 e have already occupied that behaviour for selecting entire column
 ​ when user clicks on header.
 As Dave suggested, I will be merging it with filter dialog meaning it
 will be accessible via direct button on toolbar & keyboard shortcut.​
 ​

>>>
>>> How are users currently interacting with that filter dialog?
>>>
>>
>> ​By clicking on the toolbar button as well as keyboard shortcut.
>> ​
>>
>>
>>
>>
>
> Sorry I wasn't clear. My question was more along the lines of, do we know
> if people are using the filter functionality?  What kind of filters are
> people using?  What do they like about it? What do they wish they could do
> above and beyond sorting, etc.
>

Yes, they are, based on the fact we've had issues reported in the past. We
have no idea how they are using it.

Sorting is a separate feature that is often requested. The only reason it's
connected here is that both functionalities in pgAdmin 3 were managed
through the same dialogue which based on lack of complaints from users,
generally worked for them. I do know that the proposed "click on headers"
approach will not work for me, as I have multi-part keys in databases which
I like to sort by in specific ways.

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

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


Re: Bug #3083 fix

2018-03-28 Thread Akshay Joshi
Hi

On Fri, Mar 2, 2018 at 3:40 AM, Joao De Almeida Pereira <
jdealmeidapere...@pivotal.io> wrote:

> Hello Neethu,
> We passed the patch through our CI pipeline and all tests pass.
> The code looks good, but we are trying to decouple files as much  as we
> can so that we do not end up with files with over 1000 lines, that are hard
> to read and to maintain. Also we are trying to create Unit Tests to have
> more coverage in our Javascript code.
>
> Can you split the new implementation code into it's own file and create
> some tests to ensure the behavior will not be broken in the future?iYou
> have some examples on: pgadmin/browser/server_groups/servers/databases/
> external_tables/*
>

I have spilt the new implementation into different file. Its' been hard
to write jasmine/feature test case as it requires drag event and exact
co-ordinate to resize the slickgrid cell.
Attached is the modified patch.


>
> Thanks
> Joao
>
> On Thu, Mar 1, 2018 at 10:37 AM Neethu Mariya Joy <
> neethumariya...@gmail.com> wrote:
>
>> Hi,
>> I am Neethu Mariya Joy, an undergraduate pursuing BE in Computer Science
>> at BITS Pilani.
>>
>> I've attempted to fix https://redmine.postgresql.org/issues/3083. Since
>> the textarea resize feature is the default HTML feature, I have not changed
>> it. Instead, I've added draggable borders to the wrapper which expands the
>> textarea inside it.
>>
>> I'm attaching my patch as bug3083.diff below as per the contribution
>> guidelines.
>>
>> Hope this helps. Thank you for your consideration!
>>
>> Sincerely,
>> Neethu Mariya Joy
>> GitHub  | Linkedin
>> 
>>
>>
>>


-- 
*Akshay Joshi*

*Sr. Software Architect *



*Phone: +91 20-3058-9517Mobile: +91 976-788-8246*


RM_3083_v2.patch
Description: Binary data


Re: [pgAdmin4][patch]: RM #3090 pgadmin shows misleading "Query returned successfully" with incorrect SQL

2018-03-28 Thread Joao De Almeida Pereira
Hi Akshay,
Thanks for the clarification, looks like there isn't much we can do then

Best Regards,
Joao

On Wed, Mar 28, 2018 at 1:35 AM Akshay Joshi 
wrote:

> Hi Joao
>
> On Tue, Mar 27, 2018 at 6:53 PM, Joao De Almeida Pereira <
> jdealmeidapere...@pivotal.io> wrote:
>
>> Hi Akshay,
>>
>> We were not trying to imply that your fix did not solve the problem, we
>> were trying to understand the root cause of the problem.
>>
>
> As per my understanding root cause of the problem is  "exception_obj.
> diag.severity" variable was not decoded and used directly, when I debug
> the code that variable contains the encoded string, so I have just use the
> function "*self.decode_to_utf8()*" and it works. If you can see the code
> below to this fix will have all the variables decoded to utf8.
>
>>
>> 1. We were not able to reproduce the problem
>> We followed your directions in RM, removed your fix but we could not
>> reproduce the problem. So we could not make sure that the application is in
>> fact working. This maybe have been because we missed something.
>> 2. The fix does not tackle the big problem
>> From what we read on the RM the big problem is "when we throw an
>> exception the front end is displaying the query successful message". Did
>> you also understood that from the RM?
>>
> We believe this is the real problem behind the RM.
>> Were you able replicate this behavior? If so we need to address the root
>> of this.
>>
>
> Yes I understood that from RM, but as I mentioned in my previous email
> that I haven't encounter that problem while trying to reproduce this. I got
> "*Not connected to the server*..." error not the "Query returned
> successfully". This bug has been log 2 months ago, I am not sure but it may
> possible that we have fixed/change some logic because of that I have seen
> "Not connected to the server.." error instead of "Query returned
> successfully".
>
>>
>>
>> As an aside sniping bugs is fine in some situations but as a general rule
>> of thumb is a bad approach and creates a blob of code that no one can
>> manage. A situation like this look like a very promising candidate for
>> extraction/refactoring in our point of view. In which situation do you
>> normally refactor or extract code?
>>
>> Thanks
>> Joao
>>
>>
>> On Tue, Mar 27, 2018, 1:31 AM Akshay Joshi 
>> wrote:
>>
>>> Hi Joao
>>>
>>> On Tue, Mar 27, 2018 at 12:01 AM, Joao De Almeida Pereira <
>>> jdealmeidapere...@pivotal.io> wrote:
>>>
 Hello,
 We tried to reproduce the issue but we were not capable to reproduce
 it.
 What it is strange on the fix is that python is complaining about a
 different line then the one that was fixed. Maybe this is just a Python
 thing

>>>
>>> I have mentioned the steps in RM and I have tried it on Ubuntu 16.
>>> Python is complaining the exact line where I have fixed the logic.
>>>
>>>ex_diag_message = u"{0}:  {1}".format(
>>>  self.decode_to_utf8(exception_obj.diag.severity), # 
>>> exception_obj.diag.severity is not decoded before my fix.
>>>  self.decode_to_utf8(exception_obj.diag.message_primary)
>>>)
>>>
>>>
>>>

 I assume that the fix works, but I would love to see some tests to
 ensure it is working. Another issue that looks more problematic is the fact
 that, as per the Redmine issue, when an exception is thrown it sends back a
 Successful Query message. If this is the case then this fix doesn't look
 like it is enough to solve the problem.

>>>
>>> Yes it works. With the latest code I didn't see Successful Query
>>> message, it is showing "Not connected to the server .", but the stack
>>> trace is same that was mentioned in the RM.
>>>

 Thanks
 Victoria & Joao

 On Mon, Mar 26, 2018 at 9:00 AM Dave Page  wrote:

> Thanks, applied.
>
> On Mon, Mar 26, 2018 at 11:43 AM, Akshay Joshi <
> akshay.jo...@enterprisedb.com> wrote:
>
>> Hi Hackers,
>>
>> Please find the attached patch to fix RM #3090 pgadmin shows
>> misleading "Query returned successfully" with incorrect SQL.
>>
>> --
>> *Akshay Joshi*
>>
>> *Sr. Software Architect *
>>
>>
>>
>> *Phone: +91 20-3058-9517 <+91%2020%203058%209517>Mobile: +91
>> 976-788-8246 <+91%2097678%2088246>*
>>
>
>
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>

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


Re: [pgAdmin4][RM#3055] Allow user to sort the data in View data mode

2018-03-28 Thread Robert Eckhardt
On Wed, Mar 28, 2018 at 4:12 AM, Dave Page  wrote:

>
>
> On Wed, Mar 28, 2018 at 1:37 AM, Robert Eckhardt 
> wrote:
>
>>
>>
>> On Tue, Mar 27, 2018 at 9:54 AM, Murtuza Zabuawala <
>> murtuza.zabuaw...@enterprisedb.com> wrote:
>>
>>>
>>>
>>> On Tue, Mar 27, 2018 at 7:06 PM, Robert Eckhardt 
>>> wrote:
>>>


 On Tue, Mar 27, 2018 at 6:25 AM, Murtuza Zabuawala <
 murtuza.zabuaw...@enterprisedb.com> wrote:

> On Tue, Mar 27, 2018 at 3:13 PM, Dave Page  wrote:
>
>>
>>
>> On Mon, Mar 26, 2018 at 9:26 PM, Robert Eckhardt <
>> reckha...@pivotal.io> wrote:
>>
>>>
>>>
>>> On Mon, Mar 26, 2018 at 2:07 PM, Joao De Almeida Pereira <
>>> jdealmeidapere...@pivotal.io> wrote:
>>>
 Hi Hackers,

 @Murtuza: The patch codewise looks good. Nice to see that we are
 using axios instead of jquery ajax calls and that there is some 
 coverage
 for the change.
 Nevertheless the Javascript testing looks a bit slim and could be
 improved. Also the DataSorting class could have some other member 
 functions
 like the model validation could be extracted out so that it is easily
 tested.


 @Hackers: This was how we tried to test this feature:
 1 - Started pgAdmin
 2 - Opened the query tool for a specific server
 3 - Executed a SQL statment
 4 - Pressed the column header to try to order, nothing happened
 5 - Right clicked the column header to see if it was there the
 option, nothing

 This is the behavior that we were expecting, not to have to open
 Data View and then press the icon that is not even near the grid in 
 order
 to sort the column. Is this really the way we want people to use the 
 grid
 in pgAdmin? Should it be more intuitive?

>>>
>>> Have we considered making the grid behave more like excel or other
>>> grids? I think that having the ascending and descending inside the 
>>> column
>>> header, we could similarly provide filtering. Something that would give
>>> users a more intuitive place to look.
>>>
>>
>> Doing the sorting via header clicks is convenient but very
>> restrictive. How do you specify multiple columns to sort by for example?
>> The current design allows you to select columns and the sort order as you
>> see fit.
>>
>
 Honestly I'm not sold on my idea, I was just proposing an alternative
 in an effort to start a discussion about the user experience. Ideally what
 I'd like to see, maybe this happened, is some user research. When we
 initial worked on refactoring the results grid we made a bunch of changes.
 One of the things we intended to do was to follow up to see how people were
 using the grid now so that we could better understand how it was now being
 used in order to design and implement features just like this. Clearly we
 haven't gotten there yet.


>
> Another reason we can't use that because w
> e have already occupied that behaviour for selecting entire column
> ​ when user clicks on header.
> As Dave suggested, I will be merging it with filter dialog meaning it
> will be accessible via direct button on toolbar & keyboard shortcut.​
> ​
>

 How are users currently interacting with that filter dialog?

>>>
>>> ​By clicking on the toolbar button as well as keyboard shortcut.
>>> ​
>>>
>>>
>>>
>>>
>>
>> Sorry I wasn't clear. My question was more along the lines of, do we
>> know if people are using the filter functionality?  What kind of filters
>> are people using?  What do they like about it? What do they wish they could
>> do above and beyond sorting, etc.
>>
>
> Yes, they are, based on the fact we've had issues reported in the past. We
> have no idea how they are using it.
>
> Sorting is a separate feature that is often requested. The only reason
> it's connected here is that both functionalities in pgAdmin 3 were managed
> through the same dialogue which based on lack of complaints from users,
> generally worked for them. I do know that the proposed "click on headers"
> approach will not work for me, as I have multi-part keys in databases which
> I like to sort by in specific ways.
>
>
As far as the 'click on header' is concerned I think Murtuza's objection is
very valid. I think my overall point is that I believe that sorting and
filtering is a legitimate pain but it is a pain I don't fully understand.
The solution as presented certainly works it just doesn't feel nice. My
concern is that it won't be clear to users what they should do or expect
since the UX is unique to pgAdmin. Less of a concern is that all of these
changes are only happening with the 'view data' section of the code and I
would assume that people who have queried the DB will also have the need to
sort a

Re: [pgAdmin4][RM#3055] Allow user to sort the data in View data mode

2018-03-28 Thread Dave Page
On Wed, Mar 28, 2018 at 2:54 PM, Robert Eckhardt 
wrote:

>
>
> On Wed, Mar 28, 2018 at 4:12 AM, Dave Page  wrote:
>
>>
>>
>> On Wed, Mar 28, 2018 at 1:37 AM, Robert Eckhardt 
>> wrote:
>>
>>>
>>>
>>> On Tue, Mar 27, 2018 at 9:54 AM, Murtuza Zabuawala <
>>> murtuza.zabuaw...@enterprisedb.com> wrote:
>>>


 On Tue, Mar 27, 2018 at 7:06 PM, Robert Eckhardt 
 wrote:

>
>
> On Tue, Mar 27, 2018 at 6:25 AM, Murtuza Zabuawala <
> murtuza.zabuaw...@enterprisedb.com> wrote:
>
>> On Tue, Mar 27, 2018 at 3:13 PM, Dave Page  wrote:
>>
>>>
>>>
>>> On Mon, Mar 26, 2018 at 9:26 PM, Robert Eckhardt <
>>> reckha...@pivotal.io> wrote:
>>>


 On Mon, Mar 26, 2018 at 2:07 PM, Joao De Almeida Pereira <
 jdealmeidapere...@pivotal.io> wrote:

> Hi Hackers,
>
> @Murtuza: The patch codewise looks good. Nice to see that we are
> using axios instead of jquery ajax calls and that there is some 
> coverage
> for the change.
> Nevertheless the Javascript testing looks a bit slim and could be
> improved. Also the DataSorting class could have some other member 
> functions
> like the model validation could be extracted out so that it is easily
> tested.
>
>
> @Hackers: This was how we tried to test this feature:
> 1 - Started pgAdmin
> 2 - Opened the query tool for a specific server
> 3 - Executed a SQL statment
> 4 - Pressed the column header to try to order, nothing happened
> 5 - Right clicked the column header to see if it was there the
> option, nothing
>
> This is the behavior that we were expecting, not to have to open
> Data View and then press the icon that is not even near the grid in 
> order
> to sort the column. Is this really the way we want people to use the 
> grid
> in pgAdmin? Should it be more intuitive?
>

 Have we considered making the grid behave more like excel or other
 grids? I think that having the ascending and descending inside the 
 column
 header, we could similarly provide filtering. Something that would give
 users a more intuitive place to look.

>>>
>>> Doing the sorting via header clicks is convenient but very
>>> restrictive. How do you specify multiple columns to sort by for example?
>>> The current design allows you to select columns and the sort order as 
>>> you
>>> see fit.
>>>
>>
> Honestly I'm not sold on my idea, I was just proposing an alternative
> in an effort to start a discussion about the user experience. Ideally what
> I'd like to see, maybe this happened, is some user research. When we
> initial worked on refactoring the results grid we made a bunch of changes.
> One of the things we intended to do was to follow up to see how people 
> were
> using the grid now so that we could better understand how it was now being
> used in order to design and implement features just like this. Clearly we
> haven't gotten there yet.
>
>
>>
>> Another reason we can't use that because w
>> e have already occupied that behaviour for selecting entire column
>> ​ when user clicks on header.
>> As Dave suggested, I will be merging it with filter dialog meaning it
>> will be accessible via direct button on toolbar & keyboard shortcut.​
>> ​
>>
>
> How are users currently interacting with that filter dialog?
>

 ​By clicking on the toolbar button as well as keyboard shortcut.
 ​




>>>
>>> Sorry I wasn't clear. My question was more along the lines of, do we
>>> know if people are using the filter functionality?  What kind of
>>> filters are people using?  What do they like about it? What do they wish
>>> they could do above and beyond sorting, etc.
>>>
>>
>> Yes, they are, based on the fact we've had issues reported in the past.
>> We have no idea how they are using it.
>>
>> Sorting is a separate feature that is often requested. The only reason
>> it's connected here is that both functionalities in pgAdmin 3 were managed
>> through the same dialogue which based on lack of complaints from users,
>> generally worked for them. I do know that the proposed "click on headers"
>> approach will not work for me, as I have multi-part keys in databases which
>> I like to sort by in specific ways.
>>
>>
> As far as the 'click on header' is concerned I think Murtuza's objection
> is very valid. I think my overall point is that I believe that sorting and
> filtering is a legitimate pain but it is a pain I don't fully understand.
> The solution as presented certainly works it just doesn't feel nice. My
> concern is that it won't be clear to users what they should do or expect
> since the UX is u

Re: [pgAdmin4][RM#3055] Allow user to sort the data in View data mode

2018-03-28 Thread Robert Eckhardt
On Wed, Mar 28, 2018 at 11:20 AM, Dave Page  wrote:

>
>
> On Wed, Mar 28, 2018 at 2:54 PM, Robert Eckhardt 
> wrote:
>
>>
>>
>> On Wed, Mar 28, 2018 at 4:12 AM, Dave Page  wrote:
>>
>>>
>>>
>>> On Wed, Mar 28, 2018 at 1:37 AM, Robert Eckhardt 
>>> wrote:
>>>


 On Tue, Mar 27, 2018 at 9:54 AM, Murtuza Zabuawala <
 murtuza.zabuaw...@enterprisedb.com> wrote:

>
>
> On Tue, Mar 27, 2018 at 7:06 PM, Robert Eckhardt  > wrote:
>
>>
>>
>> On Tue, Mar 27, 2018 at 6:25 AM, Murtuza Zabuawala <
>> murtuza.zabuaw...@enterprisedb.com> wrote:
>>
>>> On Tue, Mar 27, 2018 at 3:13 PM, Dave Page 
>>> wrote:
>>>


 On Mon, Mar 26, 2018 at 9:26 PM, Robert Eckhardt <
 reckha...@pivotal.io> wrote:

>
>
> On Mon, Mar 26, 2018 at 2:07 PM, Joao De Almeida Pereira <
> jdealmeidapere...@pivotal.io> wrote:
>
>> Hi Hackers,
>>
>> @Murtuza: The patch codewise looks good. Nice to see that we are
>> using axios instead of jquery ajax calls and that there is some 
>> coverage
>> for the change.
>> Nevertheless the Javascript testing looks a bit slim and could be
>> improved. Also the DataSorting class could have some other member 
>> functions
>> like the model validation could be extracted out so that it is easily
>> tested.
>>
>>
>> @Hackers: This was how we tried to test this feature:
>> 1 - Started pgAdmin
>> 2 - Opened the query tool for a specific server
>> 3 - Executed a SQL statment
>> 4 - Pressed the column header to try to order, nothing happened
>> 5 - Right clicked the column header to see if it was there the
>> option, nothing
>>
>> This is the behavior that we were expecting, not to have to open
>> Data View and then press the icon that is not even near the grid in 
>> order
>> to sort the column. Is this really the way we want people to use the 
>> grid
>> in pgAdmin? Should it be more intuitive?
>>
>
> Have we considered making the grid behave more like excel or other
> grids? I think that having the ascending and descending inside the 
> column
> header, we could similarly provide filtering. Something that would 
> give
> users a more intuitive place to look.
>

 Doing the sorting via header clicks is convenient but very
 restrictive. How do you specify multiple columns to sort by for 
 example?
 The current design allows you to select columns and the sort order as 
 you
 see fit.

>>>
>> Honestly I'm not sold on my idea, I was just proposing an alternative
>> in an effort to start a discussion about the user experience. Ideally 
>> what
>> I'd like to see, maybe this happened, is some user research. When we
>> initial worked on refactoring the results grid we made a bunch of 
>> changes.
>> One of the things we intended to do was to follow up to see how people 
>> were
>> using the grid now so that we could better understand how it was now 
>> being
>> used in order to design and implement features just like this. Clearly we
>> haven't gotten there yet.
>>
>>
>>>
>>> Another reason we can't use that because w
>>> e have already occupied that behaviour for selecting entire column
>>> ​ when user clicks on header.
>>> As Dave suggested, I will be merging it with filter dialog meaning
>>> it will be accessible via direct button on toolbar & keyboard shortcut.​
>>> ​
>>>
>>
>> How are users currently interacting with that filter dialog?
>>
>
> ​By clicking on the toolbar button as well as keyboard shortcut.
> ​
>
>
>
>

 Sorry I wasn't clear. My question was more along the lines of, do we
 know if people are using the filter functionality?  What kind of
 filters are people using?  What do they like about it? What do they wish
 they could do above and beyond sorting, etc.

>>>
>>> Yes, they are, based on the fact we've had issues reported in the past.
>>> We have no idea how they are using it.
>>>
>>> Sorting is a separate feature that is often requested. The only reason
>>> it's connected here is that both functionalities in pgAdmin 3 were managed
>>> through the same dialogue which based on lack of complaints from users,
>>> generally worked for them. I do know that the proposed "click on headers"
>>> approach will not work for me, as I have multi-part keys in databases which
>>> I like to sort by in specific ways.
>>>
>>>
>> As far as the 'click on header' is concerned I think Murtuza's objection
>> is very valid. I think my overall point is that I believe that sorting and
>

Re: [pgAdmin4][RM#3055] Allow user to sort the data in View data mode

2018-03-28 Thread Dave Page
On Wed, Mar 28, 2018 at 4:28 PM, Robert Eckhardt 
wrote:

>
>
> On Wed, Mar 28, 2018 at 11:20 AM, Dave Page  wrote:
>
>>
>>
>> On Wed, Mar 28, 2018 at 2:54 PM, Robert Eckhardt 
>> wrote:
>>
>>>
>>>
>>> On Wed, Mar 28, 2018 at 4:12 AM, Dave Page  wrote:
>>>


 On Wed, Mar 28, 2018 at 1:37 AM, Robert Eckhardt 
 wrote:

>
>
> On Tue, Mar 27, 2018 at 9:54 AM, Murtuza Zabuawala <
> murtuza.zabuaw...@enterprisedb.com> wrote:
>
>>
>>
>> On Tue, Mar 27, 2018 at 7:06 PM, Robert Eckhardt <
>> reckha...@pivotal.io> wrote:
>>
>>>
>>>
>>> On Tue, Mar 27, 2018 at 6:25 AM, Murtuza Zabuawala <
>>> murtuza.zabuaw...@enterprisedb.com> wrote:
>>>
 On Tue, Mar 27, 2018 at 3:13 PM, Dave Page 
 wrote:

>
>
> On Mon, Mar 26, 2018 at 9:26 PM, Robert Eckhardt <
> reckha...@pivotal.io> wrote:
>
>>
>>
>> On Mon, Mar 26, 2018 at 2:07 PM, Joao De Almeida Pereira <
>> jdealmeidapere...@pivotal.io> wrote:
>>
>>> Hi Hackers,
>>>
>>> @Murtuza: The patch codewise looks good. Nice to see that we are
>>> using axios instead of jquery ajax calls and that there is some 
>>> coverage
>>> for the change.
>>> Nevertheless the Javascript testing looks a bit slim and could
>>> be improved. Also the DataSorting class could have some other member
>>> functions like the model validation could be extracted out so that 
>>> it is
>>> easily tested.
>>>
>>>
>>> @Hackers: This was how we tried to test this feature:
>>> 1 - Started pgAdmin
>>> 2 - Opened the query tool for a specific server
>>> 3 - Executed a SQL statment
>>> 4 - Pressed the column header to try to order, nothing happened
>>> 5 - Right clicked the column header to see if it was there the
>>> option, nothing
>>>
>>> This is the behavior that we were expecting, not to have to open
>>> Data View and then press the icon that is not even near the grid in 
>>> order
>>> to sort the column. Is this really the way we want people to use 
>>> the grid
>>> in pgAdmin? Should it be more intuitive?
>>>
>>
>> Have we considered making the grid behave more like excel or
>> other grids? I think that having the ascending and descending inside 
>> the
>> column header, we could similarly provide filtering. Something that 
>> would
>> give users a more intuitive place to look.
>>
>
> Doing the sorting via header clicks is convenient but very
> restrictive. How do you specify multiple columns to sort by for 
> example?
> The current design allows you to select columns and the sort order as 
> you
> see fit.
>

>>> Honestly I'm not sold on my idea, I was just proposing an
>>> alternative in an effort to start a discussion about the user 
>>> experience.
>>> Ideally what I'd like to see, maybe this happened, is some user 
>>> research.
>>> When we initial worked on refactoring the results grid we made a bunch 
>>> of
>>> changes. One of the things we intended to do was to follow up to see how
>>> people were using the grid now so that we could better understand how it
>>> was now being used in order to design and implement features just like
>>> this. Clearly we haven't gotten there yet.
>>>
>>>

 Another reason we can't use that because w
 e have already occupied that behaviour for selecting entire column
 ​ when user clicks on header.
 As Dave suggested, I will be merging it with filter dialog meaning
 it will be accessible via direct button on toolbar & keyboard 
 shortcut.​
 ​

>>>
>>> How are users currently interacting with that filter dialog?
>>>
>>
>> ​By clicking on the toolbar button as well as keyboard shortcut.
>> ​
>>
>>
>>
>>
>
> Sorry I wasn't clear. My question was more along the lines of, do we
> know if people are using the filter functionality?  What kind of
> filters are people using?  What do they like about it? What do they wish
> they could do above and beyond sorting, etc.
>

 Yes, they are, based on the fact we've had issues reported in the past.
 We have no idea how they are using it.

 Sorting is a separate feature that is often requested. The only reason
 it's connected here is that both functionalities in pgAdmin 3 were managed
 through the same dialogue which based on lack of complaints from users,
 generally worked for them. I do know that the proposed "click on headers"
 approach will not work for me, as I have multi-part keys

How to enable debug mode to See changes on the fly?

2018-03-28 Thread Rahul Soshte
In my config_local.py I have made DEBUG_MODE = TRUE
Even then when I make changes to files in the codebase I am not able to see
the changes instantly, I gotta restart the server again and again.I dont
want to restart the server again and again to see my changes.
What do I do?


Re: Bug #3083 fix

2018-03-28 Thread Joao De Almeida Pereira
Hey Akshay and Neethu

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

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

Sincerely,

Joao and Victoria

On Wed, Mar 28, 2018 at 8:03 AM Akshay Joshi 
wrote:

> Hi
>
> On Fri, Mar 2, 2018 at 3:40 AM, Joao De Almeida Pereira <
> jdealmeidapere...@pivotal.io> wrote:
>
>> Hello Neethu,
>> We passed the patch through our CI pipeline and all tests pass.
>> The code looks good, but we are trying to decouple files as much  as we
>> can so that we do not end up with files with over 1000 lines, that are hard
>> to read and to maintain. Also we are trying to create Unit Tests to have
>> more coverage in our Javascript code.
>>
>> Can you split the new implementation code into it's own file and create
>> some tests to ensure the behavior will not be broken in the future?iYou
>> have some examples
>> on: pgadmin/browser/server_groups/servers/databases/external_tables/*
>>
>
> I have spilt the new implementation into different file. Its' been
> hard to write jasmine/feature test case as it requires drag event and exact
> co-ordinate to resize the slickgrid cell.
> Attached is the modified patch.
>
>
>>
>> Thanks
>> Joao
>>
>> On Thu, Mar 1, 2018 at 10:37 AM Neethu Mariya Joy <
>> neethumariya...@gmail.com> wrote:
>>
>>> Hi,
>>> I am Neethu Mariya Joy, an undergraduate pursuing BE in Computer Science
>>> at BITS Pilani.
>>>
>>> I've attempted to fix https://redmine.postgresql.org/issues/3083. Since
>>> the textarea resize feature is the default HTML feature, I have not changed
>>> it. Instead, I've added draggable borders to the wrapper which expands the
>>> textarea inside it.
>>>
>>> I'm attaching my patch as bug3083.diff below as per the contribution
>>> guidelines.
>>>
>>> Hope this helps. Thank you for your consideration!
>>>
>>> Sincerely,
>>> Neethu Mariya Joy
>>> GitHub  | Linkedin
>>> 
>>>
>>>
>>>
>
>
> --
> *Akshay Joshi*
>
> *Sr. Software Architect *
>
>
>
> *Phone: +91 20-3058-9517 <+91%2020%203058%209517>Mobile: +91 976-788-8246
> <+91%2097678%2088246>*
>
diff --git a/web/pgadmin/static/js/slickgrid/editors.js b/web/pgadmin/static/js/slickgrid/editors.js
index 7652bf3b..a7df4baf 100644
--- a/web/pgadmin/static/js/slickgrid/editors.js
+++ b/web/pgadmin/static/js/slickgrid/editors.js
@@ -3,8 +3,9 @@
  * @module Editors
  * @namespace Slick
  */
+import {resizeContentOnDrag} from 'resize_editor';
 
-(function($) {
+(function ($) {
   // register namespace
   $.extend(true, window, {
 'Slick': {
@@ -52,6 +53,7 @@
 val = $.trim(val);
 return !(val != '' && (val.charAt(0) != '{' || val.charAt(val.length - 1) != '}'));
   }
+
   /*
* This function handles the [default] and [null] values for cells
* if row is copied, otherwise returns the editor value.
@@ -129,7 +131,7 @@
 var defaultValue;
 var scope = this;
 
-this.init = function() {
+this.init = function () {
   var $container = $('body');
 
   $wrapper = getWrapper().appendTo($container);
@@ -140,11 +142,12 @@
   $buttons.find('button:last').on('click', this.cancel);
   $input.bind('keydown', this.handleKeyDown);
 
+  resizeContentOnDrag($wrapper, $input);
   scope.position(args.position);
   $input.focus().select();
 };
 
-this.handleKeyDown = function(e) {
+this.handleKeyDown = function (e) {
   if (e.which == $.ui.keyCode.ENTER && e.ctrlKey) {
 scope.save();
   } else if (e.which == $.ui.keyCode.ESCAPE) {
@@ -159,40 +162,40 @@
   }
 };
 
-this.save = function() {
+this.save = function () {
   args.commitChanges();
 };
 
-this.cancel = function() {
+this.cancel = function () {
   $input.val(defaultValue);
   args.cancelChanges();
 };
 
-this.hide = function() {
+this.hide = function () {
   $wrapper.hide();
 };
 
-this.show = function() {
+this.show = function () {
   $wrapper.show();
 };
 
-this.position = function(position) {
+this.position = function (position) {
   calculateEditorPosition(position, $wrapper);
   $wrapper
 .css('top', position.top)
 .css('left', position.left);
 };
 
-this.destroy = function() {
+this.destroy = function () {
   $wrapper.remove();
 };
 
-this.focus = function() {
+this.focus = function () {
   $input.focus();
 };
 
 // When text editor opens
-this.loadValue = function(item) {
+this.loadValue = function (item) {
   if (
 _.isUndefined(item[args.column.field]) ||
 _.isNull

Re: How to enable debug mode to See changes on the fly?

2018-03-28 Thread Joao De Almeida Pereira
Hello Rahul,
In fact when you change python code there isn't much you can do, you need
to restart the server every time.
For the Javascript code you can have a second console open and run `yarn
bundle:watch` and it will regenerate the javascript code and you just need
to refresh the webpage on the browser.

Thanks
Victoria & Joao

On Wed, Mar 28, 2018 at 12:23 PM Rahul Soshte 
wrote:

> In my config_local.py I have made DEBUG_MODE = TRUE
> Even then when I make changes to files in the codebase I am not able to
> see the changes instantly, I gotta restart the server again and again.I
> dont want to restart the server again and again to see my changes.
> What do I do?
>


Jasmine introduction

2018-03-28 Thread Joao De Almeida Pereira
Hi Hackers,

In one of the other thread Murtuza asked for more information about jasmine
framework and we dig up some information about it.
Jasmine is a lightweight framework that allow you to write tests in a
behavior-driven style. Because of this it is a very easy to use framework
with very few functions. The Jasmine website as documentation that explain
how to use it, by example (https://jasmine.github.io/2.9/introduction.html
).

If you want to play a little bit around with it you can look at
https://jasmine.github.io/setup/nodejs.html where it give you some simple
way to setup some examples that you can modify and see how it works.

If you have any question about jasmine or about how we do testing and our
approach to it, feel free to reach out.

Thanks
Victoria & Joao


Re: How to enable debug mode to See changes on the fly?

2018-03-28 Thread Murtuza Zabuawala
Hi,

AFAIR we intentionally disabled it. The reason for this is that due to how
the reload mechanism works there are some side-effects which was causing
executing certain code twice.
Check commit: git log a49a3103e298fcc437

If you want to enable reloading for development purposes then you can
simply change value of  use_reloader option to true, Set use_reloader = True
in ../web/pgAdmin4.py +154

Restart pgAdmin4 and it should reload server whenever you save the changes
in python files.


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


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

> Hello Rahul,
> In fact when you change python code there isn't much you can do, you need
> to restart the server every time.
> For the Javascript code you can have a second console open and run `yarn
> bundle:watch` and it will regenerate the javascript code and you just need
> to refresh the webpage on the browser.
>
> Thanks
> Victoria & Joao
>
> On Wed, Mar 28, 2018 at 12:23 PM Rahul Soshte 
> wrote:
>
>> In my config_local.py I have made DEBUG_MODE = TRUE
>> Even then when I make changes to files in the codebase I am not able to
>> see the changes instantly, I gotta restart the server again and again.I
>> dont want to restart the server again and again to see my changes.
>> What do I do?
>>
>


Re: Jasmine introduction

2018-03-28 Thread Murtuza Zabuawala
Thank you Joao, I was also googling last night and came across this free
course  on JS
testing with Jasmine.


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


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

> Hi Hackers,
>
> In one of the other thread Murtuza asked for more information about
> jasmine framework and we dig up some information about it.
> Jasmine is a lightweight framework that allow you to write tests in a
> behavior-driven style. Because of this it is a very easy to use framework
> with very few functions. The Jasmine website as documentation that explain
> how to use it, by example (https://jasmine.github.io/2.9/introduction.html
> ).
>
> If you want to play a little bit around with it you can look at
> https://jasmine.github.io/setup/nodejs.html where it give you some simple
> way to setup some examples that you can modify and see how it works.
>
> If you have any question about jasmine or about how we do testing and our
> approach to it, feel free to reach out.
>
> Thanks
> Victoria & Joao
>