diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-18 20:02:30 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-18 20:02:30 +0000 |
commit | 41fe97390ceddf945f3d967b8fdb3de4c66b7dea (patch) | |
tree | 9c8d89a8624828992f06d892cd2f43818ff5dcc8 /lib/sidebars/groups/menus | |
parent | 0804d2dc31052fb45a1efecedc8e06ce9bc32862 (diff) | |
download | gitlab-ce-41fe97390ceddf945f3d967b8fdb3de4c66b7dea.tar.gz |
Add latest changes from gitlab-org/gitlab@14-9-stable-eev14.9.0-rc42
Diffstat (limited to 'lib/sidebars/groups/menus')
-rw-r--r-- | lib/sidebars/groups/menus/ci_cd_menu.rb | 2 | ||||
-rw-r--r-- | lib/sidebars/groups/menus/customer_relations_menu.rb | 2 | ||||
-rw-r--r-- | lib/sidebars/groups/menus/kubernetes_menu.rb | 5 | ||||
-rw-r--r-- | lib/sidebars/groups/menus/packages_registries_menu.rb | 13 | ||||
-rw-r--r-- | lib/sidebars/groups/menus/settings_menu.rb | 8 |
5 files changed, 26 insertions, 4 deletions
diff --git a/lib/sidebars/groups/menus/ci_cd_menu.rb b/lib/sidebars/groups/menus/ci_cd_menu.rb index a1f98b918e6..c1d80458f49 100644 --- a/lib/sidebars/groups/menus/ci_cd_menu.rb +++ b/lib/sidebars/groups/menus/ci_cd_menu.rb @@ -29,7 +29,7 @@ module Sidebars ::Sidebars::MenuItem.new( title: _('Runners'), link: group_runners_path(context.group), - active_routes: { path: 'groups/runners#index' }, + active_routes: { controller: 'groups/runners' }, item_id: :runners ) end diff --git a/lib/sidebars/groups/menus/customer_relations_menu.rb b/lib/sidebars/groups/menus/customer_relations_menu.rb index 002197965d1..0aaa6ec45f1 100644 --- a/lib/sidebars/groups/menus/customer_relations_menu.rb +++ b/lib/sidebars/groups/menus/customer_relations_menu.rb @@ -24,6 +24,8 @@ module Sidebars override :render? def render? + return false unless context.group.root? + can_read_contact? || can_read_organization? end diff --git a/lib/sidebars/groups/menus/kubernetes_menu.rb b/lib/sidebars/groups/menus/kubernetes_menu.rb index 4ea294a4837..98ca7865995 100644 --- a/lib/sidebars/groups/menus/kubernetes_menu.rb +++ b/lib/sidebars/groups/menus/kubernetes_menu.rb @@ -21,7 +21,10 @@ module Sidebars override :render? def render? - can?(context.current_user, :read_cluster, context.group) + clusterable = context.group + + Feature.enabled?(:certificate_based_clusters, clusterable, default_enabled: :yaml, type: :ops) && + can?(context.current_user, :read_cluster, clusterable) end override :extra_container_html_options diff --git a/lib/sidebars/groups/menus/packages_registries_menu.rb b/lib/sidebars/groups/menus/packages_registries_menu.rb index 60d91c8fd10..4c21845ef18 100644 --- a/lib/sidebars/groups/menus/packages_registries_menu.rb +++ b/lib/sidebars/groups/menus/packages_registries_menu.rb @@ -8,8 +8,8 @@ module Sidebars def configure_menu_items add_item(packages_registry_menu_item) add_item(container_registry_menu_item) + add_item(harbor_registry__menu_item) add_item(dependency_proxy_menu_item) - true end @@ -49,6 +49,17 @@ module Sidebars ) end + def harbor_registry__menu_item + return nil_menu_item(:harbor_registry) if Feature.disabled?(:harbor_registry_integration) + + ::Sidebars::MenuItem.new( + title: _('Harbor Registry'), + link: group_harbor_registries_path(context.group), + active_routes: { controller: 'groups/harbor/repositories' }, + item_id: :harbor_registry + ) + end + def dependency_proxy_menu_item setting_does_not_exist_or_is_enabled = !context.group.dependency_proxy_setting || context.group.dependency_proxy_setting.enabled diff --git a/lib/sidebars/groups/menus/settings_menu.rb b/lib/sidebars/groups/menus/settings_menu.rb index 810b467ed2d..09226256476 100644 --- a/lib/sidebars/groups/menus/settings_menu.rb +++ b/lib/sidebars/groups/menus/settings_menu.rb @@ -89,10 +89,16 @@ module Sidebars end def ci_cd_menu_item + active_routes_path = if Feature.enabled?(:runner_list_group_view_vue_ui, context.group, default_enabled: :yaml) + 'ci_cd#show' + else + %w[ci_cd#show groups/runners#show groups/runners#edit] + end + ::Sidebars::MenuItem.new( title: _('CI/CD'), link: group_settings_ci_cd_path(context.group), - active_routes: { path: %w[ci_cd#show groups/runners#show groups/runners#edit] }, + active_routes: { path: active_routes_path }, item_id: :ci_cd ) end |