diff --git a/apps/dashboard/app/models/batch_connect/app.rb b/apps/dashboard/app/models/batch_connect/app.rb index 4d34285e3b..ccbbe6f11e 100644 --- a/apps/dashboard/app/models/batch_connect/app.rb +++ b/apps/dashboard/app/models/batch_connect/app.rb @@ -194,7 +194,12 @@ def clusters end def preset? - valid? && attributes.all?(&:fixed?) + return false unless valid? + return true if attributes.all?(&:fixed?) + + # clusters can be hidden field which is not fixed, so we have to account for that. + cluster = attributes.find { |a| a.id == 'cluster' } + attributes.reject { |a| a.id == 'cluster' }.all?(&:fixed?) && cluster.widget == 'hidden_field' end # Whether this is a valid app the user can use @@ -472,8 +477,8 @@ def add_cluster_widget(attributes, attribute_list) } else { - value: clusters.first.id.to_s, - fixed: true + value: clusters.first.id.to_s, + widget: 'hidden_field' } end end