Commit de4e5a55 authored by James Fargher's avatar James Fargher

Remove duplicate clusterable presenter method

The method already existed under a different name
parent d14e37d3
......@@ -52,10 +52,6 @@ class ClusterablePresenter < Gitlab::View::Presenter::Delegated
raise NotImplementedError
end
def clusters_path(params = {})
raise NotImplementedError
end
def empty_state_help_text
nil
end
......
......@@ -24,11 +24,6 @@ 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.')
......
......@@ -67,3 +67,5 @@ class InstanceClusterablePresenter < ClusterablePresenter
link_to(s_('ClusterIntegration|Learn more about instance Kubernetes clusters'), help_page_path('user/instance/clusters/index'), target: '_blank', rel: 'noopener noreferrer')
end
end
InstanceClusterablePresenter.prepend EE::InstanceClusterablePresenter
......@@ -24,11 +24,6 @@ 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.')
......
......@@ -15,7 +15,7 @@ module EE
def cluster_health_data(cluster)
{
'clusters-path': clusterable.clusters_path,
'clusters-path': clusterable.index_path,
'metrics-endpoint': clusterable.metrics_cluster_path(cluster, format: :json),
'documentation-path': help_page_path('administration/monitoring/prometheus/index.md'),
'empty-getting-started-svg-path': image_path('illustrations/monitoring/getting_started.svg'),
......
# frozen_string_literal: true
module EE
module InstanceClusterablePresenter
extend ::Gitlab::Utils::Override
override :metrics_cluster_path
def metrics_cluster_path(cluster, params = {})
metrics_admin_cluster_path(cluster, params)
end
end
end
......@@ -76,7 +76,7 @@ describe ClustersHelper do
it do
is_expected.to match(
'clusters-path': clusterable_presenter.clusters_path,
'clusters-path': clusterable_presenter.index_path,
'metrics-endpoint': clusterable_presenter.metrics_cluster_path(cluster, format: :json),
'documentation-path': help_page_path('administration/monitoring/prometheus/index.md'),
'empty-getting-started-svg-path': match_asset_path('/assets/illustrations/monitoring/getting_started.svg'),
......
# frozen_string_literal: true
require 'spec_helper'
describe InstanceClusterablePresenter do
include Gitlab::Routing.url_helpers
let(:presenter) { described_class.new(instance) }
let(:cluster) { create(:cluster, :provided_by_gcp, :instance) }
let(:instance) { cluster.instance }
describe '#metrics_cluster_path' do
subject { presenter.metrics_cluster_path(cluster) }
it { is_expected.to eq(metrics_admin_cluster_path(cluster)) }
end
end
......@@ -82,10 +82,4 @@ describe GroupClusterablePresenter do
it { is_expected.to eq(group_cluster_path(group, cluster)) }
end
describe '#clusters_path' do
subject { presenter.clusters_path }
it { is_expected.to eq(group_clusters_path(group)) }
end
end
......@@ -82,10 +82,4 @@ describe ProjectClusterablePresenter do
it { is_expected.to eq(project_cluster_path(project, cluster)) }
end
describe '#clusters_path' do
subject { presenter.clusters_path }
it { is_expected.to eq(project_clusters_path(project)) }
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment