jupyterhub / kubespawner

Kubernetes spawner for JupyterHub
https://jupyterhub-kubespawner.readthedocs.io
BSD 3-Clause "New" or "Revised" License
541 stars 303 forks source link

Allow for profile_options to have more than `choices` - a text based input field #699

Closed consideRatio closed 1 year ago

consideRatio commented 1 year ago

In profile_list documentation, we write about the profile_options section introduced in #607.

Could we make this support a free form input, allowing users to specify something arbitrary? That could be used for input to choosing an image for example.

yuvipanda commented 1 year ago

yep i think this should be doable!

yuvipanda commented 1 year ago

Another option is to say we support an 'other', which will add an 'Other' entry to the end of the dropdown, and selecting that will have a textbox show up.

jbusecke commented 1 year ago

Either one of those would be great options IMO. Thanks for working on this.

batpad commented 1 year ago

@yuvipanda I can take a stab at this.

We loop through the profiles here: https://github.com/yuvipanda/kubespawner/blob/profile_template/kubespawner/templates/form.html#L16 - I'm guessing there is some sort of profile_option that would define whether the Select for that profile needs an "Other" option or not? Could you help me with what that: basically, how do we know whether to render an extra "Other" option in the Select drop-down for a particular Profile.

This should then ideally be pretty quick work to hook up.