diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-10 21:09:15 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-10 21:09:15 +0300 |
commit | f6905d2ed293ccde386ba2798e7a623c228e8f51 (patch) | |
tree | 83e7defc9e9ec94462c3bc3d86e4ca0cbc4b7c21 /app/helpers | |
parent | f2f748c08166ef350aa4183242c3611f6617f651 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/helpers')
-rw-r--r-- | app/helpers/clusters_helper.rb | 24 | ||||
-rw-r--r-- | app/helpers/environments_helper.rb | 3 |
2 files changed, 18 insertions, 9 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 diff --git a/app/helpers/environments_helper.rb b/app/helpers/environments_helper.rb index 57f3c99b74d..41a255434af 100644 --- a/app/helpers/environments_helper.rb +++ b/app/helpers/environments_helper.rb @@ -60,7 +60,8 @@ module EnvironmentsHelper 'custom-metrics-path' => project_prometheus_metrics_path(project), 'validate-query-path' => validate_query_project_prometheus_metrics_path(project), 'custom-metrics-available' => "#{custom_metrics_available?(project)}", - 'prometheus-alerts-available' => "#{can?(current_user, :read_prometheus_alerts, project)}" + 'prometheus-alerts-available' => "#{can?(current_user, :read_prometheus_alerts, project)}", + 'dashboard-timezone' => project.metrics_setting_dashboard_timezone.to_s.upcase } end |