Commit 3ccb4d95 authored by Clement Ho's avatar Clement Ho

Merge branch '57319-hide-kubernetes-cluster-warning-if-project-has-cluster-related' into 'master'

Resolve "Hide Kubernetes cluster warning if project has cluster related"

See merge request gitlab-org/gitlab-ce!26749
parents 9667ae2e 8598fb34
...@@ -17,10 +17,11 @@ ...@@ -17,10 +17,11 @@
= s_('CICD|The Auto DevOps pipeline will run if no alternative CI configuration file is found.') = s_('CICD|The Auto DevOps pipeline will run if no alternative CI configuration file is found.')
= link_to _('More information'), help_page_path('topics/autodevops/index.md'), target: '_blank' = link_to _('More information'), help_page_path('topics/autodevops/index.md'), target: '_blank'
.card-footer.js-extra-settings{ class: auto_devops_enabled || 'hidden' } .card-footer.js-extra-settings{ class: auto_devops_enabled || 'hidden' }
%p.settings-message.text-center - if @project.all_clusters.empty?
- kubernetes_cluster_link = help_page_path('user/project/clusters/index') %p.settings-message.text-center
- kubernetes_cluster_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: kubernetes_cluster_link } - kubernetes_cluster_link = help_page_path('user/project/clusters/index')
= s_('CICD|You must add a %{kubernetes_cluster_start}Kubernetes cluster integration%{kubernetes_cluster_end} to this project with a domain in order for your deployment strategy to work correctly.').html_safe % { kubernetes_cluster_start: kubernetes_cluster_start, kubernetes_cluster_end: '</a>'.html_safe } - kubernetes_cluster_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: kubernetes_cluster_link }
= s_('CICD|You must add a %{kubernetes_cluster_start}Kubernetes cluster integration%{kubernetes_cluster_end} to this project with a domain in order for your deployment strategy to work correctly.').html_safe % { kubernetes_cluster_start: kubernetes_cluster_start, kubernetes_cluster_end: '</a>'.html_safe }
%label.prepend-top-10 %label.prepend-top-10
%strong= s_('CICD|Deployment strategy') %strong= s_('CICD|Deployment strategy')
.form-check .form-check
......
---
title: Resolve "Hide Kubernetes cluster warning if project has cluster related"
merge_request: 26749
author:
type: fixed
...@@ -13,4 +13,14 @@ describe 'projects/settings/ci_cd/_autodevops_form' do ...@@ -13,4 +13,14 @@ describe 'projects/settings/ci_cd/_autodevops_form' do
expect(rendered).to have_text('You must add a Kubernetes cluster integration to this project with a domain in order for your deployment strategy to work correctly.') expect(rendered).to have_text('You must add a Kubernetes cluster integration to this project with a domain in order for your deployment strategy to work correctly.')
end end
context 'when the project has an available kubernetes cluster' do
let!(:cluster) { create(:cluster, cluster_type: :project_type, projects: [project]) }
it 'does not show a warning message' do
render
expect(rendered).not_to have_text('You must add a Kubernetes cluster')
end
end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment