Skip to content

Commit 0b0f3e9

Browse files
committed
drop field from sdk
1 parent 1224bb2 commit 0b0f3e9

File tree

5 files changed

+23
-30
lines changed

5 files changed

+23
-30
lines changed

cli/templateedit_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,5 @@ func TestTemplateEdit(t *testing.T) {
9595
assert.Equal(t, template.Description, updated.Description)
9696
assert.Equal(t, template.Icon, updated.Icon)
9797
assert.Equal(t, template.DefaultTTLMillis, updated.DefaultTTLMillis)
98-
assert.Equal(t, template.MinAutostartIntervalMillis, updated.MinAutostartIntervalMillis)
9998
})
10099
}

cli/templates.go

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,14 @@ func templates() *cobra.Command {
5050
}
5151

5252
type templateTableRow struct {
53-
Name string `table:"name"`
54-
CreatedAt string `table:"created at"`
55-
LastUpdated string `table:"last updated"`
56-
OrganizationID uuid.UUID `table:"organization id"`
57-
Provisioner codersdk.ProvisionerType `table:"provisioner"`
58-
ActiveVersionID uuid.UUID `table:"active version id"`
59-
UsedBy string `table:"used by"`
60-
MaxTTL time.Duration `table:"max ttl"`
61-
MinAutostartInterval time.Duration `table:"min autostart"`
53+
Name string `table:"name"`
54+
CreatedAt string `table:"created at"`
55+
LastUpdated string `table:"last updated"`
56+
OrganizationID uuid.UUID `table:"organization id"`
57+
Provisioner codersdk.ProvisionerType `table:"provisioner"`
58+
ActiveVersionID uuid.UUID `table:"active version id"`
59+
UsedBy string `table:"used by"`
60+
DefaultTTL time.Duration `table:"default ttl"`
6261
}
6362

6463
// displayTemplates will return a table displaying all templates passed in.
@@ -68,15 +67,14 @@ func displayTemplates(filterColumns []string, templates ...codersdk.Template) (s
6867
rows := make([]templateTableRow, len(templates))
6968
for i, template := range templates {
7069
rows[i] = templateTableRow{
71-
Name: template.Name,
72-
CreatedAt: template.CreatedAt.Format("January 2, 2006"),
73-
LastUpdated: template.UpdatedAt.Format("January 2, 2006"),
74-
OrganizationID: template.OrganizationID,
75-
Provisioner: template.Provisioner,
76-
ActiveVersionID: template.ActiveVersionID,
77-
UsedBy: cliui.Styles.Fuchsia.Render(formatActiveDevelopers(template.ActiveUserCount)),
78-
MaxTTL: (time.Duration(template.DefaultTTLMillis) * time.Millisecond),
79-
MinAutostartInterval: (time.Duration(template.MinAutostartIntervalMillis) * time.Millisecond),
70+
Name: template.Name,
71+
CreatedAt: template.CreatedAt.Format("January 2, 2006"),
72+
LastUpdated: template.UpdatedAt.Format("January 2, 2006"),
73+
OrganizationID: template.OrganizationID,
74+
Provisioner: template.Provisioner,
75+
ActiveVersionID: template.ActiveVersionID,
76+
UsedBy: cliui.Styles.Fuchsia.Render(formatActiveDevelopers(template.ActiveUserCount)),
77+
DefaultTTL: (time.Duration(template.DefaultTTLMillis) * time.Millisecond),
8078
}
8179
}
8280

coderd/templates_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,6 @@ func TestPatchTemplateMeta(t *testing.T) {
407407
assert.Equal(t, template.Description, updated.Description)
408408
assert.Equal(t, template.Icon, updated.Icon)
409409
assert.Equal(t, template.DefaultTTLMillis, updated.DefaultTTLMillis)
410-
assert.Equal(t, template.MinAutostartIntervalMillis, updated.MinAutostartIntervalMillis)
411410
})
412411

413412
t.Run("Invalid", func(t *testing.T) {
@@ -441,7 +440,6 @@ func TestPatchTemplateMeta(t *testing.T) {
441440
assert.Equal(t, template.Description, updated.Description)
442441
assert.Equal(t, template.Icon, updated.Icon)
443442
assert.Equal(t, template.DefaultTTLMillis, updated.DefaultTTLMillis)
444-
assert.Equal(t, template.MinAutostartIntervalMillis, updated.MinAutostartIntervalMillis)
445443
})
446444

447445
t.Run("RemoveIcon", func(t *testing.T) {

codersdk/templates.go

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,13 @@ type Template struct {
2323
ActiveVersionID uuid.UUID `json:"active_version_id"`
2424
WorkspaceOwnerCount uint32 `json:"workspace_owner_count"`
2525
// ActiveUserCount is set to -1 when loading.
26-
ActiveUserCount int `json:"active_user_count"`
27-
BuildTimeStats TemplateBuildTimeStats `json:"build_time_stats"`
28-
Description string `json:"description"`
29-
Icon string `json:"icon"`
30-
DefaultTTLMillis int64 `json:"default_ttl_ms"`
31-
MinAutostartIntervalMillis int64 `json:"min_autostart_interval_ms"`
32-
CreatedByID uuid.UUID `json:"created_by_id"`
33-
CreatedByName string `json:"created_by_name"`
26+
ActiveUserCount int `json:"active_user_count"`
27+
BuildTimeStats TemplateBuildTimeStats `json:"build_time_stats"`
28+
Description string `json:"description"`
29+
Icon string `json:"icon"`
30+
DefaultTTLMillis int64 `json:"default_ttl_ms"`
31+
CreatedByID uuid.UUID `json:"created_by_id"`
32+
CreatedByName string `json:"created_by_name"`
3433
}
3534

3635
type TemplateBuildTimeStats struct {

site/src/api/typesGenerated.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,6 @@ export interface Template {
613613
readonly description: string
614614
readonly icon: string
615615
readonly default_ttl_ms: number
616-
readonly min_autostart_interval_ms: number
617616
readonly created_by_id: string
618617
readonly created_by_name: string
619618
}

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