Define the logic to represent sidebars
At the moment, all the code for rendering sidebars is distributed in different places: views and helpers. This makes it very difficult to change things and also avoid errors (which there are already). For example, when we introduce a new element to the menú, we need to remember to update the top parent menu routes in order to make it active when the new menu is selected.
We need a more customizable approach, where the authorizations are in one place, and we don't distribute the logic.
The structure is:
- There is only one panel.
- Each panel can have different menus.
- Each menu can have its own visibility logic, meaning that if the logic is not successful, not menu items will be shown.
- Each menu can have different menu items.
- Each menu item has its own visibility logic. If the check is not successful, the element won't be displayed.