diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-11-14 11:41:52 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-11-14 11:41:52 +0300 |
commit | 585826cb22ecea5998a2c2a4675735c94bdeedac (patch) | |
tree | 5b05f0b30d33cef48963609e8a18a4dff260eab3 /lib/sidebars | |
parent | df221d036e5d0c6c0ee4d55b9c97f481ee05dee8 (diff) |
Add latest changes from gitlab-org/gitlab@16-6-stable-eev16.6.0-rc42
Diffstat (limited to 'lib/sidebars')
-rw-r--r-- | lib/sidebars/admin/menus/admin_settings_menu.rb | 10 | ||||
-rw-r--r-- | lib/sidebars/explore/menus/catalog_menu.rb | 34 | ||||
-rw-r--r-- | lib/sidebars/explore/panel.rb | 1 | ||||
-rw-r--r-- | lib/sidebars/menu.rb | 1 | ||||
-rw-r--r-- | lib/sidebars/organizations/menus/manage_menu.rb | 9 | ||||
-rw-r--r-- | lib/sidebars/projects/menus/ci_cd_menu.rb | 2 | ||||
-rw-r--r-- | lib/sidebars/projects/menus/infrastructure_menu.rb | 2 | ||||
-rw-r--r-- | lib/sidebars/projects/menus/scope_menu.rb | 2 | ||||
-rw-r--r-- | lib/sidebars/projects/menus/settings_menu.rb | 4 | ||||
-rw-r--r-- | lib/sidebars/projects/super_sidebar_menus/monitor_menu.rb | 1 | ||||
-rw-r--r-- | lib/sidebars/user_settings/menus/comment_templates_menu.rb | 2 |
11 files changed, 50 insertions, 18 deletions
diff --git a/lib/sidebars/admin/menus/admin_settings_menu.rb b/lib/sidebars/admin/menus/admin_settings_menu.rb index 4656e0f33e2..4d2d19c60f7 100644 --- a/lib/sidebars/admin/menus/admin_settings_menu.rb +++ b/lib/sidebars/admin/menus/admin_settings_menu.rb @@ -12,7 +12,6 @@ module Sidebars add_item(ci_cd_menu_item) add_item(reporting_menu_item) add_item(metrics_and_profiling_menu_item) - add_item(service_usage_data_menu_item) add_item(network_settings_menu_item) add_item(appearance_menu_item) add_item(preferences_menu_item) @@ -102,15 +101,6 @@ module Sidebars ) end - def service_usage_data_menu_item - ::Sidebars::MenuItem.new( - title: _('Service usage data'), - link: service_usage_data_admin_application_settings_path, - active_routes: { path: 'admin/application_settings#service_usage_data' }, - item_id: :admin_service_usage - ) - end - def network_settings_menu_item ::Sidebars::MenuItem.new( title: _('Network'), diff --git a/lib/sidebars/explore/menus/catalog_menu.rb b/lib/sidebars/explore/menus/catalog_menu.rb new file mode 100644 index 00000000000..2d8e8bba08b --- /dev/null +++ b/lib/sidebars/explore/menus/catalog_menu.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +module Sidebars + module Explore + module Menus + class CatalogMenu < ::Sidebars::Menu + override :link + def link + explore_catalog_index_path + end + + override :title + def title + _('CI/CD Catalog') + end + + override :sprite_icon + def sprite_icon + 'catalog-checkmark' + end + + override :render? + def render? + Feature.enabled?(:global_ci_catalog, current_user) + end + + override :active_routes + def active_routes + { controller: ['explore/catalog'] } + end + end + end + end +end diff --git a/lib/sidebars/explore/panel.rb b/lib/sidebars/explore/panel.rb index 6260df6bb5f..3559f7d9627 100644 --- a/lib/sidebars/explore/panel.rb +++ b/lib/sidebars/explore/panel.rb @@ -28,6 +28,7 @@ module Sidebars def add_menus add_menu(Sidebars::Explore::Menus::ProjectsMenu.new(context)) add_menu(Sidebars::Explore::Menus::GroupsMenu.new(context)) + add_menu(Sidebars::Explore::Menus::CatalogMenu.new(context)) add_menu(Sidebars::Explore::Menus::TopicsMenu.new(context)) add_menu(Sidebars::Explore::Menus::SnippetsMenu.new(context)) end diff --git a/lib/sidebars/menu.rb b/lib/sidebars/menu.rb index ee02429baf3..8fcb373c9dc 100644 --- a/lib/sidebars/menu.rb +++ b/lib/sidebars/menu.rb @@ -80,6 +80,7 @@ module Sidebars is_active = @context.route_is_active.call(active_routes) || items.any? { |item| item[:is_active] } { + id: self.class.name.demodulize.underscore, title: title, icon: sprite_icon, avatar: avatar, diff --git a/lib/sidebars/organizations/menus/manage_menu.rb b/lib/sidebars/organizations/menus/manage_menu.rb index 0df716cdd3f..7c342002c31 100644 --- a/lib/sidebars/organizations/menus/manage_menu.rb +++ b/lib/sidebars/organizations/menus/manage_menu.rb @@ -30,6 +30,15 @@ module Sidebars item_id: :organization_groups_and_projects ) ) + add_item( + ::Sidebars::MenuItem.new( + title: _('Users'), + link: users_organization_path(context.container), + super_sidebar_parent: ::Sidebars::Organizations::Menus::ManageMenu, + active_routes: { path: 'organizations/organizations#users' }, + item_id: :organization_users + ) + ) end end end diff --git a/lib/sidebars/projects/menus/ci_cd_menu.rb b/lib/sidebars/projects/menus/ci_cd_menu.rb index 02596b16cfa..c77e8e996b0 100644 --- a/lib/sidebars/projects/menus/ci_cd_menu.rb +++ b/lib/sidebars/projects/menus/ci_cd_menu.rb @@ -18,7 +18,7 @@ module Sidebars override :extra_container_html_options def extra_container_html_options { - class: 'shortcuts-pipelines rspec-link-pipelines' + class: 'shortcuts-pipelines' } end diff --git a/lib/sidebars/projects/menus/infrastructure_menu.rb b/lib/sidebars/projects/menus/infrastructure_menu.rb index b08845a37e6..d3c9f3a6466 100644 --- a/lib/sidebars/projects/menus/infrastructure_menu.rb +++ b/lib/sidebars/projects/menus/infrastructure_menu.rb @@ -70,7 +70,7 @@ module Sidebars highlight: Users::CalloutsHelper::GKE_CLUSTER_INTEGRATION, highlight_priority: Users::Callout.feature_names[:GKE_CLUSTER_INTEGRATION], dismiss_endpoint: callouts_path, - auto_devops_help_path: help_page_path('topics/autodevops/index.md') } } + auto_devops_help_path: help_page_path('topics/autodevops/index') } } end def terraform_states_menu_item diff --git a/lib/sidebars/projects/menus/scope_menu.rb b/lib/sidebars/projects/menus/scope_menu.rb index f388c814bd7..d03abfdfb7e 100644 --- a/lib/sidebars/projects/menus/scope_menu.rb +++ b/lib/sidebars/projects/menus/scope_menu.rb @@ -22,7 +22,7 @@ module Sidebars override :extra_container_html_options def extra_container_html_options { - class: 'shortcuts-project rspec-project-link' + class: 'shortcuts-project' } end diff --git a/lib/sidebars/projects/menus/settings_menu.rb b/lib/sidebars/projects/menus/settings_menu.rb index 8fed1c46425..077eebf58b9 100644 --- a/lib/sidebars/projects/menus/settings_menu.rb +++ b/lib/sidebars/projects/menus/settings_menu.rb @@ -57,10 +57,6 @@ module Sidebars monitor_menu_item, usage_quotas_menu_item ] - elsif context.current_user && can?(context.current_user, :manage_resource_access_tokens, context.project) - [ - access_tokens_menu_item - ] else [] end diff --git a/lib/sidebars/projects/super_sidebar_menus/monitor_menu.rb b/lib/sidebars/projects/super_sidebar_menus/monitor_menu.rb index 0441d3b4a03..d4ecf132c44 100644 --- a/lib/sidebars/projects/super_sidebar_menus/monitor_menu.rb +++ b/lib/sidebars/projects/super_sidebar_menus/monitor_menu.rb @@ -18,6 +18,7 @@ module Sidebars def configure_menu_items [ :tracing, + :metrics, :error_tracking, :alert_management, :incidents, diff --git a/lib/sidebars/user_settings/menus/comment_templates_menu.rb b/lib/sidebars/user_settings/menus/comment_templates_menu.rb index da37c42bbd4..1e9aea8ec9a 100644 --- a/lib/sidebars/user_settings/menus/comment_templates_menu.rb +++ b/lib/sidebars/user_settings/menus/comment_templates_menu.rb @@ -23,7 +23,7 @@ module Sidebars override :render? def render? - !!context.current_user && saved_replies_enabled? + !!context.current_user end override :active_routes |