diff options
author | Jacques Erasmus <jerasmus@gitlab.com> | 2019-09-04 02:15:13 +0300 |
---|---|---|
committer | Mike Greiling <mike@pixelcog.com> | 2019-09-04 02:15:13 +0300 |
commit | 85f89d21aa38e6eb5c91495607078c1f3690d898 (patch) | |
tree | 197936086bff8be1cd40416c7722c9afcafba886 /app/views/projects/settings | |
parent | b4f9f5e7ec26dd99ddb331d521d1104c0fc3f26d (diff) |
Add cluster domain warning
Added a cluster domain wanring if no domain is defined
Diffstat (limited to 'app/views/projects/settings')
-rw-r--r-- | app/views/projects/settings/ci_cd/_autodevops_form.html.haml | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/app/views/projects/settings/ci_cd/_autodevops_form.html.haml b/app/views/projects/settings/ci_cd/_autodevops_form.html.haml index 04b77fb987a..1d5d90593ae 100644 --- a/app/views/projects/settings/ci_cd/_autodevops_form.html.haml +++ b/app/views/projects/settings/ci_cd/_autodevops_form.html.haml @@ -1,3 +1,14 @@ +- has_base_domain = @project.all_clusters.any? { |cluster| cluster.base_domain && !cluster.base_domain.empty? } + +- link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe +- link_end = '</a>'.html_safe + +- kubernetes_cluster_path = help_page_path('user/project/clusters/index') +- kubernetes_cluster_link_start = link_start % { url: kubernetes_cluster_path } + +- base_domain_path = help_page_path('user/project/clusters/index', anchor: 'base-domain') +- base_domain_link_start = link_start % { url: base_domain_path } + .row .col-lg-12 = form_for @project, url: project_settings_ci_cd_path(@project, anchor: 'autodevops-settings') do |f| @@ -19,9 +30,10 @@ .card-footer.js-extra-settings{ class: auto_devops_enabled || 'hidden' } - if @project.all_clusters.empty? %p.settings-message.text-center - - kubernetes_cluster_link = help_page_path('user/project/clusters/index') - - 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 } + = s_('CICD|You must add a %{kubernetes_cluster_link_start}Kubernetes cluster integration%{link_end} to this project with a domain in order for your deployment strategy to work correctly.').html_safe % { kubernetes_cluster_link_start: kubernetes_cluster_link_start, link_end: link_end } + - elsif !has_base_domain + %p.settings-message.text-center + = s_('CICD|You must add a %{base_domain_link_start}base domain%{link_end} to your %{kubernetes_cluster_link_start}Kubernetes cluster%{link_end} in order for your deployment strategy to work.').html_safe % { base_domain_link_start: base_domain_link_start, kubernetes_cluster_link_start: kubernetes_cluster_link_start, link_end: link_end } %label.prepend-top-10 %strong= s_('CICD|Deployment strategy') .form-check |