diff options
-rw-r--r-- | app/helpers/auto_devops_helper.rb | 8 | ||||
-rw-r--r-- | app/views/projects/merge_requests/index.html.haml | 2 | ||||
-rw-r--r-- | app/views/projects/pipelines/index.html.haml | 2 | ||||
-rw-r--r-- | app/views/projects/show.html.haml | 2 | ||||
-rw-r--r-- | app/views/projects/tree/show.html.haml | 2 |
5 files changed, 12 insertions, 4 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 diff --git a/app/views/projects/merge_requests/index.html.haml b/app/views/projects/merge_requests/index.html.haml index 3e1d2c568be..b3049f126fc 100644 --- a/app/views/projects/merge_requests/index.html.haml +++ b/app/views/projects/merge_requests/index.html.haml @@ -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 diff --git a/app/views/projects/pipelines/index.html.haml b/app/views/projects/pipelines/index.html.haml index a7c53ad48f4..7a0c51875bc 100644 --- a/app/views/projects/pipelines/index.html.haml +++ b/app/views/projects/pipelines/index.html.haml @@ -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), diff --git a/app/views/projects/show.html.haml b/app/views/projects/show.html.haml index 2635325951b..1da9839ca88 100644 --- a/app/views/projects/show.html.haml +++ b/app/views/projects/show.html.haml @@ -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) } diff --git a/app/views/projects/tree/show.html.haml b/app/views/projects/tree/show.html.haml index bf7baec92e5..d84a1fd7ee1 100644 --- a/app/views/projects/tree/show.html.haml +++ b/app/views/projects/tree/show.html.haml @@ -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) |