Aam-Digital / ndb-core

Easy-to-use case management web app for NGOs anywhere in the world.
http://www.aam-digital.com
GNU General Public License v3.0
58 stars 19 forks source link

nested / hierarchical menu items #2249

Open sleidig opened 9 months ago

sleidig commented 9 months ago

When there are a lot of different menu items on the left (many different entities), the menu becomes hard to navigate. Nested items, expanding upon hovering on an entry, will be useful.

image

sleidig commented 3 months ago

For the config format, I would suggest the following:

interface NavigationMenuConfig {
  items: MenuItem[];
}

interface MenuItem {
  label: string;
  icon?: string;
  target: string | MenuItem[]; // allow recursively an expanded menu
}

if the recursion makes things too difficult, we could also restrict to maximum one level of indentation. But I would love a generic approach.

--> need to add a config migration to rename "link" to "target" (which would sound more general)


currently existing format:

interface NavigationMenuConfig {
  items: MenuItem[];
}

interface MenuItem {
  label: string;
  icon?: string;
  link: string;
}