Skip to content

Commit 7992561

Browse files
committed
Convert default account role to SelectField
StringField with In() validation should be SelectField for proper UI rendering
1 parent 6b886f8 commit 7992561

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

pkg/config/config.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,17 @@ var (
2020
field.WithDescription("Allow insecure TLS connections to the Temporal Cloud API."),
2121
field.WithDefaultValue(false),
2222
)
23-
DefaultAccountRoleField = field.StringField(
23+
DefaultAccountRoleField = field.SelectField(
2424
"default-account-role",
2525
field.WithDisplayName("Default Account Role"),
26-
field.WithDescription("The default account role to use for account provisioning, must be one of [read, developer, admin]"),
26+
field.WithDescription("The default account role to use for account provisioning"),
2727
field.WithDefaultValue("read"),
2828
field.WithRequired(false),
29-
field.WithString(func(r *field.StringRuler) {
30-
r.In([]string{"read", "developer", "admin"})
31-
}),
29+
field.WithSelectOptions(
30+
field.SelectOption{Label: "Read", Value: "read"},
31+
field.SelectOption{Label: "Developer", Value: "developer"},
32+
field.SelectOption{Label: "Admin", Value: "admin"},
33+
),
3234
)
3335

3436
// ConfigurationFields defines the external configuration required for the

0 commit comments

Comments
 (0)