Commit 6e96eeb2 authored by Matija Čupić's avatar Matija Čupić

Fix AutoDevOpsHelper helper methods

parent b712d59c
...@@ -9,28 +9,28 @@ module AutoDevopsHelper ...@@ -9,28 +9,28 @@ module AutoDevopsHelper
end end
def auto_devops_warning_message(project) def auto_devops_warning_message(project)
if missing_service? if missing_service?(project)
params = { params = {
kubernetes: link_to('Kubernetes cluster', project_clusters_path(project)) kubernetes: link_to('Kubernetes cluster', project_clusters_path(project))
} }
if missing_domain? if missing_domain?(project)
_('Auto Review Apps and Auto Deploy need a domain name and a %{kubernetes} to work correctly.') % params _('Auto Review Apps and Auto Deploy need a domain name and a %{kubernetes} to work correctly.') % params
else else
_('Auto Review Apps and Auto Deploy need a %{kubernetes} to work correctly.') % params _('Auto Review Apps and Auto Deploy need a %{kubernetes} to work correctly.') % params
end end
elsif missing_domain? elsif missing_domain?(project)
_('Auto Review Apps and Auto Deploy need a domain name to work correctly.') _('Auto Review Apps and Auto Deploy need a domain name to work correctly.')
end end
end end
private private
def missing_domain? def missing_domain?(project)
!(project.auto_devops&.has_domain? || current_application_settings.auto_devops_domain.present?) !(project.auto_devops&.has_domain? || current_application_settings.auto_devops_domain.present?)
end end
def missing_service? def missing_service?(project)
!project.deployment_platform&.active? !project.deployment_platform&.active?
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