8000 feat: rich parameters: introduce display_name by mtojek · Pull Request #6919 · coder/coder · GitHub
[go: up one dir, main page]

Skip to content

feat: rich parameters: introduce display_name #6919

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 26 commits into from
Apr 3, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: DisplayName
  • Loading branch information
mtojek committed Mar 31, 2023
commit a11b69eebd79575c13200b60cf2fde48d428b8fa
1 change: 1 addition & 0 deletions coderd/templateversions.go
Original file line number Diff line number Diff line change
Expand Up @@ -1596,6 +1596,7 @@ func convertTemplateVersionParameter(param database.TemplateVersionParameter) (c
}
return codersdk.TemplateVersionParameter{
Name: param.Name,
DisplayName: param.DisplayName,
Description: param.Description,
DescriptionPlaintext: descriptionPlaintext,
Type: param.Type,
Expand Down
5 changes: 4 additions & 1 deletion coderd/workspaces_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1792,6 +1792,7 @@ func TestWorkspaceWithRichParameters(t *testing.T) {
firstParameterValue = "1"

secondParameterName = "second_parameter"
secondParameterDisplayName = "Second Parameter"
secondParameterType = "number"
secondParameterDescription = "_This_ is second *parameter*"
secondParameterValue = "2"
Expand All @@ -1813,7 +1814,8 @@ func TestWorkspaceWithRichParameters(t *testing.T) {
Description: firstParameterDescription,
},
{
Name: secondParameterName,
Name: secondParameterName,
// FIXME: DisplayName: secondParameterDisplayName,
Type: secondParameterType,
Description: secondParameterDescription,
ValidationMin: 1,
Expand Down Expand Up @@ -1850,6 +1852,7 @@ func TestWorkspaceWithRichParameters(t *testing.T) {
require.Equal(t, firstParameterDescriptionPlaintext, templateRichParameters[0].DescriptionPlaintext)
require.Equal(t, codersdk.ValidationMonotonicOrder(""), templateRichParameters[0].ValidationMonotonic) // no validation for string
require.Equal(t, secondParameterName, templateRichParameters[1].Name)
require.Equal(t, secondParameterDisplayName, templateRichParameters[1].DisplayName)
require.Equal(t, secondParameterType, templateRichParameters[1].Type)
require.Equal(t, secondParameterDescription, templateRichParameters[1].Description)
require.Equal(t, secondParameterDescriptionPlaintext, templateRichParameters[1].DescriptionPlaintext)
Expand Down
1 change: 1 addition & 0 deletions codersdk/templateversions.go
< 5AF1 /tr>
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ const (
// TemplateVersionParameter represents a parameter for a template version.
type TemplateVersionParameter struct {
Name string `json:"name"`
DisplayName string `json:"display_name"`
Description string `json:"description"`
DescriptionPlaintext string `json:"description_plaintext"`
Type string `json:"type" enums:"string,number,bool,list(string)"`
Expand Down
0