diff options
Diffstat (limited to 'lib/sidebars/groups/super_sidebar_panel.rb')
-rw-r--r-- | lib/sidebars/groups/super_sidebar_panel.rb | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/lib/sidebars/groups/super_sidebar_panel.rb b/lib/sidebars/groups/super_sidebar_panel.rb new file mode 100644 index 00000000000..03af904d99d --- /dev/null +++ b/lib/sidebars/groups/super_sidebar_panel.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +module Sidebars + module Groups + class SuperSidebarPanel < ::Sidebars::Groups::Panel + include ::Sidebars::Concerns::SuperSidebarPanel + extend ::Gitlab::Utils::Override + + override :configure_menus + def configure_menus + super + old_menus = @menus + @menus = [] + + add_menu(Sidebars::StaticMenu.new(context)) + add_menu(Sidebars::Groups::SuperSidebarMenus::ManageMenu.new(context)) + add_menu(Sidebars::Groups::SuperSidebarMenus::PlanMenu.new(context)) + add_menu(Sidebars::Groups::SuperSidebarMenus::CodeMenu.new(context)) + add_menu(Sidebars::Groups::SuperSidebarMenus::BuildMenu.new(context)) + add_menu(Sidebars::Groups::SuperSidebarMenus::SecureMenu.new(context)) + add_menu(Sidebars::Groups::SuperSidebarMenus::OperationsMenu.new(context)) + add_menu(Sidebars::Groups::SuperSidebarMenus::MonitorMenu.new(context)) + add_menu(Sidebars::Groups::SuperSidebarMenus::AnalyzeMenu.new(context)) + + pick_from_old_menus(old_menus) + + insert_menu_before( + Sidebars::Groups::Menus::SettingsMenu, + Sidebars::UncategorizedMenu.new(context) + ) + + transform_old_menus(@menus, @scope_menu, *old_menus) + end + + override :super_sidebar_context_header + def super_sidebar_context_header + { + title: context.group.name, + avatar: context.group.avatar_url, + id: context.group.id + } + end + end + end +end |