From 4926a4afe942b8ca0e25bc5727ab3698d02c5454 Mon Sep 17 00:00:00 2001 From: Jeff Ohrstrom Date: Tue, 5 Nov 2024 12:57:21 -0500 Subject: [PATCH] clusters should be hidden, not fixed. --- apps/dashboard/app/models/batch_connect/app.rb | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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