mirror of
https://github.com/coder/coder.git
synced 2025-07-03 16:13:58 +00:00
feat: support dynamic parameters on create template request (#18636)
Future work is to add this checkbox to the UI to opt into dynamic parameters from the first template create.
This commit is contained in:
@ -100,6 +100,7 @@ func Template(t testing.TB, db database.Store, seed database.Template) database.
|
||||
DisplayName: takeFirst(seed.DisplayName, testutil.GetRandomName(t)),
|
||||
AllowUserCancelWorkspaceJobs: seed.AllowUserCancelWorkspaceJobs,
|
||||
MaxPortSharingLevel: takeFirst(seed.MaxPortSharingLevel, database.AppSharingLevelOwner),
|
||||
UseClassicParameterFlow: takeFirst(seed.UseClassicParameterFlow, true),
|
||||
})
|
||||
require.NoError(t, err, "insert template")
|
||||
|
||||
|
@ -9330,7 +9330,7 @@ func (q *FakeQuerier) InsertTemplate(_ context.Context, arg database.InsertTempl
|
||||
AllowUserAutostart: true,
|
||||
AllowUserAutostop: true,
|
||||
MaxPortSharingLevel: arg.MaxPortSharingLevel,
|
||||
UseClassicParameterFlow: true,
|
||||
UseClassicParameterFlow: arg.UseClassicParameterFlow,
|
||||
}
|
||||
q.templates = append(q.templates, template)
|
||||
return nil
|
||||
|
@ -11031,10 +11031,11 @@ INSERT INTO
|
||||
group_acl,
|
||||
display_name,
|
||||
allow_user_cancel_workspace_jobs,
|
||||
max_port_sharing_level
|
||||
max_port_sharing_level,
|
||||
use_classic_parameter_flow
|
||||
)
|
||||
VALUES
|
||||
($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15)
|
||||
($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16)
|
||||
`
|
||||
|
||||
type InsertTemplateParams struct {
|
||||
@ -11053,6 +11054,7 @@ type InsertTemplateParams struct {
|
||||
DisplayName string `db:"display_name" json:"display_name"`
|
||||
AllowUserCancelWorkspaceJobs bool `db:"allow_user_cancel_workspace_jobs" json:"allow_user_cancel_workspace_jobs"`
|
||||
MaxPortSharingLevel AppSharingLevel `db:"max_port_sharing_level" json:"max_port_sharing_level"`
|
||||
UseClassicParameterFlow bool `db:"use_classic_parameter_flow" json:"use_classic_parameter_flow"`
|
||||
}
|
||||
|
||||
func (q *sqlQuerier) InsertTemplate(ctx context.Context, arg InsertTemplateParams) error {
|
||||
@ -11072,6 +11074,7 @@ func (q *sqlQuerier) InsertTemplate(ctx context.Context, arg InsertTemplateParam
|
||||
arg.DisplayName,
|
||||
arg.AllowUserCancelWorkspaceJobs,
|
||||
arg.MaxPortSharingLevel,
|
||||
arg.UseClassicParameterFlow,
|
||||
)
|
||||
return err
|
||||
}
|
||||
|
@ -98,10 +98,11 @@ INSERT INTO
|
||||
group_acl,
|
||||
display_name,
|
||||
allow_user_cancel_workspace_jobs,
|
||||
max_port_sharing_level
|
||||
max_port_sharing_level,
|
||||
use_classic_parameter_flow
|
||||
)
|
||||
VALUES
|
||||
($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15);
|
||||
($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16);
|
||||
|
||||
-- name: UpdateTemplateActiveVersionByID :exec
|
||||
UPDATE
|
||||
|
Reference in New Issue
Block a user