OSC / ondemand

Supercomputing. Seamlessly. Open, Interactive HPC Via the Web
https://openondemand.org/
MIT License
283 stars 106 forks source link

cluster widgets should be hidden not fixed #3857

Open johrstrom opened 1 week ago

johrstrom commented 1 week ago

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 https://github.com/OSC/ondemand/pull/1812#discussion_r1788403046_

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

https://github.com/OSC/ondemand/blob/162835ef607d2c3b1e657863947be0a92cd2284f/apps/dashboard/app/models/batch_connect/app.rb#L467-L478

johrstrom commented 1 week ago

@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.

https://github.com/OSC/ondemand/blob/162835ef607d2c3b1e657863947be0a92cd2284f/apps/dashboard/app/models/batch_connect/app.rb#L196-L198

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).