Bug 29186

Summary: Move reports result limit menu into toolbar
Product: Koha Reporter: Owen Leonard <oleonard>
Component: ReportsAssignee: Owen Leonard <oleonard>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: george, kyle
Version: master   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
21.11.00
Bug Depends on:    
Bug Blocks: 29679    
Attachments: Screenshot of the proposed change
Bug 29186: Move reports result limit menu into toolbar
Bug 29186: Move reports result limit menu into toolbar
Bug 29186: (QA follow-up) Correct the check for showing limit menu
Bug 29186: (QA follow-up) Correct the check for showing limit menu
Bug 29186: Move reports result limit menu into toolbar
Bug 29186: (QA follow-up) Correct the check for showing limit menu

Description Owen Leonard 2021-10-06 15:08:09 UTC
Created attachment 125831 [details]
Screenshot of the proposed change

I propose to convert the HTML <select> for choosing the number of report results shown into a Bootstrap dropdown menu. See attached screenshot.
Comment 1 Owen Leonard 2021-10-06 15:44:59 UTC Comment hidden (obsolete)
Comment 2 Biblibre Sandboxes 2021-10-07 14:36:40 UTC Comment hidden (obsolete)
Comment 3 George Williams (NEKLS) 2021-10-07 14:37:48 UTC
Tested on BibLibre sandbox.  Works per the test plan.
Comment 4 Katrin Fischer 2021-10-10 12:01:00 UTC
Hi Owen, I am seeing something a little odd here, can you please check?

Tested on the standard sample database with a bit below 1000 items:

1) Create a new SQL report: select * from items;
2) Run the report
3) By default, 20 results show on first page.
4) Switch to 1000
5) All results show, but the pull down disappears and you can't switch the setting again.
Comment 5 Owen Leonard 2021-10-11 13:42:57 UTC Comment hidden (obsolete)
Comment 6 Katrin Fischer 2021-10-18 22:03:04 UTC
Hi Owen,

I have both patches applied and did a restart_all, but for my sample query (select * from items) I still have the issue that after switching to 1000 results per page, I can't switch back. :(

There is also a tiny issue with the results display:

Total number of results: 961 . 

Should we just remove the .?
Comment 7 Owen Leonard 2021-10-21 16:50:09 UTC Comment hidden (obsolete)
Comment 8 Katrin Fischer 2021-10-24 10:38:59 UTC
Created attachment 126800 [details] [review]
Bug 29186: Move reports result limit menu into toolbar

This patch creates a new Bootstrap button menu for selecting the number
of search results to be shown. This replaces the HTML <select>.

To test, apply the patch and go to Reports -> Saved reports.

- Test the appearance and functionality of the "Rows per page" button in
  various situations:
  - A report that returns more than 10 results
  - A report that returns fewer than 10 results
  - A report that returns no results
- Test that the batch operations button menu appears correctly when
  there are biblionumbers, itemnumbers, or cardnumbers in the results.
- When there are no results, or fewer than 10 results with no batch
  operations possible the toolbar shouldn't appear at all.

Signed-off-by: George Williams <george@nekls.org>

Signed-off-by: George Williams <george@nekls.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 9 Katrin Fischer 2021-10-24 10:39:04 UTC
Created attachment 126801 [details] [review]
Bug 29186: (QA follow-up) Correct the check for showing limit menu

The template conditional for showing the limit menu should be changed
to:

[% IF ( unlimited_total > 10 && limit <= 1000 ) %]

- "unlimited_total > 10" so that the "rows per page" button only shows
  if there are more than 10 total results, because 10 is the smallest
  increment the "rows per page" control offers.
- "limit <= 1000" so that the "rows per page" button will show when the
  current result limit is less than or equal to 1000, because 1000 is
  the upper limit to the "rows per page" control.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 10 Jonathan Druart 2021-10-25 13:58:45 UTC
Pushed to master for 21.11, thanks to everybody involved!