Bug 26486

Summary: Group edit buttons in reports toolbar
Product: Koha Reporter: Owen Leonard <oleonard>
Component: TemplatesAssignee: Owen Leonard <oleonard>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: arthur.suzuki, caroline.cyr-la-rose, lucas, victor
Version: Main   
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:
22.11.00, 22.05.04, 21.11.11
Attachments: Screen grab showing operation of the toggle button and split button
Bug 26486: Group edit buttons in reports toolbar
Bug 26486: Group edit buttons in reports toolbar
Bug 26486: Group edit buttons in reports toolbar

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.