Bug 37222 - Standardize markup for sidebar menus
Summary: Standardize markup for sidebar menus
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: Templates (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 37250
  Show dependency treegraph
 
Reported: 2024-06-28 17:46 UTC by Owen Leonard
Modified: 2024-11-13 17:00 UTC (History)
2 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:
Circulation function:


Attachments
Bug 37222: Standardize markup for sidebar menus (68.57 KB, patch)
2024-06-28 17:56 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 37222: Standardize markup for sidebar menus (91.84 KB, patch)
2024-07-05 16:37 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 37222: Standardize markup for sidebar menus (91.93 KB, patch)
2024-07-05 18:05 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 37222: Standardize markup for sidebar menus (97.33 KB, patch)
2024-07-08 15:31 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 37222: Standardize markup for sidebar menus (97.59 KB, patch)
2024-07-23 14:41 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 37222: Standardize markup for sidebar menus (97.49 KB, patch)
2024-07-26 14:52 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 37222: Standardize markup for sidebar menus (97.76 KB, patch)
2024-08-23 15:13 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 37222: Standardize markup for sidebar menus (98.47 KB, patch)
2024-09-03 17:40 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 37222: Standardize markup for sidebar menus (98.44 KB, patch)
2024-09-06 20:00 UTC, Sukhmandeep
Details | Diff | Splinter Review
Bug 37222: Standardize markup for sidebar menus (97.94 KB, patch)
2024-11-05 12:59 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 37222: Standardize markup for sidebar menus (98.58 KB, patch)
2024-11-13 17:00 UTC, Owen Leonard
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Owen Leonard 2024-06-28 17:46:03 UTC
We've got a couple of different ways we're marking up sidebar menus, and we're limiting ourselves by tying the style to an ID. There are a few cases where we want to include more than one menu in the sidebar and we shouldn't have to update CSS just to make them consistent.

I'm proposing: 

    <div id="circ-menu" class="sidebar_menu">
       <ul>
          ...
       </ul>
    </div>
Comment 1 Owen Leonard 2024-06-28 17:56:33 UTC Comment hidden (obsolete)
Comment 2 David Nind 2024-07-04 00:45:57 UTC
From my testing, the sidebar menu items are not highlighted when you are on the respective page, or a page related to that menu area.

Here are my initial notes for each area I checked:

- Circulation > Check out to a patron: is a bullet pointed list without styling

- Catalog > View a bibliographic record: OK

- Administration > View system preferences: selected group does not have a light background for sections

- Acquisitions > Acquisitions home: Acquisitions home not highlighted

- Cataloging > Stock rotation > Manage stages and manage items for a rotation: 
  . Stock rotation sidebar menu item not highlighted
  . When on other pages (Manage stages, Manage items), those are highlighted as expected at the top of the sidebar menu, but stock rotation further down the sidebar isn't (it is highlighted before the patch)

- Cataloging > Stage MARC records for import: Stage records for import sidebar menu item not highlighted (same for Managed staged records sidebar menu item)

- Reports > Acquisitions statistics: sidebar menu item not highlighted, and not highlighted on the report results page (same for other reports)

- Reports > View dictionary: sidebar menu item not highlighted

- Point of sale: sidebar menu items not highlighted

- E-resource management: tree of sub menu items not indented

- Preservation: seems OK, but I didn't add any data

- Serials: seems OK

- Tools > Patron lists: sidebar menu items not highlighted

Happy to add some screenshots if that would make it easy to understand my notes.

Testing notes (using KTD):
1. Rebuild the CSS and JS: yarn build
2. Enable these system preferences (and add appropriate data):
   - StockRotation: add a rota and items to the rota
   - ERMModule 
   - PreservationModule
   - EnablePointOfSale
   - UseCashRegisters (and add a cash register)
Comment 3 Owen Leonard 2024-07-05 16:37:47 UTC Comment hidden (obsolete)
Comment 4 Owen Leonard 2024-07-05 18:05:50 UTC Comment hidden (obsolete)
Comment 5 David Nind 2024-07-07 03:39:22 UTC
Thanks Owen!

I've had another go at testing. 

These items remain:

1. Circulation > Check out to a patron: I went to Circulation from the home page, then "Check out" from the circulation page. The sidebar menu is still a bulleted list without styling - this is the same for all other areas of Circulation where the sidebar menu is displayed:
  . In the patch, I can't match the before markup (<div id="menu">) with what is on the actual page HTML before the patch is applied
  . In the patch, the updated markup is: <div id="circ-menu" class="sidebar_menu">
  . On the page after the patch is applied, the markup is: <div id="circ-menu"> (both for Firefox and Chromium)

2. Administration > View system preferences: no change from previous testing - the section you are on (such as Administration) does not have a light background for the sub sidebar menu options for that section (for example - CAS authentication to Share anonymous usage statistics has the normal gray background, not the light gray background). (As an aside, I think I preferred the way it was before the theme update - with the submenus aligned to the right and the same text size as the group heading.)

3. Cataloging > Stock rotation > Manage stages and manage items for a rotation:  
  . When on other pages (Manage stages, Manage items), those are highlighted as expected at the top of the sidebar menu, but stock rotation further down the sidebar isn't (it was highlighted before the patch).


Other areas - either fixed or the same behavour as before the patch
===================================================================

- Catalog > View a bibliographic record: OK

- Acquisitions > Acquisitions home: OK and improvements (when on vendor page, highlights appropriate vendor sidebar menu items - didn't before) (fixed - Acquisitions home not highlighted):
  . Note that while the behavour remains the same for the vendor sidebar menu, it is a little inconsistent, but outside the scope of this bug I think:
    . Baskets: displays vendor sidebar menu + the full sidebar menu
    . Basket groups: displays vendor sidebar menu + the full sidebar menu
    . Contracts: vendor sidebar menu disappears, and displays the full sidebar menu
    . Vendor issues: only shows the vendor sidebar menu 
    . Invoices: vendor sidebar menu disappears, and displays the search filters and the full sidebar menu with Invoices highlighted
    . Uncertain prices: only shows the vendor sidebar menu 

- Cataloging > Stage MARC records for import: OK (fixed - Stage records for import sidebar menu item not highlighted (same for Managed staged records sidebar menu item))

- Reports > Acquisitions statistics: OK (fixed - sidebar menu item not highlighted, and not highlighted on the report results page (same for other reports))

- Reports > View dictionary: OK (fixed - sidebar menu item not highlighted)

- Point of sale: OK (fixed - sidebar menu items not highlighted)

- E-resource management: OK (fixed - tree of sub menu items not indented)

- Preservation: seems OK, but I didn't add any data

- Serials: OK

- Tools > Patron lists: OK (fixed - sidebar menu items not highlighted)
Comment 6 Owen Leonard 2024-07-08 15:31:34 UTC Comment hidden (obsolete)
Comment 7 David Nind 2024-07-22 21:18:20 UTC
The patch no longer applies 8-(...

git bz apply 37222

Bug 37222 - Standardize markup for sidebar menus

168595 - Bug 37222: Standardize markup for sidebar menus

Apply? [(y)es, (n)o, (i)nteractive] y
Applying: Bug 37222: Standardize markup for sidebar menus
Using index info to reconstruct a base tree...
M	koha-tmpl/intranet-tmpl/prog/en/includes/acquisitions-menu.inc
M	koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc
M	koha-tmpl/intranet-tmpl/prog/en/modules/tags/review.tt
M	t/cypress/integration/ERM/Agreements_spec.ts
M	t/cypress/integration/ERM/DataProviders_spec.ts
M	t/cypress/integration/ERM/Licenses_spec.ts
M	t/cypress/integration/ERM/Packages_spec.ts
M	t/cypress/integration/ERM/Titles_spec.ts
Falling back to patching base and 3-way merge...
Auto-merging t/cypress/integration/ERM/Titles_spec.ts
Auto-merging t/cypress/integration/ERM/Packages_spec.ts
Auto-merging t/cypress/integration/ERM/Licenses_spec.ts
Auto-merging t/cypress/integration/ERM/DataProviders_spec.ts
Auto-merging t/cypress/integration/ERM/Agreements_spec.ts
Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/tags/review.tt
Auto-merging koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc
Auto-merging koha-tmpl/intranet-tmpl/prog/en/includes/acquisitions-menu.inc
CONFLICT (content): Merge conflict in koha-tmpl/intranet-tmpl/prog/en/includes/acquisitions-menu.inc
error: Failed to merge in the changes.
Patch failed at 0001 Bug 37222: Standardize markup for sidebar menus
Comment 8 Owen Leonard 2024-07-23 14:41:57 UTC Comment hidden (obsolete)
Comment 9 Owen Leonard 2024-07-26 14:52:18 UTC Comment hidden (obsolete)
Comment 10 Owen Leonard 2024-07-26 15:29:10 UTC
Rebased.
Comment 11 Owen Leonard 2024-08-23 15:13:39 UTC
Created attachment 170640 [details] [review]
Bug 37222: Standardize markup for sidebar menus

This patch updates sidebar menu markup so that it's consistent, with a
common class (".sidebar_menu") and a unique ID. The style is tied to the
class rather than the ID, simplifying the CSS.

Note: This patch contains indentation changes so ignore whitespace when
viewing the diff.

The updated patch contains corrections to JavaScript which needed
selectors to be changed to match the new markup.

To test, apply the patch and rebuild the staff interface CSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client)

Check pages which contain each modified menu:

- Circulation -> Check out to a patron
- Catalog -> View a bibliographic record
- Administration -> View system preferences
- Acquisitions -> Acquisitions home
- Cataloging -> Stock rotation -> Manage stages and manage items for a
  rotation
- Cataloging -> Stage MARC records for import
- Reports -> Acquisitions statistics
- Reports -> View dictionary
- Point of sale
- E-resource management
- Preservation
- Serials
- Tools -> Patron lists

Sponsored-by: Athens County Public Libraries
Comment 12 Owen Leonard 2024-09-03 17:40:59 UTC
Created attachment 170997 [details] [review]
Bug 37222: Standardize markup for sidebar menus

This patch updates sidebar menu markup so that it's consistent, with a
common class (".sidebar_menu") and a unique ID. The style is tied to the
class rather than the ID, simplifying the CSS.

Note: This patch contains indentation changes so ignore whitespace when
viewing the diff.

The updated patch contains corrections to JavaScript which needed
selectors to be changed to match the new markup.

To test, apply the patch and rebuild the staff interface CSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client)

Check pages which contain each modified menu:

- Circulation -> Check out to a patron
- Catalog -> View a bibliographic record
- Administration -> View system preferences
- Acquisitions -> Acquisitions home
- Cataloging -> Stock rotation -> Manage stages and manage items for a
  rotation
- Cataloging -> Stage MARC records for import
- Reports -> Acquisitions statistics
- Reports -> View dictionary
- Point of sale
- E-resource management
- Preservation
- Serials
- Tools -> Patron lists

Sponsored-by: Athens County Public Libraries
Comment 13 Sukhmandeep 2024-09-06 20:00:34 UTC
Created attachment 171151 [details] [review]
Bug 37222: Standardize markup for sidebar menus

This patch updates sidebar menu markup so that it's consistent, with a
common class (".sidebar_menu") and a unique ID. The style is tied to the
class rather than the ID, simplifying the CSS.

Note: This patch contains indentation changes so ignore whitespace when
viewing the diff.

The updated patch contains corrections to JavaScript which needed
selectors to be changed to match the new markup.

To test, apply the patch and rebuild the staff interface CSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client)

Check pages which contain each modified menu:

- Circulation -> Check out to a patron
- Catalog -> View a bibliographic record
- Administration -> View system preferences
- Acquisitions -> Acquisitions home
- Cataloging -> Stock rotation -> Manage stages and manage items for a
  rotation
- Cataloging -> Stage MARC records for import
- Reports -> Acquisitions statistics
- Reports -> View dictionary
- Point of sale
- E-resource management
- Preservation
- Serials
- Tools -> Patron lists

Sponsored-by: Athens County Public Libraries
Signed-off-by: Sukhmandeep Benipal <sukhmandeep.benipal@inLibro.com>
Comment 14 Owen Leonard 2024-11-05 12:59:03 UTC
Created attachment 173971 [details] [review]
Bug 37222: Standardize markup for sidebar menus

This patch updates sidebar menu markup so that it's consistent, with a
common class (".sidebar_menu") and a unique ID. The style is tied to the
class rather than the ID, simplifying the CSS.

Note: This patch contains indentation changes so ignore whitespace when
viewing the diff.

The updated patch contains corrections to JavaScript which needed
selectors to be changed to match the new markup.

To test, apply the patch and rebuild the staff interface CSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client)

Check pages which contain each modified menu:

- Circulation -> Check out to a patron
- Catalog -> View a bibliographic record
- Administration -> View system preferences
- Acquisitions -> Acquisitions home
- Cataloging -> Stock rotation -> Manage stages and manage items for a
  rotation
- Cataloging -> Stage MARC records for import
- Reports -> Acquisitions statistics
- Reports -> View dictionary
- Point of sale
- E-resource management
- Preservation
- Serials
- Tools -> Patron lists

Sponsored-by: Athens County Public Libraries
Comment 15 Owen Leonard 2024-11-13 17:00:51 UTC
Created attachment 174477 [details] [review]
Bug 37222: Standardize markup for sidebar menus

This patch updates sidebar menu markup so that it's consistent, with a
common class (".sidebar_menu") and a unique ID. The style is tied to the
class rather than the ID, simplifying the CSS.

Note: This patch contains indentation changes so ignore whitespace when
viewing the diff.

The updated patch contains corrections to JavaScript which needed
selectors to be changed to match the new markup.

To test, apply the patch and rebuild the staff interface CSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client)

Check pages which contain each modified menu:

- Circulation -> Check out to a patron
- Catalog -> View a bibliographic record
- Administration -> View system preferences
- Acquisitions -> Acquisitions home
- Cataloging -> Stock rotation -> Manage stages and manage items for a
  rotation
- Cataloging -> Stage MARC records for import
- Reports -> Acquisitions statistics
- Reports -> View dictionary
- Point of sale
- E-resource management
- Preservation
- Serials
- Tools -> Patron lists

Sponsored-by: Athens County Public Libraries