Bug 17794 - Menu items in Tools menu and Admin menu not bold when active but not on linked page
Summary: Menu items in Tools menu and Admin menu not bold when active but not on linke...
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Tools (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low minor (vote)
Assignee: Aleisha Amohia
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-12-19 23:04 UTC by Aleisha Amohia
Modified: 2018-06-04 20:10 UTC (History)
4 users (show)

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


Attachments
Bug 17794: 'Comments' in Tools menu is not showing as active (1.42 KB, patch)
2016-12-19 23:06 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 17794: Menu items in Tools menu and Admin menu not showing bold when active but not on linked page (3.88 KB, patch)
2016-12-21 02:34 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 17794: Menu items in Tools menu and Admin menu not showing bold when active but not on linked page (3.96 KB, patch)
2016-12-21 02:53 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 17794: Menu items in Tools menu and Admin menu not showing bold when active but not on linked page (4.08 KB, patch)
2016-12-21 02:54 UTC, Aleisha Amohia
Details | Diff | Splinter Review
[SIGNED OFF] Bug 17794: Menu items in Tools menu and Admin menu not showing bold when active but not on linked page (4.15 KB, patch)
2017-01-07 22:39 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 17794: Menu items in Tools menu and Admin menu not showing bold when active but not on linked page (4.21 KB, patch)
2017-01-11 09:53 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 Aleisha Amohia 2016-12-19 23:04:37 UTC
The 'Comments' menu item in the Tools menu takes you to the 'Comments awaiting moderation' tab by default, and the menu item is bolded (looks active). When you click the 'Approved comments' tab, the menu item is not bold, but it should be.
Comment 1 Aleisha Amohia 2016-12-19 23:06:29 UTC Comment hidden (obsolete)
Comment 2 Aleisha Amohia 2016-12-21 01:46:36 UTC
I realised that this is actually a problem with the original javascript that is meant to make 'path + params' bold, but doesn't. Affects entire tools-menu and admin-menu. Patch coming
Comment 3 Aleisha Amohia 2016-12-21 02:34:05 UTC Comment hidden (obsolete)
Comment 4 Aleisha Amohia 2016-12-21 02:53:19 UTC Comment hidden (obsolete)
Comment 5 Aleisha Amohia 2016-12-21 02:54:56 UTC Comment hidden (obsolete)
Comment 6 Katrin Fischer 2017-01-07 22:39:05 UTC
Created attachment 58654 [details] [review]
[SIGNED OFF] Bug 17794: Menu items in Tools menu and Admin menu not showing bold when active but not on linked page

To reproduce:
admin-menu
1) Go to a page like admin/categories.pl
2) Click New Category
3) Notice Patron categories in the sidebar menu is no longer bold
tools-menu
4) Go to a page like reviews/reviewswaiting.pl
5) Notice bold Comments in sidebar menu
6) Click Approved Comments tab
7) Notice no longer bold in sidebar menu
To test:
8) Apply patch and refresh page
9) Follow above steps to reproduce bug, confirm that active links are
always bold
10) Test with other links to confirm nothing has broken
Special cases
11) Go To admin -> MARC bibliographic frameworks -> Actions for any
framework -> MARC structure
12) Confirm sidebar menu link is still bold
13) Go to admin -> Authority types -> Actions for any auth type -> MARC
structure
14) Confirm sidebar menu link is still bold
15) Click Actions for any tag -> Subfields
16) Confirm sidebar menu link is still bold
17) Go to admin -> OAI sets config -> Actions for any set -> Define
mappings
18) Confirm sidebar menu link is still bold

Sponsored-by: Catalyst IT
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 7 Owen Leonard 2017-01-09 15:03:43 UTC
These comments are not a criticism of this patch, but just something I've been thinking about with regard to this area of the templates:

1. This is starting to get convoluted. At what point should we try to reevaluate how we highlight menu items? Eventually the JavaScript becomes almost as complicated as doing the logic in the template.

2. This way of doing things is going to create a problem for Bug 17858 because these menu templates include jQuery JavaScript which the browser will attempt to run before jQuery has loaded. We will need to figure out a way to make it not break.
Comment 8 Jonathan Druart 2017-01-11 09:53:30 UTC
Created attachment 58804 [details] [review]
Bug 17794: Menu items in Tools menu and Admin menu not showing bold when active but not on linked page

To reproduce:
admin-menu
1) Go to a page like admin/categories.pl
2) Click New Category
3) Notice Patron categories in the sidebar menu is no longer bold
tools-menu
4) Go to a page like reviews/reviewswaiting.pl
5) Notice bold Comments in sidebar menu
6) Click Approved Comments tab
7) Notice no longer bold in sidebar menu
To test:
8) Apply patch and refresh page
9) Follow above steps to reproduce bug, confirm that active links are
always bold
10) Test with other links to confirm nothing has broken
Special cases
11) Go To admin -> MARC bibliographic frameworks -> Actions for any
framework -> MARC structure
12) Confirm sidebar menu link is still bold
13) Go to admin -> Authority types -> Actions for any auth type -> MARC
structure
14) Confirm sidebar menu link is still bold
15) Click Actions for any tag -> Subfields
16) Confirm sidebar menu link is still bold
17) Go to admin -> OAI sets config -> Actions for any set -> Define
mappings
18) Confirm sidebar menu link is still bold

Sponsored-by: Catalyst IT
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 9 Jonathan Druart 2017-01-11 09:58:04 UTC
(In reply to Owen Leonard from comment #7)
> These comments are not a criticism of this patch, but just something I've
> been thinking about with regard to this area of the templates:
> 
> 1. This is starting to get convoluted. At what point should we try to
> reevaluate how we highlight menu items? Eventually the JavaScript becomes
> almost as complicated as doing the logic in the template.

Yes, it's hard to say.
We use another method to do that in members-menu.inc, but that requires a new line per script + 1 check per entry in the menu. So much more code to maintain.

> 2. This way of doing things is going to create a problem for Bug 17858
> because these menu templates include jQuery JavaScript which the browser
> will attempt to run before jQuery has loaded. We will need to figure out a
> way to make it not break.

Indeed, and it will not be the only one:
  git grep '$(document).ready' ../includes/ | wc -l
 => 20

Not all of them are relevant, but some are.
Comment 10 Kyle M Hall 2017-01-13 11:34:59 UTC
Pushed to master for 17.05, thanks Aleisha!
Comment 11 Katrin Fischer 2017-01-15 17:09:32 UTC
This patch has been pushed to 16.11.x and will be in 16.11.02.
Comment 12 Mason James 2017-01-27 03:04:16 UTC
Pushed to 16.05.x, for 16.05.08 release