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

Turn admin menu sub-items into full-fledged objects #3785

Closed
elia opened this issue Oct 2, 2020 · 0 comments
Closed

Turn admin menu sub-items into full-fledged objects #3785

elia opened this issue Oct 2, 2020 · 0 comments

Comments

@elia
Copy link
Member

elia commented Oct 2, 2020

Is your feature request related to a problem? Please describe.

The admin menu as defined in backend_configuration.rb correctly defines object for the first menu level but relies on views for submenu.

This leads to cumbersome development, either requiring too much effort or facilitating the introduction of bugs (e.g. see #3783).

Describe the solution you'd like

By using object for submenu items as well we could make the whole menu generated and let each menu item just define when it needs to be visible/active etc. and let the first level of menus just ask their collection of sub-items for such things.

So for example if we wanted to know if the settings menu should be visible we could just do settings_menu_item.items.any?(&:visible?), or to know if it should be considered "active" we would do settings_menu_item.items.any?(&:active?), etc.

Describe alternatives you've considered

The alternative would be to keep the current situation and manually fix everything, waiting for the next bug to be introduced 🐛

Additional context

#3783

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

No branches or pull requests

2 participants