Class: InstanceClusterablePresenter

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

Instance Attribute Summary

Attributes included from Gitlab::View::Presenter::Base

#subject

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_create_cluster?, #environments_cluster_path

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

#initialize

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

#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


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

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

#authorize_aws_role_pathObject


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

def authorize_aws_role_path
  authorize_aws_role_admin_clusters_path
end

#clear_cluster_cache_path(cluster) ⇒ Object


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

def clear_cluster_cache_path(cluster)
  clear_cache_admin_cluster_path(cluster)
end

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


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

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

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


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

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

#create_aws_clusters_pathObject


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

def create_aws_clusters_path
  create_aws_admin_clusters_path
end

#create_gcp_clusters_pathObject


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

def create_gcp_clusters_path
  create_gcp_admin_clusters_path
end

#create_user_clusters_pathObject


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

def create_user_clusters_path
  create_user_admin_clusters_path
end

#empty_state_help_textObject


71
72
73
# File 'app/presenters/instance_clusterable_presenter.rb', line 71

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

#index_path(options = {}) ⇒ Object


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

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

#install_applications_cluster_path(cluster, application) ⇒ Object


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

def install_applications_cluster_path(cluster, application)
  install_applications_admin_cluster_path(cluster, application)
end

81
82
83
# File 'app/presenters/instance_clusterable_presenter.rb', line 81

def learn_more_link
  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


85
86
87
# File 'app/presenters/instance_clusterable_presenter.rb', line 85

def metrics_dashboard_path(cluster)
  metrics_dashboard_admin_cluster_path(cluster)
end

#new_path(options = {}) ⇒ Object


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

def new_path(options = {})
  new_admin_cluster_path(options)
end

76
77
78
# File 'app/presenters/instance_clusterable_presenter.rb', line 76

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

#update_applications_cluster_path(cluster, application) ⇒ Object


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

def update_applications_cluster_path(cluster, application)
  update_applications_admin_cluster_path(cluster, application)
end