Skip to content

Commit 2b5ff08

Browse files
committed
make gne
1 parent a04ffa6 commit 2b5ff08

File tree

2 files changed

+37
-1
lines changed

2 files changed

+37
-1
lines changed

Diff for: docs/data-sources/parameter.md

+34
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,38 @@ data "coder_parameter" "home_volume_size" {
130130
monotonic = "increasing"
131131
}
132132
}
133+
134+
data "coder_parameter" "tools" {
135+
name = "Tools"
136+
description = "What tools do you want to install?"
137+
type = "list(string)"
138+
form_type = "multi-select"
139+
stying = jsonencode({
140+
disabled = false
141+
})
142+
default = jsonencode(["git", "docker"])
143+
144+
option {
145+
value = "Docker"
146+
name = "docker"
147+
icon = "/icon/docker.svg"
148+
}
149+
option {
150+
value = "Git"
151+
name = "git"
152+
icon = "/icon/git.svg"
153+
}
154+
option {
155+
value = "Golang"
156+
name = "go"
157+
icon = "/icon/go.svg"
158+
}
159+
option {
160+
value = "Typescript"
161+
name = "ts"
162+
icon = "/icon/typescript.svg"
163+
}
164+
}
133165
```
134166

135167
<!-- schema generated by tfplugindocs -->
@@ -145,10 +177,12 @@ data "coder_parameter" "home_volume_size" {
145177
- `description` (String) Describe what this parameter does.
146178
- `display_name` (String) The displayed name of the parameter as it will appear in the interface.
147179
- `ephemeral` (Boolean) The value of an ephemeral parameter will not be preserved between consecutive workspace builds.
180+
- `form_type` (String) The type of this parameter. Must be one of: [radio, slider, input, dropdown, checkbox, switch, multi-select, tag-select, textarea, error].
148181
- `icon` (String) A URL to an icon that will display in the dashboard. View built-in icons [here](https://github.com/coder/coder/tree/main/site/static/icon). Use a built-in icon with `"${data.coder_workspace.me.access_url}/icon/<path>"`.
149182
- `mutable` (Boolean) Whether this value can be changed after workspace creation. This can be destructive for values like region, so use with caution!
150183
- `option` (Block List) Each `option` block defines a value for a user to select from. (see [below for nested schema](#nestedblock--option))
151184
- `order` (Number) The order determines the position of a template parameter in the UI/CLI presentation. The lowest order is shown first and parameters with equal order are sorted by name (ascending order).
185+
- `styling` (String) JSON encoded string containing the metadata for controlling the appearance of this parameter in the UI. This option is purely cosmetic and does not affect the function of the parameter in terraform.
152186
- `type` (String) The type of this parameter. Must be one of: `"number"`, `"string"`, `"bool"`, or `"list(string)"`.
153187
- `validation` (Block List, Max: 1) Validate the input of a parameter. (see [below for nested schema](#nestedblock--validation))
154188

Diff for: provider/formtype.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@ const (
5555
// ParameterFormTypes should be kept in sync with the enum list above.
5656
func ParameterFormTypes() []ParameterFormType {
5757
return []ParameterFormType{
58-
ParameterFormTypeDefault,
58+
// Intentionally omit "ParameterFormTypeDefault" from this set.
59+
// It is a valid enum, but will always be mapped to a real value when
60+
// being used.
5961
ParameterFormTypeRadio,
6062
ParameterFormTypeSlider,
6163
ParameterFormTypeInput,

0 commit comments

Comments
 (0)