Re: Fixed RM #1356 - Mailing list pgadmin-hackers

From Akshay Joshi
Subject Re: Fixed RM #1356
Date
Msg-id CANxoLDc23dJRX4FmkAOkVA1CUm7z_UEg0Rsv8GnE6LuM5ttCSA@mail.gmail.com
Whole thread Raw
In response to Re: Fixed RM #1356  (Dave Page <dpage@pgadmin.org>)
Responses Re: Fixed RM #1356  (Akshay Joshi <akshay.joshi@enterprisedb.com>)
List pgadmin-hackers
Hi

On Wed, Jun 15, 2016 at 5:54 PM, Dave Page <dpage@pgadmin.org> wrote:


On Wed, Jun 15, 2016 at 1:16 PM, Ashesh Vashi <ashesh.vashi@enterprisedb.com> wrote:

On Wed, Jun 15, 2016 at 5:44 PM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote:



On Wed, Jun 15, 2016 at 5:25 PM, Dave Page <dpage@pgadmin.org> wrote:
Hi

On Wed, Jun 15, 2016 at 11:27 AM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote:
Hi 

I have fixed RM #1356 "Query tool enhancement". I have added the logic to preferences which checks the min/max value before setting it. If value given by user is less than min value then set it to min value and if value is greater then max value then set it to max value.

For "items_per_page" minimum value is 1. Attached is the patch file. Please review it.   

That doesn't do what I asked for though. A value of zero should be acceptable (I did say <= 0, but = 0 is probably better), and mean 'disable paging' (i.e. display unlimited rows, and completely hide the paging controls). From the ticket:

1) If "Items per page in grid" <= 0, then never page results. Add a note to that effect on the Preferences pane, and make zero the default value.

The patch does appear to implement:

    Backbone's Pageble Collection don't allow Zero value. Below is the check present in "backbone.paginator.js" file:
      
        if (pageSize < 1) {
          throw new RangeError("`pageSize` must be >= 1");
        }
We can avoid using the Pageable Collection in our code, when pageSize is <= 0 to fix the issue. 

Exactly. The entire point of the change is to default to not paging at all.

BTW, this may be helpful (also missed from the original patch): 

help_str=gettext('The number of rows to display per page in the results grid. A value of 0 will disable paging.'),

   Fixed above as per suggestion. Attached is the modified patch file. Please review it.   
 
--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

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



--
Akshay Joshi
Principal Software Engineer 


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

pgadmin-hackers by date:

Previous
From: Ashesh Vashi
Date:
Subject: Re: Regarding issue 1241
Next
From: Akshay Joshi
Date:
Subject: Re: Fixed RM #1356