Skip to content

Commit a238fb7

Browse files
Emyrkjaaydenh
authored andcommitted
Finalize rename
1 parent ebf1a7f commit a238fb7

File tree

10 files changed

+705
-62
lines changed

10 files changed

+705
-62
lines changed

coderd/apidoc/docs.go

Lines changed: 0 additions & 3 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: 0 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/database/dbmem/dbmem.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11084,7 +11084,7 @@ func (q *FakeQuerier) UpdateTemplateMetaByID(_ context.Context, arg database.Upd
1108411084
tpl.GroupACL = arg.GroupACL
1108511085
tpl.AllowUserCancelWorkspaceJobs = arg.AllowUserCancelWorkspaceJobs
1108611086
tpl.MaxPortSharingLevel = arg.MaxPortSharingLevel
11087-
tpl.ClassicParameterFlow = arg.ClassicParameterFlow
11087+
tpl.UseClassicParameterFlow = arg.UseClassicParameterFlow
1108811088
q.templates[idx] = tpl
1108911089
return nil
1109011090
}

coderd/database/querier.go

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

coderd/templates.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -729,9 +729,9 @@ func (api *API) patchTemplateMeta(rw http.ResponseWriter, r *http.Request) {
729729
}
730730

731731
// Defaults to the existing.
732-
classicTemplateFlow := template.ClassicParameterFlow
733-
if req.ClassicParameterFlow != nil {
734-
classicTemplateFlow = *req.ClassicParameterFlow
732+
classicTemplateFlow := template.UseClassicParameterFlow
733+
if req.UseClassicParameterFlow != nil {
734+
classicTemplateFlow = *req.UseClassicParameterFlow
735735
}
736736

737737
var updated database.Template
@@ -753,7 +753,7 @@ func (api *API) patchTemplateMeta(rw http.ResponseWriter, r *http.Request) {
753753
req.TimeTilDormantAutoDeleteMillis == time.Duration(template.TimeTilDormantAutoDelete).Milliseconds() &&
754754
req.RequireActiveVersion == template.RequireActiveVersion &&
755755
(deprecationMessage == template.Deprecated) &&
756-
(classicTemplateFlow == template.ClassicParameterFlow) &&
756+
(classicTemplateFlow == template.UseClassicParameterFlow) &&
757757
maxPortShareLevel == template.MaxPortSharingLevel {
758758
return nil
759759
}
@@ -795,7 +795,7 @@ func (api *API) patchTemplateMeta(rw http.ResponseWriter, r *http.Request) {
795795
AllowUserCancelWorkspaceJobs: req.AllowUserCancelWorkspaceJobs,
796796
GroupACL: groupACL,
797797
MaxPortSharingLevel: maxPortShareLevel,
798-
ClassicParameterFlow: classicTemplateFlow,
798+
UseClassicParameterFlow: classicTemplateFlow,
799799
})
800800
if err != nil {
801801
return xerrors.Errorf("update template metadata: %w", err)
@@ -1074,11 +1074,11 @@ func (api *API) convertTemplate(
10741074
DaysOfWeek: codersdk.BitmapToWeekdays(template.AutostartAllowedDays()),
10751075
},
10761076
// These values depend on entitlements and come from the templateAccessControl
1077-
RequireActiveVersion: templateAccessControl.RequireActiveVersion,
1078-
Deprecated: templateAccessControl.IsDeprecated(),
1079-
DeprecationMessage: templateAccessControl.Deprecated,
1080-
MaxPortShareLevel: maxPortShareLevel,
1081-
ClassicParameterFlow: template.ClassicParameterFlow,
1077+
RequireActiveVersion: templateAccessControl.RequireActiveVersion,
1078+
Deprecated: templateAccessControl.IsDeprecated(),
1079+
DeprecationMessage: templateAccessControl.Deprecated,
1080+
MaxPortShareLevel: maxPortShareLevel,
1081+
UseClassicParameterFlow: template.UseClassicParameterFlow,
10821082
}
10831083
}
10841084

coderd/templates_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1548,32 +1548,32 @@ func TestPatchTemplateMeta(t *testing.T) {
15481548
user := coderdtest.CreateFirstUser(t, client)
15491549
version := coderdtest.CreateTemplateVersion(t, client, user.OrganizationID, nil)
15501550
template := coderdtest.CreateTemplate(t, client, user.OrganizationID, version.ID)
1551-
require.False(t, template.ClassicParameterFlow, "default is false")
1551+
require.False(t, template.UseClassicParameterFlow, "default is false")
15521552

15531553
bTrue := true
15541554
bFalse := false
15551555
req := codersdk.UpdateTemplateMeta{
1556-
ClassicParameterFlow: &bTrue,
1556+
UseClassicParameterFlow: &bTrue,
15571557
}
15581558

15591559
ctx := testutil.Context(t, testutil.WaitLong)
15601560

15611561
// set to true
15621562
updated, err := client.UpdateTemplateMeta(ctx, template.ID, req)
15631563
require.NoError(t, err)
1564-
assert.True(t, updated.ClassicParameterFlow, "expected true")
1564+
assert.True(t, updated.UseClassicParameterFlow, "expected true")
15651565

15661566
// noop
1567-
req.ClassicParameterFlow = nil
1567+
req.UseClassicParameterFlow = nil
15681568
updated, err = client.UpdateTemplateMeta(ctx, template.ID, req)
15691569
require.NoError(t, err)
1570-
assert.True(t, updated.ClassicParameterFlow, "expected true")
1570+
assert.True(t, updated.UseClassicParameterFlow, "expected true")
15711571

15721572
// back to false
1573-
req.ClassicParameterFlow = &bFalse
1573+
req.UseClassicParameterFlow = &bFalse
15741574
updated, err = client.UpdateTemplateMeta(ctx, template.ID, req)
15751575
require.NoError(t, err)
1576-
assert.False(t, updated.ClassicParameterFlow, "expected false")
1576+
assert.False(t, updated.UseClassicParameterFlow, "expected false")
15771577
})
15781578
}
15791579

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