Super sidebar: Replace a placeholder when adding menu items
What does this MR do and why?
Super sidebar: Replace a placeholder when adding menu items
In the first iteration of our super sidebar menus, we used a property on
the menu items in order to control where they are inserted. The
property super_sidebar_before: :foo
is used to insert the current menu
item before the menu item :foo
.
In practice this has proven to be a little difficult for a few reasons:
- The CE/EE split makes it hard to predict where exactly an item will be, because depending on CE / EE the order of items might be different, as the EE version might inject items somewhere in the middle.
- In the Super Sidebar we are pulling items from many different other menus into another menu. Now this also depends on the order these menus have been added to the original Panel
- A recent change in our requirements, also wants us to reorder a few elements inside the panels and I assume that we want to reorder items more easily in the future.
So the idea is that for the Super Sidebar we just create an array of
NilMenuItem
and let them have the same item_id
as the real items.
These placeholders are then going to be replaced with the real item
during the transform_old_menus
conversion. In case no placeholder was
defined, the real item is just appended to the end of the list.
This technique will render super_sidebar_before
obsolete, and the plan
is to remove it once all menus are using the new technique.
Add new super sidebar menus for projects
As of now these menus are dummy menus which are mostly not rendered, as they have no menu items. The reason why we introduce them all within this commit: It will make it easier to have parallel MRs which actually utilize the new menus, resulting in less conflicts (e.g. translations, etc.)
Screenshots or screen recordings
The order changed slightly (Operations renamed to "Operate") and moved ahead of the "old" menu items.
We will move all the menu items into their respective new menus and this will correct the order soon.
-
Secure
category: !116079 (merged) -
Manage
andPlan
category: !116084 (merged) -
Code
andAnalyze
category: !116093 (merged) -
Monitor
category: !116135 (merged) -
Build
andOperate
category: !116114 (merged)
Related to #393190
How to set up and validate locally
- Enable the
super_sidebar_nav
feature flag. - Log into the GDK and enable the New Navigation for the current user via the User Menu
- Go to any project
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.