Bug 29186 - Move reports result limit menu into toolbar
Summary: Move reports result limit menu into toolbar
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Reports (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 29679
  Show dependency treegraph
 
Reported: 2021-10-06 15:08 UTC by Owen Leonard
Modified: 2022-12-12 21:24 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
21.11.00
Circulation function:


Attachments
Screenshot of the proposed change (53.17 KB, image/png)
2021-10-06 15:08 UTC, Owen Leonard
Details
Bug 29186: Move reports result limit menu into toolbar (16.78 KB, patch)
2021-10-06 15:44 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 29186: Move reports result limit menu into toolbar (16.88 KB, patch)
2021-10-07 14:36 UTC, Biblibre Sandboxes
Details | Diff | Splinter Review
Bug 29186: (QA follow-up) Correct the check for showing limit menu (4.26 KB, patch)
2021-10-11 13:42 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 29186: (QA follow-up) Correct the check for showing limit menu (4.51 KB, patch)
2021-10-21 16:50 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 29186: Move reports result limit menu into toolbar (16.94 KB, patch)
2021-10-24 10:38 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 29186: (QA follow-up) Correct the check for showing limit menu (4.58 KB, patch)
2021-10-24 10:39 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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!