Skip to content

Add checkbox input for boolean variable #2659

Closed
@phorcys420

Description

@phorcys420

Problem statement

Terraform has a type = bool, for variables.

Acceptance criteria

On the create workspace screen, Coder renders parameters with type = bool with a checkbox or other true/false input. The CLI has a similar behavior.

Original issue

variable "vnc" {
  description = "Do you want to enable VNC?"
  default = true
  nullable = false
  type = bool

  validation {
    condition     = contains([true, false], var.vnc)
    error_message = "Invalid value!"
  }
}

I'm thinking of this way of representing it, the validation step is kinda useless though.
basically, if a variable's type is equal to bool then it would be nice to have it display as a checkbox rather than a textbox.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions