Skip to content

Admin Sidebar: support optional icons for extendable submenu - #6115

Open
MMilosz wants to merge 3 commits into
DSpace:mainfrom
MMilosz:feat/admin-sidebar/support-icons-in-submenu
Open

Admin Sidebar: support optional icons for extendable submenu#6115
MMilosz wants to merge 3 commits into
DSpace:mainfrom
MMilosz:feat/admin-sidebar/support-icons-in-submenu

Conversation

@MMilosz

@MMilosz MMilosz commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

References

Description

This PR adds icon support to extendable submenu items in the admin sidebar.

Please note this PR does not add any new icons!

Example

screenshot_20260821161212

Instructions for Reviewers

Changes in this PR:

  • Added optional icon property to extendable submenu item configuration for every instance of MenuItemModel
  • Updated submenu rendering logic to display icons when provided
  • Updated MenuItemModels rendering logic to display icons when provided
    • Both AltmetricMenuItemModel and SearchMenuItemModel were not updated due to their specific use cases (they are not used in the extendable submenu anyway)
  • Kept fallback behavior (existing menu items without icons still render correctly)
  • Added tests (LinkMenuItem & OnclickMenuItem) to validate the icon rendering support

How to Test

Please note DSpace does not have built-in validation to verify if a FontAwesome icon string actually exists. This PR does not change that.

During tests, please ensure that:

  • Admin Sidebar still behaves the same (no new icons, no changes in sections, etc.)
  • New icons appear correctly when added via the icon property (check the configuration example below)
  • No regression in menu rendering for items without icons
  • Rendering fits DSpace standards (gaps between icon/label, etc.)

To fully test this PR, you can add new icons in submenu: go to any inheritor of AbstractExpandableMenuProvider and inside a model define a value for icon: '...'.

Example

// src/app/shared/menu/providers/new.menu.ts
// ...
return [
        {
          visible: isCommunityAdmin,
          model: {
            type: MenuItemType.ONCLICK,
            text: 'menu.section.new_community',
            icon: 'user-group', // <-------------- add an icon like this
            function: () => {
              this.modalService.open(ThemedCreateCommunityParentSelectorComponent);
            },
          },
        },
        // ...
]

LLM Disclosure

Instructed local Qwen3.8:27B to write tests & test compliance with CODE_CONVENTIONS.md & check browser compatibility before submitting the PR. The rest is my own work (meaning pretty much copy-pasted from the existing DSpace components 😉)

Checklist

  • My PR is created against the main branch of code (unless it is a backport or is fixing an issue specific to an older branch).
  • My PR is small in size (e.g. less than 1,000 lines of code, not including comments & specs/tests), or I have provided reasons as to why that's not possible.
  • My PR follows all coding best practices based on the Code Conventions Guide
  • My PR passes ESLint validation using npm run lint
  • My PR doesn't introduce circular dependencies (verified via npm run check-circ-deps)
  • My PR includes TypeDoc comments for all new (or modified) public methods and classes. It also includes TypeDoc for large or complex private methods.
  • My PR passes all specs/tests and includes new/updated specs or tests based on the Code Testing Guide.
  • My PR aligns with Accessibility guidelines if it makes changes to the user interface.
  • My PR uses i18n (internationalization) keys instead of hardcoded English text, to allow for translations.
  • My PR includes details on how to test it. I've provided clear instructions to reviewers on how to successfully test this fix or feature.
  • If my PR includes new libraries/dependencies (in package.json), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.
  • If my PR includes new features or configurations, I've provided basic technical documentation in the PR itself.
  • If my PR fixes an issue ticket, I've linked them together.

@MMilosz
MMilosz force-pushed the feat/admin-sidebar/support-icons-in-submenu branch from 25f04db to bdb5321 Compare August 21, 2026 19:50
@MMilosz
MMilosz force-pushed the feat/admin-sidebar/support-icons-in-submenu branch from bdb5321 to 83f484d Compare August 21, 2026 20:17
@MMilosz MMilosz changed the title Draft: Admin Sidebar: support optional icons for extendable submenu Admin Sidebar: support optional icons for extendable submenu Aug 21, 2026
@MMilosz
MMilosz marked this pull request as ready for review August 21, 2026 21:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Admin Sidebar: add (optional) icon support to extendable submenu items

1 participant