Skip to content

Commit 0672bf5

Browse files
authored
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
1 parent 58123e1 commit 0672bf5

File tree

24 files changed

+704
-576
lines changed

24 files changed

+704
-576
lines changed

cli/testdata/coder_provisioner_list_--output_json.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"last_seen_at": "====[timestamp]=====",
88
"name": "test-daemon",
99
"version": "v0.0.0-devel",
10-
"api_version": "1.7",
10+
"api_version": "1.8",
1111
"provisioners": [
1212
"echo"
1313
],

coderd/apidoc/docs.go

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/apidoc/swagger.json

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/database/dbfake/dbfake.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,8 @@ func (t TemplateVersionBuilder) Do() TemplateVersionResponse {
417417
InvalidateAfterSecs: preset.InvalidateAfterSecs,
418418
SchedulingTimezone: preset.SchedulingTimezone,
419419
IsDefault: false,
420+
Description: preset.Description,
421+
Icon: preset.Icon,
420422
})
421423
}
422424

coderd/database/dbgen/dbgen.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1392,6 +1392,8 @@ func Preset(t testing.TB, db database.Store, seed database.InsertPresetParams) d
13921392
InvalidateAfterSecs: seed.InvalidateAfterSecs,
13931393
SchedulingTimezone: seed.SchedulingTimezone,
13941394
IsDefault: seed.IsDefault,
1395+
Description: seed.Description,
1396+
Icon: seed.Icon,
13951397
})
13961398
require.NoError(t, err, "insert preset")
13971399
return preset

coderd/database/dump.sql

Lines changed: 7 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
ALTER TABLE template_version_presets
2+
DROP COLUMN IF EXISTS description,
3+
DROP COLUMN IF EXISTS icon;
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
ALTER TABLE template_version_presets
2+
ADD COLUMN IF NOT EXISTS description VARCHAR(128) NOT NULL DEFAULT '',
3+
ADD COLUMN IF NOT EXISTS icon VARCHAR(256) NOT NULL DEFAULT '';
4+
5+
COMMENT ON COLUMN template_version_presets.description IS 'Short text describing the preset (max 128 characters).';
6+
COMMENT ON COLUMN template_version_presets.icon IS 'URL or path to an icon representing the preset (max 256 characters).';

coderd/database/models.go

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/database/queries.sql.go

Lines changed: 24 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy