Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cluster widgets should be hidden not fixed #3857

Closed
johrstrom opened this issue Oct 7, 2024 · 1 comment · Fixed by #3931
Closed

cluster widgets should be hidden not fixed #3857

johrstrom opened this issue Oct 7, 2024 · 1 comment · Fixed by #3931
Assignees
Milestone

Comments

@johrstrom
Copy link
Contributor

johrstrom commented Oct 7, 2024

Jeff why should this be fixed instead of hidden_field? I have been scratching my head for weeks as to why the dynamic forms do not work in a single-cluster case, and it comes down to this change. when the cluster is fixed, the form does not have a cluster field, and as such none of the data-option-for-cluster-* options work at all. This makes it very hard to share apps between clusters.

You can see my discord post here: https://discourse.openondemand.org/t/issues-with-dynamic-form/3663

I dug into this issue for a while and found this change, and swapping it back to hidded_field, suddenly all the cluster options start working.

Originally posted by @karcaw in #1812 (comment)

For clarity here's the offending expression, specifically the else block.

attributes[:cluster] = if clusters.size > 1
{
widget: 'select',
label: 'Cluster',
options: clusters.map(&:id)
}
else
{
value: clusters.first.id.to_s,
fixed: true
}
end

@johrstrom
Copy link
Contributor Author

@karcaw, let's move the discussion back to this ticket instead of the original PR.

I'm not sure I can fix this, or at least, I can't fix it immediately. As #3858 indicates, this breaks preset (one click) applications.

The logic to determine if an app is preset (one click) then all the attributes have to be fixed. This must have been why I fixed the cluster attribute, as if there's only 1 cluster configured, then it must be fixed and can then possibly be a preset app.

def preset?
valid? && attributes.all?(&:fixed?)
end

To get this to work I'd have to introduce more logic around the cluster attribute, which I can do, just not in time for the 3.1.x release(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants