mirror of
https://github.com/coder/coder.git
synced 2026-06-02 20:48:20 +00:00
feat: support icon and description in preset (#18977)
## Description This PR adds support for `description` and `icon` fields to `template_version_presets`. These fields will allow displaying richer information for presets in the UI, improving the user experience when creating a workspace. Both fields are optional, non-nullable, and default to empty strings. ## Changes * Database migration with the addition of `description VARCHAR(128)` and `icon VARCHAR(256)` columns to the `template_version_presets` table. * Updated the `CreateWorkspacePageView` in the UI Note: UI changes will be addressed in a separate PR
This commit is contained in:
@@ -2264,6 +2264,7 @@ func InsertWorkspacePresetAndParameters(ctx context.Context, db database.Store,
|
||||
prebuildSchedules = protoPreset.Prebuild.Scheduling.Schedule
|
||||
}
|
||||
}
|
||||
|
||||
dbPreset, err := tx.InsertPreset(ctx, database.InsertPresetParams{
|
||||
ID: uuid.New(),
|
||||
TemplateVersionID: templateVersionID,
|
||||
@@ -2273,6 +2274,8 @@ func InsertWorkspacePresetAndParameters(ctx context.Context, db database.Store,
|
||||
InvalidateAfterSecs: ttl,
|
||||
SchedulingTimezone: schedulingTimezone,
|
||||
IsDefault: protoPreset.GetDefault(),
|
||||
Description: protoPreset.Description,
|
||||
Icon: protoPreset.Icon,
|
||||
})
|
||||
if err != nil {
|
||||
return xerrors.Errorf("insert preset: %w", err)
|
||||
|
||||
Reference in New Issue
Block a user