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:
authorKamil Trzcinski <ayufan@ayufan.eu>2017-09-05 14:35:31 +0300
committerKamil Trzcinski <ayufan@ayufan.eu>2017-09-05 14:35:31 +0300
commit2f744003141ec0964af3bfe84c8cfbc56ee859c0 (patch)
tree7075fd31782193c286e890e49ef876aca88113da /app/helpers/auto_devops_helper.rb
parent8eec09249cf682bf04562ab635209e7a57c36ce7 (diff)
Properly decide when to show Auto DevOps banner
- Only if user can manage project, - When Auto DevOps is not enabled, - When project configuration is set to implicit
Diffstat (limited to 'app/helpers/auto_devops_helper.rb')
-rw-r--r--app/helpers/auto_devops_helper.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/helpers/auto_devops_helper.rb b/app/helpers/auto_devops_helper.rb
new file mode 100644
index 00000000000..64c81f20cad
--- /dev/null
+++ b/app/helpers/auto_devops_helper.rb
@@ -0,0 +1,8 @@
+module AutoDevOpsHelper
+ def show_auto_devops_callout?(project)
+ show_callout?('auto_devops_settings_dismissed') &&
+ can?(current_user, :admin_pipeline, project) &&
+ !current_settings.auto_devops_enabled? &&
+ project.auto_devops&.enabled.nil?
+ end
+end