summaryrefslogtreecommitdiff
path: root/app/helpers
diff options
context:
space:
mode:
authorThong Kuah <tkuah@gitlab.com>2018-10-30 23:33:43 +1300
committerThong Kuah <tkuah@gitlab.com>2018-11-01 19:37:32 +1300
commit1163b235391668d53ae0cea80bc22d40b365e0a7 (patch)
treece2cf692f41fba52eb42e767611e130399c85499 /app/helpers
parent88800abcd8741b07114c2850e00b74fbecfbf90e (diff)
downloadgitlab-ce-1163b235391668d53ae0cea80bc22d40b365e0a7.tar.gz
Move view and path concerns to presenters
- Move show path for cluster to ClusterPresenter - Create ClusterablePresenter to encapsulate logic. Consolidates scattered methods from BaseController and ClustersHelper into an object.
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/clusters_helper.rb19
1 files changed, 1 insertions, 18 deletions
diff --git a/app/helpers/clusters_helper.rb b/app/helpers/clusters_helper.rb
index 4b4945adc4b..360885fe179 100644
--- a/app/helpers/clusters_helper.rb
+++ b/app/helpers/clusters_helper.rb
@@ -6,14 +6,6 @@ module ClustersHelper
false
end
- def clusterable
- @project
- end
-
- def can_create_cluster?
- can?(current_user, :create_cluster, clusterable)
- end
-
def render_gcp_signup_offer
return if Gitlab::CurrentSettings.current_application_settings.hide_third_party_offers?
return unless show_gcp_signup_offer?
@@ -24,17 +16,8 @@ module ClustersHelper
end
def hidden_clusterable_fields
- clusterable_params.map do |key, value|
+ clusterable.clusterable_params.map do |key, value|
hidden_field_tag(key, value)
end.reduce(&:safe_concat)
end
-
- def clusterable_params
- case clusterable
- when Project
- { project_id: clusterable.to_param, namespace_id: clusterable.namespace.to_param }
- else
- {}
- end
- end
end