Class: ClusterablePresenter
Class Method Summary
collapse
Instance Method Summary
collapse
#initialize
#delegator_override, #delegator_override_with, #delegator_target, validator, validators, verify!
#__subject__, #can?, #declarative_policy_delegate, #is_a?, #path_with_line_numbers, #present, #url_builder, #web_path, #web_url
#can?
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
#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_admin_cluster? ⇒ Boolean
19
20
21
|
# File 'app/presenters/clusterable_presenter.rb', line 19
def can_admin_cluster?
can?(current_user, :admin_cluster, clusterable)
end
|
#can_create_cluster? ⇒ Boolean
23
24
25
|
# File 'app/presenters/clusterable_presenter.rb', line 23
def can_create_cluster?
can?(current_user, :create_cluster, clusterable)
end
|
#clear_cluster_cache_path(cluster) ⇒ Object
47
48
49
|
# File 'app/presenters/clusterable_presenter.rb', line 47
def clear_cluster_cache_path(cluster)
raise NotImplementedError
end
|
#cluster_path(cluster, params = {}) ⇒ Object
51
52
53
|
# File 'app/presenters/clusterable_presenter.rb', line 51
def cluster_path(cluster, params = {})
raise NotImplementedError
end
|
#cluster_status_cluster_path(cluster, params = {}) ⇒ Object
43
44
45
|
# File 'app/presenters/clusterable_presenter.rb', line 43
def cluster_status_cluster_path(cluster, params = {})
raise NotImplementedError
end
|
#connect_path ⇒ Object
31
32
33
|
# File 'app/presenters/clusterable_presenter.rb', line 31
def connect_path
polymorphic_path([clusterable, :clusters], action: :connect)
end
|
#create_user_clusters_path ⇒ Object
39
40
41
|
# File 'app/presenters/clusterable_presenter.rb', line 39
def create_user_clusters_path
polymorphic_path([clusterable, :clusters], action: :create_user)
end
|
#empty_state_help_text ⇒ Object
64
65
66
|
# File 'app/presenters/clusterable_presenter.rb', line 64
def empty_state_help_text
nil
end
|
#environments_cluster_path(cluster) ⇒ Object
60
61
62
|
# File 'app/presenters/clusterable_presenter.rb', line 60
def environments_cluster_path(cluster)
nil
end
|
#index_path(options = {}) ⇒ Object
27
28
29
|
# File 'app/presenters/clusterable_presenter.rb', line 27
def index_path(options = {})
polymorphic_path([clusterable, :clusters], options)
end
|
#learn_more_link ⇒ Object
72
73
74
|
# File 'app/presenters/clusterable_presenter.rb', line 72
def learn_more_link
raise NotImplementedError
end
|
#metrics_dashboard_path(cluster) ⇒ Object
55
56
57
|
# File 'app/presenters/clusterable_presenter.rb', line 55
def metrics_dashboard_path(cluster)
raise NotImplementedError
end
|
#new_cluster_docs_path ⇒ Object
35
36
37
|
# File 'app/presenters/clusterable_presenter.rb', line 35
def new_cluster_docs_path
polymorphic_path([clusterable, :clusters], action: :new_cluster_docs)
end
|
68
69
70
|
# File 'app/presenters/clusterable_presenter.rb', line 68
def
raise NotImplementedError
end
|