Cleans cluster views a bit

- Moves logic into ClustersHelp
- Add CSS to ensure compatibility with EE view.
This commit is contained in:
Mayra Cabrera 2018-12-06 14:55:41 -06:00 committed by Thong Kuah
parent 9dc67bf10c
commit aa86223a4a
3 changed files with 6 additions and 2 deletions

View file

@ -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

View file

@ -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")

View file

@ -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