diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-26 12:10:41 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-26 12:10:41 +0000 |
commit | 04f9cef437b65b4a62624936a37a99cfbfb4d61c (patch) | |
tree | 9edb887220b45ecd69f2aefa22a0fea09ed03ee1 /lib/sidebars/projects | |
parent | 47d07def1648ffc0787fe92ea5e351ccc5e9c4a4 (diff) | |
download | gitlab-ce-04f9cef437b65b4a62624936a37a99cfbfb4d61c.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/sidebars/projects')
-rw-r--r-- | lib/sidebars/projects/menus/project_information_menu.rb | 17 | ||||
-rw-r--r-- | lib/sidebars/projects/menus/scope_menu.rb | 21 |
2 files changed, 27 insertions, 11 deletions
diff --git a/lib/sidebars/projects/menus/project_information_menu.rb b/lib/sidebars/projects/menus/project_information_menu.rb index 3d3ac5dac3e..898fd2fb67e 100644 --- a/lib/sidebars/projects/menus/project_information_menu.rb +++ b/lib/sidebars/projects/menus/project_information_menu.rb @@ -17,14 +17,16 @@ module Sidebars override :link def link - project_path(context.project) + renderable_items.first.link end override :extra_container_html_options def extra_container_html_options - { - class: 'shortcuts-project rspec-project-link' - } + if Feature.enabled?(:sidebar_refactor, context.current_user, default_enabled: :yaml) + { class: 'shortcuts-project-information' } + else + { class: 'shortcuts-project rspec-project-link' } + end end override :nav_link_html_options @@ -50,13 +52,6 @@ module Sidebars end end - override :active_routes - def active_routes - return {} if Feature.disabled?(:sidebar_refactor, context.current_user, default_enabled: :yaml) - - { path: 'projects#show' } - end - private def details_menu_item diff --git a/lib/sidebars/projects/menus/scope_menu.rb b/lib/sidebars/projects/menus/scope_menu.rb index 1d1cf11b271..42399ef68a4 100644 --- a/lib/sidebars/projects/menus/scope_menu.rb +++ b/lib/sidebars/projects/menus/scope_menu.rb @@ -13,6 +13,27 @@ module Sidebars def title context.project.name end + + override :active_routes + def active_routes + { path: 'projects#show' } + end + + override :extra_container_html_options + def extra_container_html_options + return {} if Feature.disabled?(:sidebar_refactor, context.current_user, default_enabled: :yaml) + + { + class: 'shortcuts-project rspec-project-link' + } + end + + override :nav_link_html_options + def nav_link_html_options + return {} if Feature.disabled?(:sidebar_refactor, context.current_user, default_enabled: :yaml) + + { class: 'context-header' } + end end end end |