Skip to content

Commit

Permalink
clusters should be hidden, not fixed.
Browse files Browse the repository at this point in the history
  • Loading branch information
johrstrom committed Nov 5, 2024
1 parent d3abb0d commit 4926a4a
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions apps/dashboard/app/models/batch_connect/app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 4926a4a

Please sign in to comment.