Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Merged
stirby merged 19 commits intomainfrom17622-dyn-param
May 19, 2025

Conversation

EdwardAngert
Copy link
Contributor

@EdwardAngertEdwardAngert commentedMay 1, 2025
edited
Loading

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 everywhere

preview

@EdwardAngertEdwardAngert added the docsArea: coder.com/docs labelMay 1, 2025
@EdwardAngertEdwardAngert requested a review fromstirbyMay 1, 2025 20:56
@EdwardAngertEdwardAngert self-assigned thisMay 1, 2025
@EdwardAngert
Copy link
ContributorAuthor

for#17473

Comment on lines 457 to 471
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. |
Copy link
Member

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

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I don't think it's that bad as a table (preview), it's the examples below that I'd love to make nicer (and apparently you can't bold in a<details><summary>, so the md is currently busted

@stirby suggested tabs, so I'll try that next if we're good with the basic feel

Emyrk reacted with thumbs up emoji
Copy link
ContributorAuthor

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

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

@stirby@Emyrk it's not perfect (or complete), but here's a proof of concept

2025-05-16_12-57-43

edit: I forgot to tell it to include my cursor in the recording

Copy link
Member

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?

Copy link
ContributorAuthor

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?

Copy link
Member

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.

Copy link
ContributorAuthor

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?

Emyrk reacted with thumbs up emoji
Copy link
Member

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

EdwardAngert reacted with heart emoji
Copy link
ContributorAuthor

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.
Copy link
Member

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

@stirbystirby requested a review fromEmyrkMay 16, 2025 22:05
Copy link
Member

@EmyrkEmyrk left a 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 👍

@stirbystirbyenabled auto-merge (squash)May 19, 2025 15:28
EdwardAngertand others added2 commitsMay 19, 2025 17:00
Co-authored-by: Steven Masley <Emyrk@users.noreply.github.com>
@stirbystirby merged commit1314dbd intomainMay 19, 2025
33 checks passed
@stirbystirby deleted the 17622-dyn-param branchMay 19, 2025 21:23
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsMay 19, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@EmyrkEmyrkEmyrk approved these changes

@stirbystirbyAwaiting requested review from stirby

Assignees

@EdwardAngertEdwardAngert

Labels
docsArea: coder.com/docs
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

docs: early access documentation for dynamic parameters feature
3 participants
@EdwardAngert@Emyrk@stirby

[8]ページ先頭

©2009-2025 Movatter.jp