Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-01-18 22:00:14 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-01-18 22:00:14 +0300
commit05f0ebba3a2c8ddf39e436f412dc2ab5bf1353b2 (patch)
tree11d0f2a6ec31c7793c184106cedc2ded3d9a2cc5 /lib/sidebars/projects
parentec73467c23693d0db63a797d10194da9e72a74af (diff)
Add latest changes from gitlab-org/gitlab@15-8-stable-eev15.8.0-rc42
Diffstat (limited to 'lib/sidebars/projects')
-rw-r--r--lib/sidebars/projects/menus/deployments_menu.rb17
-rw-r--r--lib/sidebars/projects/menus/settings_menu.rb6
2 files changed, 22 insertions, 1 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
diff --git a/lib/sidebars/projects/menus/settings_menu.rb b/lib/sidebars/projects/menus/settings_menu.rb
index 11d5f4d59c7..eea32d8b626 100644
--- a/lib/sidebars/projects/menus/settings_menu.rb
+++ b/lib/sidebars/projects/menus/settings_menu.rb
@@ -16,7 +16,11 @@ module Sidebars
add_item(merge_requests_menu_item)
add_item(ci_cd_menu_item)
add_item(packages_and_registries_menu_item)
- add_item(pages_menu_item)
+
+ if Feature.disabled?(:show_pages_in_deployments_menu, context.current_user, type: :experiment)
+ add_item(pages_menu_item)
+ end
+
add_item(monitor_menu_item)
add_item(usage_quotas_menu_item)