Skip to content

Commit b4e6d05

Browse files
committed
add satisfaction
1 parent 2a3bb29 commit b4e6d05

File tree

1 file changed

+30
-3
lines changed

1 file changed

+30
-3
lines changed

testdata/formtypes/main.tf

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ data "coder_parameter" "boolean_format" {
135135
display_name = "How do you want to format the options of the next parameter?"
136136
description = "The next parameter supports boolean values."
137137
type = "string"
138-
form_type = "radio"
138+
form_type = "dropdown"
139139
order = 30
140140
default = "radio"
141141

@@ -204,7 +204,7 @@ data "coder_parameter" "list_format" {
204204
display_name = "How do you want to format the options of the next parameter?"
205205
description = "The next parameter supports lists of values."
206206
type = "string"
207-
form_type = "radio"
207+
form_type = "dropdown"
208208
order = 40
209209
default = "multi-select"
210210

@@ -313,4 +313,31 @@ data "coder_parameter" "list" {
313313
icon = option.value.icon
314314
}
315315
}
316-
}
316+
}
317+
318+
data "coder_parameter" "like_it" {
319+
name = "like_it"
320+
display_name = "Did you like this demo?"
321+
description = "Please check!"
322+
type = "bool"
323+
form_type = "checkbox"
324+
order = 50
325+
default = false
326+
}
327+
328+
data "coder_parameter" "satisfaction" {
329+
count = data.coder_parameter.like_it.value ? 1 : 0
330+
name = "satisfaction"
331+
display_name = "Please rate your satisfaction."
332+
description = ""
333+
type = "number"
334+
form_type = "slider"
335+
order = 51
336+
default = 85
337+
338+
validation {
339+
min = 0
340+
max = 100
341+
error = "Value {value} is not between {min} and {max}"
342+
}
343+
}

0 commit comments

Comments
 (0)