Commit 2c6a3f6a authored by Thong Kuah's avatar Thong Kuah

Remove method as using nested resource routes

We introduced hidden_clusterable_fields in this MR but it is no longer
needed as we have gone back to nested resource routes which should
provide the params such as `project_id`.
parent 3e7d4831
......@@ -14,10 +14,4 @@ module ClustersHelper
render 'clusters/clusters/gcp_signup_offer_banner'
end
end
def hidden_clusterable_fields
clusterable.clusterable_params.map do |key, value|
hidden_field_tag(key, value)
end.reduce(&:safe_concat)
end
end
= form_for @cluster, url: clusterable.cluster_path(@cluster), as: :cluster do |field|
= form_errors(@cluster)
= hidden_clusterable_fields
.form-group
%h5= s_('ClusterIntegration|Integration status')
%label.append-bottom-0.js-cluster-enable-toggle-area
......
......@@ -14,7 +14,6 @@
= form_for @gcp_cluster, html: { class: 'js-gke-cluster-creation prepend-top-20', data: { token: token_in_session } }, url: clusterable.create_gcp_clusters_path, as: :cluster do |field|
= form_errors(@gcp_cluster)
= hidden_clusterable_fields
.form-group
= field.label :name, s_('ClusterIntegration|Kubernetes cluster name'), class: 'label-bold'
= field.text_field :name, class: 'form-control', placeholder: s_('ClusterIntegration|Kubernetes cluster name')
......
......@@ -8,7 +8,6 @@
= form_for @cluster, url: clusterable.cluster_path(@cluster), as: :cluster do |field|
= form_errors(@cluster)
= hidden_clusterable_fields
= field.fields_for :platform_kubernetes, @cluster.platform_kubernetes do |platform_kubernetes_field|
.form-group
......
= form_for @user_cluster, url: clusterable.create_user_clusters_path, as: :cluster do |field|
= form_errors(@user_cluster)
= hidden_clusterable_fields
.form-group
= field.label :name, s_('ClusterIntegration|Kubernetes cluster name'), class: 'label-bold'
= field.text_field :name, class: 'form-control', placeholder: s_('ClusterIntegration|Kubernetes cluster name')
......
= form_for @cluster, url: clusterable.cluster_path(@cluster), as: :cluster do |field|
= form_errors(@cluster)
= hidden_clusterable_fields
.form-group
= field.label :name, s_('ClusterIntegration|Kubernetes cluster name'), class: 'label-bold'
= field.text_field :name, class: 'form-control', placeholder: s_('ClusterIntegration|Kubernetes cluster name')
......
......@@ -74,10 +74,4 @@ describe ProjectClusterablePresenter do
it { is_expected.to eq(project_cluster_path(project, cluster)) }
end
describe '#clusterable_params' do
subject { presenter.clusterable_params }
it { is_expected.to eq({ project_id: project.to_param, namespace_id: project.namespace.to_param }) }
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment