diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-18 14:18:50 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-18 14:18:50 +0300 |
commit | 8c7f4e9d5f36cff46365a7f8c4b9c21578c1e781 (patch) | |
tree | a77e7fe7a93de11213032ed4ab1f33a3db51b738 /app/helpers/clusters_helper.rb | |
parent | 00b35af3db1abfe813a778f643dad221aad51fca (diff) |
Add latest changes from gitlab-org/gitlab@13-1-stable-ee
Diffstat (limited to 'app/helpers/clusters_helper.rb')
-rw-r--r-- | app/helpers/clusters_helper.rb | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/app/helpers/clusters_helper.rb b/app/helpers/clusters_helper.rb index 39aaf242231..1204f882707 100644 --- a/app/helpers/clusters_helper.rb +++ b/app/helpers/clusters_helper.rb @@ -17,15 +17,23 @@ module ClustersHelper end end + def js_clusters_list_data(path = nil) + { + endpoint: path, + img_tags: { + aws: { path: image_path('illustrations/logos/amazon_eks.svg'), text: s_('ClusterIntegration|Amazon EKS') }, + default: { path: image_path('illustrations/logos/kubernetes.svg'), text: _('Kubernetes Cluster') }, + gcp: { path: image_path('illustrations/logos/google_gke.svg'), text: s_('ClusterIntegration|Google GKE') } + } + } + end + + # This method is depreciated and will be removed when associated HAML files are moved to JavaScript def provider_icon(provider = nil) - case provider - when 'aws' - image_tag 'illustrations/logos/amazon_eks.svg', alt: s_('ClusterIntegration|Amazon EKS'), class: 'gl-h-full' - when 'gcp' - image_tag 'illustrations/logos/google_gke.svg', alt: s_('ClusterIntegration|Google GKE'), class: 'gl-h-full' - else - image_tag 'illustrations/logos/kubernetes.svg', alt: _('Kubernetes Cluster'), class: 'gl-h-full' - end + img_data = js_clusters_list_data.dig(:img_tags, provider&.to_sym) || + js_clusters_list_data.dig(:img_tags, :default) + + image_tag img_data[:path], alt: img_data[:text], class: 'gl-h-full' end def render_gcp_signup_offer |