Bug 34131 - Plugins page breadcrumbs and side menu not consistent
Summary: Plugins page breadcrumbs and side menu not consistent
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Staff interface (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor
Assignee: Pedro Amorim
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-06-27 12:46 UTC by Pedro Amorim
Modified: 2023-12-28 20:47 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:
23.11.00,23.05.02,22.11.08
Circulation function:


Attachments
Bug 34131: Update breadcrumbs and side bar (2.53 KB, patch)
2023-06-27 12:47 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 34131: Add 'current' class on correct side menu link (1.45 KB, patch)
2023-06-27 12:47 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 34131: Update breadcrumbs and side bar (2.58 KB, patch)
2023-06-27 14:01 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 34131: Add 'current' class on correct side menu link (1.51 KB, patch)
2023-06-27 14:01 UTC, Owen Leonard
Details | Diff | Splinter Review
ill_availability_services (99.75 KB, image/png)
2023-07-07 10:41 UTC, Pedro Amorim
Details
Bug 34131: (QA follow-up): Add 'ill_availability_services' to method filter check (1.48 KB, patch)
2023-07-07 10:47 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 34131: (QA follow-up) Update page title to reflect breadcrumbs and side-menu behaviour (1.06 KB, patch)
2023-07-07 10:47 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 34131: Update breadcrumbs and side bar (2.66 KB, patch)
2023-07-07 11:54 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 34131: Add 'current' class on correct side menu link (1.58 KB, patch)
2023-07-07 11:54 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 34131: (QA follow-up): Add 'ill_availability_services' to method filter check (1.56 KB, patch)
2023-07-07 11:54 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 34131: (QA follow-up) Update page title to reflect breadcrumbs and side-menu behaviour (1.13 KB, patch)
2023-07-07 11:54 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 Pedro Amorim 2023-06-27 12:46:14 UTC
Install a tool plugin:
https://github.com/bywatersolutions/koha-plugin-label-maker/releases/tag/v1.1.2

Install a non-tool plugin:
https://github.com/PTFS-Europe/koha-plugin-ill-avail-browzine/releases/tag/1.0.2

1) Go to admin and click "Manage plugins", check the side menu, it's highlighted on "Tool plugins" and the side menu is from tools, not admin.
2) Go to admin and click "Manage jobs", check the side menu, "Plugins" is there, but when you click on it, you go to 1), and can't come back.
3) On the plugin page at /cgi-bin/koha/plugins/plugins-home.pl
Notice how the breadcrumbs are "Tools > Plugins" even when "View plugins by class" is set to all, or a different plugin class.
4) Apply patch, verify again.
Comment 1 Pedro Amorim 2023-06-27 12:47:25 UTC
Created attachment 152727 [details] [review]
Bug 34131: Update breadcrumbs and side bar

Update plugins-home accordingly if tool plugins only filter is being used or not
Update breadcrumbs for plugins-disabled page
Comment 2 Pedro Amorim 2023-06-27 12:47:27 UTC
Created attachment 152728 [details] [review]
Bug 34131: Add 'current' class on correct side menu link

This changes the way we're looking for the correct menu item to set as active.
If we don't find an exact match for path+params, we attempt to set 'current' to just matching on path.
What this does is it sets the 'Plugins' menu item as active, even if the url is 'plugins-home.pl?method=report
Comment 3 Owen Leonard 2023-06-27 14:01:10 UTC
Created attachment 152745 [details] [review]
Bug 34131: Update breadcrumbs and side bar

Update plugins-home accordingly if tool plugins only filter is being
used or not.
Update breadcrumbs for plugins-disabled page

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 4 Owen Leonard 2023-06-27 14:01:12 UTC
Created attachment 152746 [details] [review]
Bug 34131: Add 'current' class on correct side menu link

This changes the way we're looking for the correct menu item to set as
active.

If we don't find an exact match for path+params, we attempt to set
'current' to just matching on path.

What this does is it sets the 'Plugins' menu item as active, even if
the url is 'plugins-home.pl?method=report

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 5 Jonathan Druart 2023-07-07 06:44:26 UTC
Can you detail what is doing the second patch?

On http://kohadev-intra.mydnsname.org:8081/cgi-bin/koha/plugins/plugins-home.pl?method=ill_availability_services ".current" is not set
Comment 6 Pedro Amorim 2023-07-07 10:41:21 UTC
Created attachment 153150 [details]
ill_availability_services

(In reply to Jonathan Druart from comment #5)
> Can you detail what is doing the second patch?
> 
> On
> http://kohadev-intra.mydnsname.org:8081/cgi-bin/koha/plugins/plugins-home.
> pl?method=ill_availability_services ".current" is not set

The patch makes it so that the ".current" class is applied to the parent side menu item even if a URL param exists, instead of matching on exact URL, potentially not containing URL params, and failing.
I can't reproduce what you're reporting, it shows for me. See attached.

I'm preparing a couple follow-up QA patches, will update bug status shortly.
Comment 7 Pedro Amorim 2023-07-07 10:47:02 UTC
Created attachment 153151 [details] [review]
Bug 34131: (QA follow-up): Add 'ill_availability_services' to method filter check
Comment 8 Pedro Amorim 2023-07-07 10:47:04 UTC
Created attachment 153152 [details] [review]
Bug 34131: (QA follow-up) Update page title to reflect breadcrumbs and side-menu behaviour
Comment 9 Jonathan Druart 2023-07-07 11:54:50 UTC
Created attachment 153164 [details] [review]
Bug 34131: Update breadcrumbs and side bar

Update plugins-home accordingly if tool plugins only filter is being
used or not.
Update breadcrumbs for plugins-disabled page

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 10 Jonathan Druart 2023-07-07 11:54:53 UTC
Created attachment 153165 [details] [review]
Bug 34131: Add 'current' class on correct side menu link

This changes the way we're looking for the correct menu item to set as
active.

If we don't find an exact match for path+params, we attempt to set
'current' to just matching on path.

What this does is it sets the 'Plugins' menu item as active, even if
the url is 'plugins-home.pl?method=report

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 11 Jonathan Druart 2023-07-07 11:54:56 UTC
Created attachment 153166 [details] [review]
Bug 34131: (QA follow-up): Add 'ill_availability_services' to method filter check

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 12 Jonathan Druart 2023-07-07 11:54:59 UTC
Created attachment 153167 [details] [review]
Bug 34131: (QA follow-up) Update page title to reflect breadcrumbs and side-menu behaviour

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 13 Tomás Cohen Arazi (tcohen) 2023-07-07 12:19:02 UTC
Pushed to master for 23.11.

Nice work everyone, thanks!
Comment 14 Martin Renvoize (ashimema) 2023-07-18 09:12:09 UTC
Thanks for all the hard work!

Pushed to 23.05.x for the next release
Comment 15 Matt Blenkinsop 2023-07-18 13:46:37 UTC
Nice work everyone!

Pushed to oldstable for 22.11.x