Class: ClusterablePresenter
Instance Attribute Summary
#subject
Class Method Summary
collapse
Instance Method Summary
collapse
#initialize
#can?, #declarative_policy_delegate, #is_a?, #present, #url_builder, #web_path, #web_url
#can?
add_helpers, includes_helpers, redirect_legacy_paths, url_helpers
Class Method Details
.fabricate(clusterable, **attributes) ⇒ Object
6
7
8
9
10
11
12
13
|
# File 'app/presenters/clusterable_presenter.rb', line 6
def self.fabricate(clusterable, **attributes)
presenter_class = "#{clusterable.class.name}ClusterablePresenter".constantize
attributes_with_presenter_class = attributes.merge(presenter_class: presenter_class)
Gitlab::View::Presenter::Factory
.new(clusterable, attributes_with_presenter_class)
.fabricate!
end
|
Instance Method Details
#authorize_aws_role_path ⇒ Object
31
32
33
|
# File 'app/presenters/clusterable_presenter.rb', line 31
def authorize_aws_role_path
polymorphic_path([clusterable, :clusters], action: :authorize_aws_role)
end
|
#can_add_cluster? ⇒ Boolean
15
16
17
|
# File 'app/presenters/clusterable_presenter.rb', line 15
def can_add_cluster?
can?(current_user, :add_cluster, clusterable)
end
|
#can_create_cluster? ⇒ Boolean
19
20
21
|
# File 'app/presenters/clusterable_presenter.rb', line 19
def can_create_cluster?
can?(current_user, :create_cluster, clusterable)
end
|
#clear_cluster_cache_path(cluster) ⇒ Object
59
60
61
|
# File 'app/presenters/clusterable_presenter.rb', line 59
def clear_cluster_cache_path(cluster)
raise NotImplementedError
end
|
#cluster_path(cluster, params = {}) ⇒ Object
63
64
65
|
# File 'app/presenters/clusterable_presenter.rb', line 63
def cluster_path(cluster, params = {})
raise NotImplementedError
end
|
#cluster_status_cluster_path(cluster, params = {}) ⇒ Object
47
48
49
|
# File 'app/presenters/clusterable_presenter.rb', line 47
def cluster_status_cluster_path(cluster, params = {})
raise NotImplementedError
end
|
#create_aws_clusters_path ⇒ Object
43
44
45
|
# File 'app/presenters/clusterable_presenter.rb', line 43
def create_aws_clusters_path
polymorphic_path([clusterable, :clusters], action: :create_aws)
end
|
#create_gcp_clusters_path ⇒ Object
39
40
41
|
# File 'app/presenters/clusterable_presenter.rb', line 39
def create_gcp_clusters_path
polymorphic_path([clusterable, :clusters], action: :create_gcp)
end
|
#create_user_clusters_path ⇒ Object
35
36
37
|
# File 'app/presenters/clusterable_presenter.rb', line 35
def create_user_clusters_path
polymorphic_path([clusterable, :clusters], action: :create_user)
end
|
#empty_state_help_text ⇒ Object
76
77
78
|
# File 'app/presenters/clusterable_presenter.rb', line 76
def empty_state_help_text
nil
end
|
#environments_cluster_path(cluster) ⇒ Object
72
73
74
|
# File 'app/presenters/clusterable_presenter.rb', line 72
def environments_cluster_path(cluster)
nil
end
|
#index_path(options = {}) ⇒ Object
23
24
25
|
# File 'app/presenters/clusterable_presenter.rb', line 23
def index_path(options = {})
polymorphic_path([clusterable, :clusters], options)
end
|
#install_applications_cluster_path(cluster, application) ⇒ Object
51
52
53
|
# File 'app/presenters/clusterable_presenter.rb', line 51
def install_applications_cluster_path(cluster, application)
raise NotImplementedError
end
|
#learn_more_link ⇒ Object
84
85
86
|
# File 'app/presenters/clusterable_presenter.rb', line 84
def learn_more_link
raise NotImplementedError
end
|
#metrics_dashboard_path(cluster) ⇒ Object
67
68
69
|
# File 'app/presenters/clusterable_presenter.rb', line 67
def metrics_dashboard_path(cluster)
raise NotImplementedError
end
|
#new_path(options = {}) ⇒ Object
27
28
29
|
# File 'app/presenters/clusterable_presenter.rb', line 27
def new_path(options = {})
new_polymorphic_path([clusterable, :cluster], options)
end
|
80
81
82
|
# File 'app/presenters/clusterable_presenter.rb', line 80
def
raise NotImplementedError
end
|
#update_applications_cluster_path(cluster, application) ⇒ Object
55
56
57
|
# File 'app/presenters/clusterable_presenter.rb', line 55
def update_applications_cluster_path(cluster, application)
raise NotImplementedError
end
|