2021-04-12 08:09:15 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Sidebars
|
|
|
|
module Projects
|
|
|
|
class Panel < ::Sidebars::Panel
|
2021-04-14 11:09:04 -04:00
|
|
|
override :configure_menus
|
|
|
|
def configure_menus
|
2021-04-23 08:09:52 -04:00
|
|
|
set_scope_menu(Sidebars::Projects::Menus::ScopeMenu.new(context))
|
2021-05-10 05:10:28 -04:00
|
|
|
set_hidden_menu(Sidebars::Projects::Menus::HiddenMenu.new(context))
|
2021-05-14 14:10:34 -04:00
|
|
|
add_menus
|
|
|
|
end
|
|
|
|
|
|
|
|
override :aria_label
|
|
|
|
def aria_label
|
|
|
|
_('Project navigation')
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
2021-04-15 11:09:11 -04:00
|
|
|
|
2021-05-14 14:10:34 -04:00
|
|
|
def add_menus
|
2021-05-07 14:10:21 -04:00
|
|
|
add_menu(Sidebars::Projects::Menus::ProjectInformationMenu.new(context))
|
2021-04-23 08:09:52 -04:00
|
|
|
add_menu(Sidebars::Projects::Menus::LearnGitlabMenu.new(context))
|
|
|
|
add_menu(Sidebars::Projects::Menus::RepositoryMenu.new(context))
|
2021-04-26 08:09:44 -04:00
|
|
|
add_menu(Sidebars::Projects::Menus::IssuesMenu.new(context))
|
2021-04-27 08:10:12 -04:00
|
|
|
add_menu(Sidebars::Projects::Menus::ExternalIssueTrackerMenu.new(context))
|
2021-10-28 20:10:36 -04:00
|
|
|
add_menu(Sidebars::Projects::Menus::ZentaoMenu.new(context))
|
2021-04-28 11:09:35 -04:00
|
|
|
add_menu(Sidebars::Projects::Menus::MergeRequestsMenu.new(context))
|
2021-04-29 05:10:11 -04:00
|
|
|
add_menu(Sidebars::Projects::Menus::CiCdMenu.new(context))
|
2021-04-29 11:10:07 -04:00
|
|
|
add_menu(Sidebars::Projects::Menus::SecurityComplianceMenu.new(context))
|
2021-05-14 14:10:34 -04:00
|
|
|
add_menu(Sidebars::Projects::Menus::DeploymentsMenu.new(context))
|
2021-05-04 05:09:59 -04:00
|
|
|
add_menu(Sidebars::Projects::Menus::PackagesRegistriesMenu.new(context))
|
2022-04-29 05:09:48 -04:00
|
|
|
add_menu(Sidebars::Projects::Menus::InfrastructureMenu.new(context))
|
|
|
|
add_menu(Sidebars::Projects::Menus::MonitorMenu.new(context))
|
2021-05-05 08:10:33 -04:00
|
|
|
add_menu(Sidebars::Projects::Menus::AnalyticsMenu.new(context))
|
2021-11-18 13:14:27 -05:00
|
|
|
add_wiki_menus
|
2021-05-06 14:10:06 -04:00
|
|
|
add_menu(Sidebars::Projects::Menus::SnippetsMenu.new(context))
|
2021-05-07 08:10:27 -04:00
|
|
|
add_menu(Sidebars::Projects::Menus::SettingsMenu.new(context))
|
2021-11-17 01:12:07 -05:00
|
|
|
add_invite_members_menu
|
|
|
|
end
|
|
|
|
|
|
|
|
def add_invite_members_menu
|
|
|
|
experiment(:invite_members_in_side_nav, group: context.project.group) do |e|
|
|
|
|
e.control {}
|
|
|
|
e.candidate { add_menu(Sidebars::Projects::Menus::InviteTeamMembersMenu.new(context)) }
|
|
|
|
end
|
2021-04-12 08:09:15 -04:00
|
|
|
end
|
|
|
|
|
2021-11-18 13:14:27 -05:00
|
|
|
def add_wiki_menus
|
|
|
|
add_menu((third_party_wiki_menu || Sidebars::Projects::Menus::WikiMenu).new(context))
|
|
|
|
add_menu(Sidebars::Projects::Menus::ExternalWikiMenu.new(context))
|
|
|
|
end
|
|
|
|
|
|
|
|
def third_party_wiki_menu
|
|
|
|
wiki_menu_list = [::Sidebars::Projects::Menus::ConfluenceMenu]
|
|
|
|
wiki_menu_list << ::Sidebars::Projects::Menus::ShimoMenu if Feature.enabled?(:shimo_integration, context.project)
|
2021-05-06 08:10:38 -04:00
|
|
|
|
2021-11-18 13:14:27 -05:00
|
|
|
wiki_menu_list.find { |wiki_menu| wiki_menu.new(context).render? }
|
2021-05-06 08:10:38 -04:00
|
|
|
end
|
2021-04-12 08:09:15 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2021-04-27 08:10:12 -04:00
|
|
|
|
2021-05-11 17:10:21 -04:00
|
|
|
Sidebars::Projects::Panel.prepend_mod_with('Sidebars::Projects::Panel')
|