diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-18 19:00:14 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-18 19:00:14 +0000 |
commit | 05f0ebba3a2c8ddf39e436f412dc2ab5bf1353b2 (patch) | |
tree | 11d0f2a6ec31c7793c184106cedc2ded3d9a2cc5 /lib/sidebars/projects/menus/deployments_menu.rb | |
parent | ec73467c23693d0db63a797d10194da9e72a74af (diff) | |
download | gitlab-ce-05f0ebba3a2c8ddf39e436f412dc2ab5bf1353b2.tar.gz |
Add latest changes from gitlab-org/gitlab@15-8-stable-eev15.8.0-rc42
Diffstat (limited to 'lib/sidebars/projects/menus/deployments_menu.rb')
-rw-r--r-- | lib/sidebars/projects/menus/deployments_menu.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/sidebars/projects/menus/deployments_menu.rb b/lib/sidebars/projects/menus/deployments_menu.rb index 5f789748288..4d4e65e9795 100644 --- a/lib/sidebars/projects/menus/deployments_menu.rb +++ b/lib/sidebars/projects/menus/deployments_menu.rb @@ -10,6 +10,10 @@ module Sidebars add_item(feature_flags_menu_item) add_item(releases_menu_item) + if Feature.enabled?(:show_pages_in_deployments_menu, context.current_user, type: :experiment) + add_item(pages_menu_item) + end + true end @@ -74,6 +78,19 @@ module Sidebars container_html_options: { class: 'shortcuts-deployments-releases' } ) end + + def pages_menu_item + unless context.project.pages_available? && context.current_user&.can?(:update_pages, context.project) + return ::Sidebars::NilMenuItem.new(item_id: :pages) + end + + ::Sidebars::MenuItem.new( + title: _('Pages'), + link: project_pages_path(context.project), + active_routes: { path: 'pages#show' }, + item_id: :pages + ) + end end end end |