Skip to content
Snippets Groups Projects
Commit 2f744003 authored by Kamil Trzcińśki's avatar Kamil Trzcińśki
Browse files

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
parent 8eec0924
No related branches found
No related tags found
No related merge requests found
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
Loading
Loading
@@ -20,7 +20,7 @@
 
- if @project.merge_requests.exists?
%div{ class: container_class }
-if show_callout?('auto_devops_settings_dismissed')
- if show_auto_devops_callout?(@project)
= render 'shared/auto_devops_callout'
.top-area
= render 'shared/issuable/nav', type: :merge_requests
Loading
Loading
Loading
Loading
@@ -3,7 +3,7 @@
= render "projects/pipelines/head"
 
%div{ 'class' => container_class }
-if show_callout?('auto_devops_settings_dismissed')
- if show_auto_devops_callout?(@project)
= render 'shared/auto_devops_callout'
 
#pipelines-list-vue{ data: { endpoint: project_pipelines_path(@project, format: :json),
Loading
Loading
Loading
Loading
@@ -81,7 +81,7 @@
 
- view_path = default_project_view
 
-if show_callout?('auto_devops_settings_dismissed')
- if show_auto_devops_callout?(@project)
= render 'shared/auto_devops_callout'
 
%div{ class: project_child_container_class(view_path) }
Loading
Loading
Loading
Loading
@@ -14,7 +14,7 @@
= render "projects/commits/head"
 
%div{ class: [container_class, ("limit-container-width" unless fluid_layout)] }
-if show_callout?('auto_devops_settings_dismissed')
- if show_auto_devops_callout?(@project)
= render 'shared/auto_devops_callout'
= render 'projects/last_push'
= render 'projects/files', commit: @last_commit, project: @project, ref: @ref, content_url: project_tree_path(@project, @id)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment