Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Multi-select coder_parameter #5540

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

Open
onlycs opened this issue Jan 2, 2023 · 10 comments
Open

Multi-select coder_parameter #5540

onlycs opened this issue Jan 2, 2023 · 10 comments
Labels
roadmap https://coder.com/roadmap. Only humans may set this.

Comments

@onlycs
Copy link

onlycs commented Jan 2, 2023

...and set the type as a list. example:

data "coder_parameter" "nodejs" {
	name				= "NodeJS Version(s)"
	icon				= "https://upload.wikimedia.org/wikipedia/commons/d/d9/Node.js_logo.svg"

	default				= ["latest"]
	mutable				= false
	type				= list(string)
	multiselect			= true # this option does not exist yet

	option = [
		{
			name		= "latest"
			value		= "latest"
		},
		{
			name		= "lts"
			value		= "--lts"
		},
		{
			name		= "19.x"
			value		= "19"
		},
		{
			name		= "18.x"
			value		= "18"
		},
		{
			name		= "17.x"
			value		= "17"
		},
		{
			name		= "16.x"
			value		= "16"
		}
	]
}
@mh013370
Copy link
Contributor

+1

@B94715
Copy link

B94715 commented Jan 31, 2023

I'm happy to look into this on Thursday (2nd of Feb), if no current contributors are wanting to be assigned to the issue.

@bpmct bpmct changed the title [feature request] Select multiple options with new coder_parameter Select multiple options with new coder_parameter Feb 15, 2023
@bpmct
Copy link
Member

bpmct commented Feb 15, 2023

@B94715 - that would be awesome.

@mtojek - do you think this is something we should do? I can see a few use cases.

@mtojek
Copy link
Member

mtojek commented Feb 16, 2023

Thanks for the ping, @bpmct!

A multi-select option can improve the user experience for sure, although it would be valuable to note down these use cases and see if we can address them with an ordinary string. Sometimes the multi-select appears to be not enough as the user may want to extend it with more custom options while filling in the form. For instance: select directories with log files, some of them can be predefined, but it's also a valid use case to pass extra ones.

Regarding the coder_parameter design, I would rather stick to well-known patterns like the HTML tag
, and add multiple: true.

@bpmct
Copy link
Member

bpmct commented Feb 16, 2023

The primary use case I can think of is an "install additional software" prompt, where the user can decide whether they also want to install extra utilities that may be helpful based on preference. e.g. fish, zsh, nano, kubectx, bat, etc.

Like the devcontainers "select features software" in VS Code:

Screenshot 2023-02-16 at 9 02 09 AM

Or the Ubuntu Server "install additional software" screen :P

appears to be not enough as the user may want to extend it with more custom options while filling in the form.

Yeah, I agree that an optional way to add arbitrary custom strings would be good

@github-actions
Copy link

This issue is becoming stale. In order to keep the tracker readable and actionable, I'm going close to this issue in 7 days if there isn't more activity.

@github-actions github-actions bot added the stale This issue is like stale bread. label May 18, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale May 25, 2023
@mafredri
Copy link
Member

I'm re-opening this since I want to request this feature!

Use-case: While working on our scaletest runner template, I wanted the the ability to allow the user starting a scaletest to select from one or more load test scenarios. E.g. produce SSH traffic, web terminal traffic, dashboard traffic, etc.

Esesntially what I want is this:
image

But as a multi-select, the regular input box feels inadequate since it doesn't inform the user what options are available (and free-text doesn't make sense in this case):
image

@mafredri mafredri reopened this Sep 20, 2023
@mafredri mafredri added stale This issue is like stale bread. feature and removed stale This issue is like stale bread. labels Sep 20, 2023
@stirby stirby added the roadmap https://coder.com/roadmap. Only humans may set this. label Nov 15, 2023
@BrunoQuaresma
Copy link
Collaborator

In terms of the FE, we just would have to render checkboxes instead of radio buttons.

@bpmct bpmct changed the title Select multiple options with new coder_parameter Multi-select coder_parameter Apr 26, 2024
@matifali
Copy link
Member

I maintain a matlab template, and a multi-select coder_parameter can help users choose which toolboxes they need.

@matifali
Copy link
Member

@sreya This would also help us complete coder/registry#48.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
roadmap https://coder.com/roadmap. Only humans may set this.
Projects
None yet
Development

No branches or pull requests

9 participants