Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThong Kuah <tkuah@gitlab.com>2018-11-07 04:06:33 +0300
committerThong Kuah <tkuah@gitlab.com>2018-11-08 13:28:30 +0300
commitb019224ff2bf6c8282a210eff1e98d0225e98a0c (patch)
tree61cb0f7bcce5fe41354abe68050133c61e3e5fdf /app/presenters/project_clusterable_presenter.rb
parent85066afb0ffc2ef973a459c23fbb7afa2f939390 (diff)
Refactor to use presenter
Refacotr project or group specific `if` logic to be contained within each presenter instead. Also add :override to ensure super method exists.
Diffstat (limited to 'app/presenters/project_clusterable_presenter.rb')
-rw-r--r--app/presenters/project_clusterable_presenter.rb11
1 files changed, 9 insertions, 2 deletions
diff --git a/app/presenters/project_clusterable_presenter.rb b/app/presenters/project_clusterable_presenter.rb
index 2aea31e8bbf..ede8547d210 100644
--- a/app/presenters/project_clusterable_presenter.rb
+++ b/app/presenters/project_clusterable_presenter.rb
@@ -1,19 +1,26 @@
# frozen_string_literal: true
class ProjectClusterablePresenter < ClusterablePresenter
+ extend ::Gitlab::Utils::Override
+ include ActionView::Helpers::UrlHelper
+
+ override :cluster_status_cluster_path
def cluster_status_cluster_path(cluster, params = {})
cluster_status_project_cluster_path(clusterable, cluster, params)
end
+ override :install_applications_cluster_path
def install_applications_cluster_path(cluster, application)
install_applications_project_cluster_path(clusterable, cluster, application)
end
+ override :cluster_path
def cluster_path(cluster, params = {})
project_cluster_path(clusterable, cluster, params)
end
- def project?
- true
+ override :learn_more_link
+ def learn_more_link
+ link_to(s_('ClusterIntegration|Learn more about Kubernetes'), help_page_path('user/project/clusters/index'), target: '_blank', rel: 'noopener noreferrer')
end
end