Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow overriding built-in Admin UI nav menu items #562

Closed
michaelbromley opened this issue Nov 18, 2020 · 0 comments
Closed

Allow overriding built-in Admin UI nav menu items #562

michaelbromley opened this issue Nov 18, 2020 · 0 comments

Comments

@michaelbromley
Copy link
Member

Is your feature request related to a problem? Please describe.
Currently it is possible to add menu items using the addNavMenuSection and addNavMenuItem function exposed by @vendure/admin-ui/core, but it is not possible to remove or override existing menu items. Internally the infrastructure is already in place to allow outside configuration of the entire nav menu. It just needs to be exposed.

Describe the solution you'd like
Two options:

  1. Have addNavMenuSection and addNavMenuItem override any existing section or items if the id string matches an existing one.
  2. Add new functions specifically for overriding.

But then how to remove menu items altogether? I guess that could be done by setting the requiresPermission property to some known invalid permission string. Then it would always be hidden in the admin UI.

Describe alternatives you've considered
I considered exposing a defineNavMenuSections(config: NavMenuSection[]) function which allows one to define the entire nav menu. The downside is that if you only want to override one or a few items, you end up having to duplicate the entire rest of the menu, which would be very inconvenient and verbose.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant