Use helper for feature check in cluster partials
This commit is contained in:
parent
56f719f867
commit
dd66c6a2d8
|
|
@ -0,0 +1,5 @@
|
|||
module ClustersHelper
|
||||
def has_multiple_clusters?(project)
|
||||
project.feature_available?(:multiple_clusters)
|
||||
end
|
||||
end
|
||||
|
|
@ -9,7 +9,7 @@
|
|||
= field.text_field :name, class: 'form-control', placeholder: s_('ClusterIntegration|Cluster name')
|
||||
.form-group
|
||||
= field.label :environment_scope, s_('ClusterIntegration|Environment scope')
|
||||
= field.text_field :environment_scope, class: 'form-control js-select-on-focus', disabled: true, placeholder: s_('ClusterIntegration|Environment scope')
|
||||
= field.text_field :environment_scope, class: 'form-control', readonly: has_multiple_clusters?(@project), placeholder: s_('ClusterIntegration|Environment scope')
|
||||
|
||||
= field.fields_for :provider_gcp, @cluster.provider_gcp do |provider_gcp_field|
|
||||
.form-group
|
||||
|
|
|
|||
|
|
@ -9,6 +9,10 @@
|
|||
= form_for @cluster, url: namespace_project_cluster_path(@project.namespace, @project, @cluster), as: :cluster do |field|
|
||||
= form_errors(@cluster)
|
||||
|
||||
.form-group
|
||||
= field.label :environment_scope, s_('ClusterIntegration|Environment scope')
|
||||
= field.text_field :environment_scope, class: 'form-control js-select-on-focus', readonly: has_multiple_clusters?(@project), placeholder: s_('ClusterIntegration|Environment scope')
|
||||
|
||||
= field.fields_for :platform_kubernetes, @cluster.platform_kubernetes do |platform_kubernetes_field|
|
||||
.form-group
|
||||
= platform_kubernetes_field.label :api_url, s_('ClusterIntegration|API URL')
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
= field.text_field :name, class: 'form-control', placeholder: s_('ClusterIntegration|Cluster name')
|
||||
.form-group
|
||||
= field.label :environment_scope, s_('ClusterIntegration|Environment scope')
|
||||
= field.text_field :environment_scope, class: 'form-control js-select-on-focus', disabled: true, placeholder: s_('ClusterIntegration|Environment scope')
|
||||
= field.text_field :environment_scope, class: 'form-control', readonly: has_multiple_clusters?(@project), placeholder: s_('ClusterIntegration|Environment scope')
|
||||
|
||||
= field.fields_for :platform_kubernetes, @cluster.platform_kubernetes do |platform_kubernetes_field|
|
||||
.form-group
|
||||
|
|
|
|||
|
|
@ -4,6 +4,10 @@
|
|||
= field.label :name, s_('ClusterIntegration|Cluster name')
|
||||
= field.text_field :name, class: 'form-control', placeholder: s_('ClusterIntegration|Cluster name')
|
||||
|
||||
.form-group
|
||||
= field.label :environment_scope, s_('ClusterIntegration|Environment scope')
|
||||
= field.text_field :environment_scope, class: 'form-control js-select-on-focus', readonly: has_multiple_clusters?(@project), placeholder: s_('ClusterIntegration|Environment scope')
|
||||
|
||||
= field.fields_for :platform_kubernetes, @cluster.platform_kubernetes do |platform_kubernetes_field|
|
||||
.form-group
|
||||
= platform_kubernetes_field.label :api_url, s_('ClusterIntegration|API URL')
|
||||
|
|
|
|||
Loading…
Reference in New Issue