Bug 37740

Summary: Saved reports GROUP tabs don't show the proper panel
Product: Koha Reporter: Lucas Gass (lukeg) <lucas>
Component: ReportsAssignee: Owen Leonard <oleonard>
Status: Pushed to main --- QA Contact: Lucas Gass (lukeg) <lucas>
Severity: normal    
Priority: P5 - low CC: chloe.zermatten
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
24.11.00
Circulation function:
Bug Depends on: 35402    
Bug Blocks:    
Attachments: Bug 37740: Fix saved SQL reports tab switching
Bug 37740: Fix saved SQL reports tab switching
Bug 37740: Fix saved SQL reports tab switching

Description Lucas Gass (lukeg) 2024-08-26 22:10:45 UTC
TO recreate:
1. Have some reports and report groups.
2. GO to Reports > Used Saved
3. The 'All' tab properly shows reports.
4. All other tabs have no reports listed. It doesn't appear like the panels are being built. 

Looks to be caused by Bug 35402.
Comment 1 Lucas Gass (lukeg) 2024-08-27 21:32:30 UTC
I'm not sure what got lost. It seems like there was only a single panel being built 'reports_panel' ( [% WRAPPER tab_panels %] ).

However, when building the nav-links all the groups are looped through ( [% FOREACH group IN groups_with_subgroups %] ). ( [% WRAPPER tabs_nav %] )

We cannot build many tabs and only a single panel. It creates bad HTML.
Comment 2 Owen Leonard 2024-08-28 18:43:55 UTC
Created attachment 170838 [details] [review]
Bug 37740: Fix saved SQL reports tab switching

The tabs on the saved SQL report page are not really full tabs, they're
just styled that way. There is only one tab "panel," and clicking each
tab triggers a DataTable filter so that the tab only shows the relevant
data.

The problem with this setup is that when Bootstrap tries to "switch"
tabs, it wants to hide the initial tab and then show the new one. There
is no "new" one here.

The attached patch solves this problem by adding a CSS rule to
guided_reports_start.tt with higher specificity than our global CSS
making the relevant tab pane visible at all times.

To test, apply the patch and go to Reports -> Use saved.

- If necessary, create multiple SQL reports and assign them to different
  report groups (Accounts, Acquisitions, Catalog, etc.).
- Test that tab switching works:
  - The tab should be style as "active" after you click it.
  - The table of reports should be filtered to include only reports in
    the relevant report group.
Comment 3 Chloe Zermatten 2024-08-29 14:16:42 UTC
Created attachment 170871 [details] [review]
Bug 37740: Fix saved SQL reports tab switching

The tabs on the saved SQL report page are not really full tabs, they're
just styled that way. There is only one tab "panel," and clicking each
tab triggers a DataTable filter so that the tab only shows the relevant
data.

The problem with this setup is that when Bootstrap tries to "switch"
tabs, it wants to hide the initial tab and then show the new one. There
is no "new" one here.

The attached patch solves this problem by adding a CSS rule to
guided_reports_start.tt with higher specificity than our global CSS
making the relevant tab pane visible at all times.

To test, apply the patch and go to Reports -> Use saved.

- If necessary, create multiple SQL reports and assign them to different
  report groups (Accounts, Acquisitions, Catalog, etc.).
- Test that tab switching works:
  - The tab should be style as "active" after you click it.
  - The table of reports should be filtered to include only reports in
    the relevant report group.

Signed-off-by: Chloe Zermatten <chloe.zermatten@ptfs-europe.com>
Comment 4 Lucas Gass (lukeg) 2024-08-29 19:14:03 UTC
Created attachment 170879 [details] [review]
Bug 37740: Fix saved SQL reports tab switching

The tabs on the saved SQL report page are not really full tabs, they're
just styled that way. There is only one tab "panel," and clicking each
tab triggers a DataTable filter so that the tab only shows the relevant
data.

The problem with this setup is that when Bootstrap tries to "switch"
tabs, it wants to hide the initial tab and then show the new one. There
is no "new" one here.

The attached patch solves this problem by adding a CSS rule to
guided_reports_start.tt with higher specificity than our global CSS
making the relevant tab pane visible at all times.

To test, apply the patch and go to Reports -> Use saved.

- If necessary, create multiple SQL reports and assign them to different
  report groups (Accounts, Acquisitions, Catalog, etc.).
- Test that tab switching works:
  - The tab should be style as "active" after you click it.
  - The table of reports should be filtered to include only reports in
    the relevant report group.

Signed-off-by: Chloe Zermatten <chloe.zermatten@ptfs-europe.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 5 Katrin Fischer 2024-08-30 10:46:38 UTC
Pushed for 24.11!

Well done everyone, thank you!