summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/helpers/clusters_helper.rb4
-rw-r--r--app/views/clusters/clusters/_buttons.html.haml2
-rw-r--r--app/views/clusters/clusters/index.html.haml2
3 files changed, 6 insertions, 2 deletions
diff --git a/app/helpers/clusters_helper.rb b/app/helpers/clusters_helper.rb
index 37735d751ad..6a555f46d8e 100644
--- a/app/helpers/clusters_helper.rb
+++ b/app/helpers/clusters_helper.rb
@@ -36,4 +36,8 @@ module ClustersHelper
render 'clusters/clusters/gcp_signup_offer_banner'
end
end
+
+ def display_clusters_callout?(clusters, clusterable)
+ clusters.length > clusterable.clusters.length
+ end
end
diff --git a/app/views/clusters/clusters/_buttons.html.haml b/app/views/clusters/clusters/_buttons.html.haml
index 9daf5a95e79..9238903aa10 100644
--- a/app/views/clusters/clusters/_buttons.html.haml
+++ b/app/views/clusters/clusters/_buttons.html.haml
@@ -1,7 +1,7 @@
-# This partial is overridden in EE
.nav-controls
- if clusterable.can_create_cluster? && clusterable.clusters.empty?
- = link_to s_('ClusterIntegration|Add Kubernetes cluster'), clusterable.new_path, class: 'btn btn-success'
+ = link_to s_('ClusterIntegration|Add Kubernetes cluster'), clusterable.new_path, class: 'btn btn-success js-add-cluster'
- else
%span.btn.btn-add-cluster.disabled.js-add-cluster
= s_("ClusterIntegration|Add Kubernetes cluster")
diff --git a/app/views/clusters/clusters/index.html.haml b/app/views/clusters/clusters/index.html.haml
index 219f71f7751..94565e53e06 100644
--- a/app/views/clusters/clusters/index.html.haml
+++ b/app/views/clusters/clusters/index.html.haml
@@ -12,7 +12,7 @@
= s_("ClusterIntegration|Kubernetes clusters can be used to deploy applications and to provide Review Apps for this project")
= render 'clusters/clusters/buttons'
- - if @clusters.length > clusterable.clusters.length
+ - if display_clusters_callout?(@clusters, clusterable)
.bs-callout.bs-callout-info
= s_("ClusterIntegration|Clusters are utilized by selecting the nearest ancestor with a matching environment scope. For example, project clusters will override group clusters.")
%strong