summaryrefslogtreecommitdiff
path: root/app/helpers/projects_helper.rb
diff options
context:
space:
mode:
authorMayra Cabrera <mcabrera@gitlab.com>2018-09-04 10:23:11 -0500
committerMayra Cabrera <mcabrera@gitlab.com>2018-09-06 10:47:50 -0500
commitd6fa67824d13fc342721e996810f2838d4706fd2 (patch)
tree9a82614ec32df17b31d348f3c8da2ee8d2f41eb5 /app/helpers/projects_helper.rb
parentec9bb1a7deed082ef050a7275df0abd134f526f3 (diff)
downloadgitlab-ce-d6fa67824d13fc342721e996810f2838d4706fd2.tar.gz
Displays banner to notify users ADO is implicitly enabled
If ADO is implicitly enabled for a project due to the instance wide setting feature or feature flag rollout then an owner or maintainer visiting that project are going to see a banner. Closes #50535
Diffstat (limited to 'app/helpers/projects_helper.rb')
-rw-r--r--app/helpers/projects_helper.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb
index 18b3badda8d..2920ddbbe3a 100644
--- a/app/helpers/projects_helper.rb
+++ b/app/helpers/projects_helper.rb
@@ -203,6 +203,14 @@ module ProjectsHelper
current_user.require_extra_setup_for_git_auth?
end
+ def show_auto_devops_implicitly_enabled_banner?(project)
+ cookie_key = "hide_auto_devops_implicitly_enabled_banner_#{project.id}"
+
+ project.has_auto_devops_implicitly_enabled? &&
+ cookies[cookie_key.to_sym].blank? &&
+ (project.owner == current_user || project.team.maintainer?(current_user))
+ end
+
def link_to_set_password
if current_user.require_password_creation_for_git?
link_to s_('SetPasswordToCloneLink|set a password'), edit_profile_password_path