In the T214715: [Spike] How should menus work in Minerva? we did a research on Menu building in Minerva skin. We came to conclusion, that we can and we should construct all menus in the same way. This approach will
- give us more flexibility, it should be easy to modify/replace menu elements
- extract PageActions logic from SkinMinerva class
- allow us to unit test menu building logic
- reduce the way how we build menus
In the T216152: AMC Navigation - add new links to main menu with click tracking we re-organized the code and used the Builder pattern to build MainMenu. In the same time we merged T216418: AMC Navigation - overflow menu which introduces the new overflow menu.
We should refactor the PageActions menu building to match new way how menus are built.
The proof-of-concept is available on gerrit: rSMIN9909b2d05d2d: POC: PageActions menu built using Builder pattern
- PageActions menu building logic is removed from SkinMinerva class
- PageActions menu is built using Builder pattern. Menu/Group and Menu/MenuElement are used as building blocks
- Any extensions that inject menu elements to the Page actions bar still works properly
- Shared logic from SkinMinerva class (if any) should live as a separate service that is used both in SkinMinerva and PageActions menu builder
- Builder should return two groups (MenuEntries stored in the bar area and menu entries stored in the overflow modal)
- The Page Actions menu works same way as it used to