diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-04-20 10:00:54 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-04-20 10:00:54 +0000 |
commit | 3cccd102ba543e02725d247893729e5c73b38295 (patch) | |
tree | f36a04ec38517f5deaaacb5acc7d949688d1e187 /lib/sidebars/projects | |
parent | 205943281328046ef7b4528031b90fbda70c75ac (diff) | |
download | gitlab-ce-3cccd102ba543e02725d247893729e5c73b38295.tar.gz |
Add latest changes from gitlab-org/gitlab@14-10-stable-eev14.10.0-rc42
Diffstat (limited to 'lib/sidebars/projects')
4 files changed, 13 insertions, 33 deletions
diff --git a/lib/sidebars/projects/menus/infrastructure_menu.rb b/lib/sidebars/projects/menus/infrastructure_menu.rb index c012b3bb627..7bd9ac91efa 100644 --- a/lib/sidebars/projects/menus/infrastructure_menu.rb +++ b/lib/sidebars/projects/menus/infrastructure_menu.rb @@ -90,7 +90,10 @@ module Sidebars end def google_cloud_menu_item - feature_is_enabled = Feature.enabled?(:incubation_5mp_google_cloud, context.project) + enabled_for_user = Feature.enabled?(:incubation_5mp_google_cloud, context.current_user) + enabled_for_group = Feature.enabled?(:incubation_5mp_google_cloud, context.project.group) + enabled_for_project = Feature.enabled?(:incubation_5mp_google_cloud, context.project) + feature_is_enabled = enabled_for_user || enabled_for_group || enabled_for_project user_has_permissions = can?(context.current_user, :admin_project_google_cloud, context.project) unless feature_is_enabled && user_has_permissions diff --git a/lib/sidebars/projects/menus/learn_gitlab_menu.rb b/lib/sidebars/projects/menus/learn_gitlab_menu.rb index 16335f5b076..5de70ea7d7f 100644 --- a/lib/sidebars/projects/menus/learn_gitlab_menu.rb +++ b/lib/sidebars/projects/menus/learn_gitlab_menu.rb @@ -45,9 +45,9 @@ module Sidebars } end - override :image_path - def image_path - 'learn_gitlab/graduation_hat.svg' + override :sprite_icon + def sprite_icon + 'bulb' end override :render? diff --git a/lib/sidebars/projects/menus/packages_registries_menu.rb b/lib/sidebars/projects/menus/packages_registries_menu.rb index 77f09986b19..d82a02a342f 100644 --- a/lib/sidebars/projects/menus/packages_registries_menu.rb +++ b/lib/sidebars/projects/menus/packages_registries_menu.rb @@ -47,7 +47,7 @@ module Sidebars ::Sidebars::MenuItem.new( title: _('Container Registry'), link: project_container_registry_index_path(context.project), - active_routes: { controller: :repositories }, + active_routes: { controller: 'projects/registry/repositories' }, item_id: :container_registry ) end @@ -71,7 +71,7 @@ module Sidebars ::Sidebars::MenuItem.new( title: _('Harbor Registry'), link: project_harbor_registry_index_path(context.project), - active_routes: { controller: :harbor_registry }, + active_routes: { controller: 'projects/harbor/repositories' }, item_id: :harbor_registry ) end diff --git a/lib/sidebars/projects/menus/zentao_menu.rb b/lib/sidebars/projects/menus/zentao_menu.rb index db9e60326a4..1b5ba900a86 100644 --- a/lib/sidebars/projects/menus/zentao_menu.rb +++ b/lib/sidebars/projects/menus/zentao_menu.rb @@ -4,11 +4,6 @@ module Sidebars module Projects module Menus class ZentaoMenu < ::Sidebars::Menu - override :configure_menu_items - def configure_menu_items - render?.tap { |render| add_items if render } - end - override :link def link zentao_integration.url @@ -16,7 +11,7 @@ module Sidebars override :title def title - s_('ZentaoIntegration|ZenTao issues') + s_('ZentaoIntegration|ZenTao') end override :title_html_options @@ -26,9 +21,9 @@ module Sidebars } end - override :image_path - def image_path - 'logos/zentao.svg' + override :sprite_icon + def sprite_icon + 'external-link' end # Hardcode sizes so image doesn't flash before CSS loads https://gitlab.com/gitlab-org/gitlab/-/issues/321022 @@ -46,29 +41,11 @@ module Sidebars zentao_integration.active? end - def add_items - add_item(open_zentao_menu_item) - end - private def zentao_integration @zentao_integration ||= context.project.zentao_integration end - - def open_zentao_menu_item - ::Sidebars::MenuItem.new( - title: s_('ZentaoIntegration|Open ZenTao'), - link: zentao_integration.url, - active_routes: {}, - item_id: :open_zentao, - sprite_icon: 'external-link', - container_html_options: { - target: '_blank', - rel: 'noopener noreferrer' - } - ) - end end end end |