Bug 26486 - Group edit buttons in reports toolbar
Summary: Group edit buttons in reports toolbar
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Templates (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-09-18 11:48 UTC by Owen Leonard
Modified: 2023-12-28 20:43 UTC (History)
4 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:
22.11.00, 22.05.04, 21.11.11


Attachments
Screen grab showing operation of the toggle button and split button (150.14 KB, image/gif)
2020-09-18 11:48 UTC, Owen Leonard
Details
Bug 26486: Group edit buttons in reports toolbar (7.66 KB, patch)
2022-03-23 15:01 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 26486: Group edit buttons in reports toolbar (7.73 KB, patch)
2022-05-09 18:45 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 26486: Group edit buttons in reports toolbar (7.79 KB, patch)
2022-05-18 13:50 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Owen Leonard 2020-09-18 11:48:44 UTC
Created attachment 110377 [details]
Screen grab showing operation of the toggle button and split button

The button toolbar on SQL report pages is getting very crowded. I would like to move "Duplicate" and "Delete" into a split button menu with "Edit" as the primary function.

I would also like to use Bootstrap's toggle button feature for the "Show/Hide SQL" button. See attached screen recording.
Comment 1 Katrin Fischer 2020-09-20 22:35:59 UTC
I really like the toggle on the hide/show and see no better option than to group the others in Edit like suggested. I wonder if there is something neat we could do to the chart ones as they are quite big.
Comment 2 Owen Leonard 2022-03-23 15:01:48 UTC Comment hidden (obsolete)
Comment 3 Nick Clemens 2022-05-09 18:45:14 UTC Comment hidden (obsolete)
Comment 4 Jonathan Druart 2022-05-18 13:50:17 UTC
Created attachment 135112 [details] [review]
Bug 26486: Group edit buttons in reports toolbar

This patch modifies the reports interface to change the reports toolbar
in two ways:

1. The Edit, Duplicate, and Delete buttons are now combined into a
   button menu. My original idea was to have it be a split button, but
   the logic for handling various permissions made the template logic
   too convoluted.
2. The "Show SQL code" button is converted to a "Single toggle" button
   (https://getbootstrap.com/docs/3.3/javascript/#buttons-single-toggle).
   This type of button is specifically designed for this kind of
   interface element.

This patch includes indendation changes, so please diff accordingly.

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

- Logged in as a user with Create and Delete report
  permissions:
  - View an SQL report. In the toolbar you should see an "Edit" button
    menu with three options: Edit, Duplicate, and Delete. Check that all
    work correctly, including a deletion JavaScript confirmation dialog.

- Logged in as a user with Create but not Delete report permissions, you
  should see an "Edit" button menu with two choices: Edit and Duplicate.

- Logged in as a user with Delete but not Create report permission (??)
  you should see only a standalone delete button.

- Logged in as a user with Execute report permission, run an SQL report.
  Test the "Show SQL code" button. The text should change to "Hide SQL
  code" and the button should be styled to look like its "pressed"
  state.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 5 Tomás Cohen Arazi 2022-06-27 16:25:42 UTC
Pushed to master for 22.11.

Nice work everyone, thanks!
Comment 6 Lucas Gass 2022-07-29 16:52:09 UTC
Backported to 22.05.x for 22.05.04
Comment 7 Arthur Suzuki 2022-08-11 12:59:37 UTC
pushed to 21.11.x for 21.11.11
Comment 8 Victor Grousset/tuxayo 2022-08-13 16:28:02 UTC
Not backported to oldoldstable (21.05.x). Feel free to ask if it's needed.
Comment 9 Caroline Cyr La Rose 2023-05-09 19:00:54 UTC
Screenshots that show this seem to already have been updated.