Class: InstanceClusterablePresenter

Inherits:
ClusterablePresenter show all
Extended by:
Gitlab::Utils::Override
Defined in:
app/presenters/instance_clusterable_presenter.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Gitlab::Utils::Override

extended, extensions, included, method_added, override, prepended, queue_verification, verify!

Methods inherited from ClusterablePresenter

#can_add_cluster?, #can_admin_cluster?, #can_create_cluster?, #environments_cluster_path

Methods inherited from Gitlab::View::Presenter::Delegated

#initialize

Methods included from Gitlab::Utils::DelegatorOverride

#delegator_override, #delegator_override_with, #delegator_target, validator, validators, verify!

Methods included from Gitlab::View::Presenter::Base

#__subject__, #can?, #declarative_policy_delegate, #is_a?, #present, #url_builder, #web_path, #web_url

Methods included from Gitlab::Allowable

#can?

Methods included from Gitlab::Routing

add_helpers, includes_helpers, redirect_legacy_paths, url_helpers

Constructor Details

This class inherits a constructor from Gitlab::View::Presenter::Delegated

Class Method Details

.fabricate(clusterable, **attributes) ⇒ Object


8
9
10
11
12
13
14
# File 'app/presenters/instance_clusterable_presenter.rb', line 8

def self.fabricate(clusterable, **attributes)
  attributes_with_presenter_class = attributes.merge(presenter_class: InstanceClusterablePresenter)

  Gitlab::View::Presenter::Factory
    .new(clusterable, **attributes_with_presenter_class)
    .fabricate!
end

Instance Method Details

#clear_cluster_cache_path(cluster) ⇒ Object


27
28
29
# File 'app/presenters/instance_clusterable_presenter.rb', line 27

def clear_cluster_cache_path(cluster)
  clear_cache_admin_cluster_path(cluster)
end

#cluster_path(cluster, params = {}) ⇒ Object


32
33
34
# File 'app/presenters/instance_clusterable_presenter.rb', line 32

def cluster_path(cluster, params = {})
  admin_cluster_path(cluster, params)
end

#cluster_status_cluster_path(cluster, params = {}) ⇒ Object


22
23
24
# File 'app/presenters/instance_clusterable_presenter.rb', line 22

def cluster_status_cluster_path(cluster, params = {})
  cluster_status_admin_cluster_path(cluster, params)
end

#connect_pathObject


37
38
39
# File 'app/presenters/instance_clusterable_presenter.rb', line 37

def connect_path
  connect_admin_clusters_path
end

#create_user_clusters_pathObject


47
48
49
# File 'app/presenters/instance_clusterable_presenter.rb', line 47

def create_user_clusters_path
  create_user_admin_clusters_path
end

#empty_state_help_textObject


52
53
54
# File 'app/presenters/instance_clusterable_presenter.rb', line 52

def empty_state_help_text
  s_('ClusterIntegration|Adding an integration will share the cluster across all projects.')
end

#index_path(options = {}) ⇒ Object


17
18
19
# File 'app/presenters/instance_clusterable_presenter.rb', line 17

def index_path(options = {})
  admin_clusters_path(options)
end

62
63
64
# File 'app/presenters/instance_clusterable_presenter.rb', line 62

def learn_more_link
  ApplicationController.helpers.link_to(s_('ClusterIntegration|Learn more about instance Kubernetes clusters'), help_page_path('user/instance/clusters/index'), target: '_blank', rel: 'noopener noreferrer')
end

#metrics_dashboard_path(cluster) ⇒ Object


66
67
68
# File 'app/presenters/instance_clusterable_presenter.rb', line 66

def metrics_dashboard_path(cluster)
  metrics_dashboard_admin_cluster_path(cluster)
end

#new_cluster_docs_pathObject


42
43
44
# File 'app/presenters/instance_clusterable_presenter.rb', line 42

def new_cluster_docs_path
  nil
end

57
58
59
# File 'app/presenters/instance_clusterable_presenter.rb', line 57

def sidebar_text
  s_('ClusterIntegration|Adding a Kubernetes cluster will automatically share the cluster across all projects. Use review apps, deploy your applications, and easily run your pipelines for all projects using the same cluster.')
end