Open robinkar opened 9 months ago
I'd have to look into the hidden_field
widget type. This may be doable if gpu-type
is hidden by default. I think data-show
could only work on hidden fields given everything's shown by default.
That said - #2924 covers your example for GPUs specifically which I'm trying to build underlying support for in https://github.com/OSC/ood_core/pull/825
The GPU type field here would be a dropdown, while I think the hidden_field
is always a textbox (unless there is a way to make it a dropdown I have missed).
This would also be useful beyond this case with GPUs, for example with reservations where some reservation might not be available for all (most) accounts (i.e. show reservation field for some account).
OK I made #3348 for auto reservations.
I'm not really sure how to implement this given everything is shown by default. I'd guess we'd need to collect all the data attributes and determine if there's only 1 state it can be shown in and react off of that.
But auto_gpus and auto_reservations may make the whole thing moot.
I think it could be fine to have some attribute be set for the GPU type field to toggle the behaviour, although some automatic detection would of course be better. So something like:
gpu_type:
widget: "select"
hide_by_default: true
options:
- a100
- mi250
I'm not sure how useful an auto_reservation or autogpus field would be for us, as right now as we are not using the auto attributes (mostly due to some missing features).
I'm not sure how useful an auto_reservation or autogpus field would be for us, as right now as we are not using the auto attributes (mostly due to some missing features).
Well I would say that the intent is to be feature complete. Please let me know through tickets what's missing and I'll try to complete it. A test case for the expected behavior of you'd want would be best with perhaps some test fixtures we can test against.
We don't expose reservations or queues to customers, so it's a bit tough for me to test against our own sacctmgr or sinfo output.
The data-hide option in forms is quite inconvenient if you have some widget that only is available for a small number of options. Something that would work the opposite of
data-hide
would be nice to have, e.g.data-show
or maybedata-hide: false
.So rather than having forms like this:
I would want to have this:
Where the
gpu_type
select widget would be hidden by default, and shown only for thegpu
partition.