diff options
author | Peter Leitzen <pleitzen@gitlab.com> | 2019-05-06 19:24:14 +0300 |
---|---|---|
committer | Bob Van Landuyt <bob@gitlab.com> | 2019-05-06 19:24:14 +0300 |
commit | c8a530a319d6e2550f41cbf61203e6b2712dc7e0 (patch) | |
tree | 0c4dced685d5f8007853d3b977346f436dd44668 /app | |
parent | 4ebbfb9f1e95091a7753a10e12d989d72f4332f8 (diff) |
Show health graphs on group-level
Tweak cluster helper and refactor its specs.
Diffstat (limited to 'app')
-rw-r--r-- | app/helpers/clusters_helper.rb | 5 | ||||
-rw-r--r-- | app/models/clusters/cluster.rb | 6 | ||||
-rw-r--r-- | app/presenters/clusterable_presenter.rb | 4 | ||||
-rw-r--r-- | app/presenters/group_clusterable_presenter.rb | 5 | ||||
-rw-r--r-- | app/presenters/project_clusterable_presenter.rb | 5 | ||||
-rw-r--r-- | app/views/clusters/clusters/show.html.haml | 2 |
6 files changed, 18 insertions, 9 deletions
diff --git a/app/helpers/clusters_helper.rb b/app/helpers/clusters_helper.rb index 30d8a19ecce..769f75f57c4 100644 --- a/app/helpers/clusters_helper.rb +++ b/app/helpers/clusters_helper.rb @@ -20,9 +20,4 @@ module ClustersHelper !cluster.provider.legacy_abac? end - - # EE overrides this - def show_cluster_health_graphs?(cluster) - false - end end diff --git a/app/models/clusters/cluster.rb b/app/models/clusters/cluster.rb index f6d2082d257..d2b1adacbfb 100644 --- a/app/models/clusters/cluster.rb +++ b/app/models/clusters/cluster.rb @@ -10,14 +10,14 @@ module Clusters PROJECT_ONLY_APPLICATIONS = { Applications::Jupyter.application_name => Applications::Jupyter, - Applications::Knative.application_name => Applications::Knative, - Applications::Prometheus.application_name => Applications::Prometheus + Applications::Knative.application_name => Applications::Knative }.freeze APPLICATIONS = { Applications::Helm.application_name => Applications::Helm, Applications::Ingress.application_name => Applications::Ingress, Applications::CertManager.application_name => Applications::CertManager, - Applications::Runner.application_name => Applications::Runner + Applications::Runner.application_name => Applications::Runner, + Applications::Prometheus.application_name => Applications::Prometheus }.merge(PROJECT_ONLY_APPLICATIONS).freeze DEFAULT_ENVIRONMENT = '*'.freeze KUBE_INGRESS_BASE_DOMAIN = 'KUBE_INGRESS_BASE_DOMAIN'.freeze diff --git a/app/presenters/clusterable_presenter.rb b/app/presenters/clusterable_presenter.rb index 34bdf156623..a9edfc92177 100644 --- a/app/presenters/clusterable_presenter.rb +++ b/app/presenters/clusterable_presenter.rb @@ -52,6 +52,10 @@ class ClusterablePresenter < Gitlab::View::Presenter::Delegated raise NotImplementedError end + def clusters_path(params = {}) + raise NotImplementedError + end + def empty_state_help_text nil end diff --git a/app/presenters/group_clusterable_presenter.rb b/app/presenters/group_clusterable_presenter.rb index f5b0bb64487..15db3aabafe 100644 --- a/app/presenters/group_clusterable_presenter.rb +++ b/app/presenters/group_clusterable_presenter.rb @@ -24,6 +24,11 @@ class GroupClusterablePresenter < ClusterablePresenter group_cluster_path(clusterable, cluster, params) end + override :clusters_path + def clusters_path(params = {}) + group_clusters_path(clusterable, params) + end + override :empty_state_help_text def empty_state_help_text s_('ClusterIntegration|Adding an integration to your group will share the cluster across all your projects.') diff --git a/app/presenters/project_clusterable_presenter.rb b/app/presenters/project_clusterable_presenter.rb index 8661ee02b68..cc0e40e6ab8 100644 --- a/app/presenters/project_clusterable_presenter.rb +++ b/app/presenters/project_clusterable_presenter.rb @@ -24,6 +24,11 @@ class ProjectClusterablePresenter < ClusterablePresenter project_cluster_path(clusterable, cluster, params) end + override :clusters_path + def clusters_path(params = {}) + project_clusters_path(clusterable, params) + end + override :sidebar_text def sidebar_text s_('ClusterIntegration|With a Kubernetes cluster associated to this project, you can use review apps, deploy your applications, run your pipelines, and much more in an easy way.') diff --git a/app/views/clusters/clusters/show.html.haml b/app/views/clusters/clusters/show.html.haml index 80d706ae3d3..deb6b21e2be 100644 --- a/app/views/clusters/clusters/show.html.haml +++ b/app/views/clusters/clusters/show.html.haml @@ -34,7 +34,7 @@ = render 'banner' = render 'form' - = render_if_exists 'projects/clusters/prometheus_graphs' if show_cluster_health_graphs?(@cluster) + = render_if_exists 'projects/clusters/prometheus_graphs' .cluster-applications-table#js-cluster-applications |