- Notifications
You must be signed in to change notification settings - Fork907
docs: add new dynamic parameters information to parameters doc#17653
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Uh oh!
There was an error while loading.Please reload this page.
for#17473 |
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
The "Options" column in the table below indicates whether the form type requires options to be defined (Yes) or doesn't support/require them (No). When required, options are specified using one or more `option` blocks in your parameter definition, where each option has a `name` (displayed to the user) and a `value` (used in your template logic). | ||
| Form Type | Parameter Types | Options | Notes | | ||
|----------------|--------------------------------------------|---------|---------------------------------------------------------------------------------------------------------------------------------| | ||
| `checkbox` | `bool` | No | A single checkbox for boolean parameters.<br>Default for boolean parameters. | | ||
| `dropdown` | `string`, `number` | Yes | Searchable dropdown list for choosing a single option from a list.<br>Default for `string` or `number` parameters with options. | | ||
| `input` | `string`, `number` | No | Standard single-line text input field.<br>Default for string/number parameters without options. | | ||
| `key-value` | `string` | No | For entering key-value pairs (as JSON). | | ||
| `multi-select` | `list(string)` | Yes | Select multiple items from a list with checkboxes. | | ||
| `password` | `string` | No | Masked input field for sensitive information. | | ||
| `radio` | `string`, `number`, `bool`, `list(string)` | Yes | Radio buttons for selecting a single option with all choices visible at once. | | ||
| `slider` | `number` | No | Slider selection with min/max validation for numeric values. | | ||
| `switch` | `bool` | No | Toggle switch alternative for boolean parameters. | | ||
| `tag-select` | `list(string)` | No | Default for list(string) parameters without options. | | ||
| `textarea` | `string` | No | Multi-line text input field for longer content. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I think I can simplify this, but I'll come back to it. We can release this as is for now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
oh wait - I wonder if I can make anExample
column with the expands. brb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
This is fine for sure. I just wonder if I can make something a bit more interactive.
Can we embed any html/js in here? Or no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I'm often surprised by the things that work or don't work on our site, but it is built using Next, so there are probably options I wouldn't think of?
if you've got an idea, I'm always happy to test it out + add improvements to the site
in the meantime, we all 👍 on moving the examples to the table?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
👍 for now yes! Let's merge this.
I admit I do not have a great idea at the moment, I just know the table is a verbose thing to look at, and hard to mentally parse if you are not already familiar.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I'll work on putting the examples into the table today + let's follow up with a PR with a screenshot of every option
do you have a kitchensink-style template I can grab from?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Kind of. This has all the form types, but it dynamically switches them
https://github.com/coder/preview/blob/main/testdata/formtypes/main.tf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I'm stuck on trying to get these examples to render nicely in the table - I'll leave them as separate for now, and we'll come back to it. I don't want that blocking publishing
## Available Form Types | ||
Dynamic Parameters supports a variety of form types to create rich, interactive user experiences. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Requires coder terraform provider>2.4.0
terraform {required_providers {coder={ source="coder/coder" version=">=2.4.0" } }}
https://registry.terraform.io/providers/coder/coder/latest/docs
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
My nits do no block a merge 👍
Co-authored-by: Steven Masley <Emyrk@users.noreply.github.com>
1314dbd
intomainUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
closes#17622
it might be better to have the examples on their own page, but if we
/parameters/index.md
+/parameters/dynamic-parameter-examples.md
we're going to have to do a bunch of find/replacing everywherepreview