Skip to content

Commit 1b5f341

Browse files
authored
chore: align active version terminology and link to docs (#14639)
1 parent 4f2202f commit 1b5f341

File tree

10 files changed

+67
-25
lines changed

10 files changed

+67
-25
lines changed

cli/templatecreate.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ func (r *RootCmd) templateCreate() *serpent.Command {
237237
},
238238
{
239239
Flag: "require-active-version",
240-
Description: "Requires workspace builds to use the active template version. This setting does not apply to template admins. This is an enterprise-only feature.",
240+
Description: "Requires workspace builds to use the active template version. This setting does not apply to template admins. This is an enterprise-only feature. See https://coder.com/docs/templates/general-settings#require-automatic-updates-enterprise for more details.",
241241
Value: serpent.BoolOf(&requireActiveVersion),
242242
Default: "false",
243243
},

cli/templateedit.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ func (r *RootCmd) templateEdit() *serpent.Command {
290290
},
291291
{
292292
Flag: "require-active-version",
293-
Description: "Requires workspace builds to use the active template version. This setting does not apply to template admins. This is an enterprise-only feature.",
293+
Description: "Requires workspace builds to use the active template version. This setting does not apply to template admins. This is an enterprise-only feature. See https://coder.com/docs/templates/general-settings#require-automatic-updates-enterprise for more details.",
294294
Value: serpent.BoolOf(&requireActiveVersion),
295295
Default: "false",
296296
},

cli/testdata/coder_templates_create_--help.golden

+3-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ OPTIONS:
5454
--require-active-version bool (default: false)
5555
Requires workspace builds to use the active template version. This
5656
setting does not apply to template admins. This is an enterprise-only
57-
feature.
57+
feature. See
58+
https://coder.com/docs/templates/general-settings#require-automatic-updates-enterprise
59+
for more details.
5860

5961
--var string-array
6062
Alias of --variable.

cli/testdata/coder_templates_edit_--help.golden

+3-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,9 @@ OPTIONS:
8686
--require-active-version bool (default: false)
8787
Requires workspace builds to use the active template version. This
8888
setting does not apply to template admins. This is an enterprise-only
89-
feature.
89+
feature. See
90+
https://coder.com/docs/templates/general-settings#require-automatic-updates-enterprise
91+
for more details.
9092

9193
-y, --yes bool
9294
Bypass prompts.

docs/images/templates/publish.png

-52.6 KB
Loading

docs/reference/cli/templates_create.md

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/reference/cli/templates_edit.md

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/templates/tutorial.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ workspaces.
111111
![Building a template](../images/templates/build-template.png)
112112

113113
Select **Publish version**. In the **Publish new version** dialog, make sure
114-
**Promote to default version** is checked then select **Publish**.
114+
**Promote to active version** is checked then select **Publish**.
115115

116116
![Publish a template](../images/templates/publish.png)
117117

docs/workspaces.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ manually updated the workspace.
150150

151151
## Updating workspaces
152152

153-
After updating the default version of the template that a workspace was created
153+
After updating the active version of the template that a workspace was created
154154
from, you can update the workspace. Coder will start the workspace with said
155155
version.
156156

site/src/pages/TemplateVersionEditorPage/PublishTemplateVersionDialog.tsx

+55-17
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,25 @@ import type { PublishVersionData } from "pages/TemplateVersionEditorPage/types";
1010
import type { FC } from "react";
1111
import { getFormHelpers } from "utils/formUtils";
1212
import * as Yup from "yup";
13+
import {
14+
HelpTooltip,
15+
HelpTooltipContent,
16+
HelpTooltipLink,
17+
HelpTooltipLinksGroup,
18+
HelpTooltipText,
19+
HelpTooltipTitle,
20+
HelpTooltipTrigger,
21+
} from "../../components/HelpTooltip/HelpTooltip";
22+
import { docs } from "../../utils/docs";
1323

1424
export const Language = {
1525
versionNameLabel: "Version name",
1626
messagePlaceholder: "Write a short message about the changes you made...",
17-
defaultCheckboxLabel: "Promote to default version",
27+
defaultCheckboxLabel: "Promote to active version",
28+
activeVersionHelpTitle: "Active versions",
29+
activeVersionHelpText:
30+
"Templates can enforce that the active version be used for all workspaces (enterprise-only)",
31+
activeVersionHelpBody: "Review the documentation",
1832
};
1933

2034
export type PublishTemplateVersionDialogProps = DialogProps & {
@@ -88,22 +102,46 @@ export const PublishTemplateVersionDialog: FC<
88102
rows={5}
89103
/>
90104

91-
<FormControlLabel
92-
label={Language.defaultCheckboxLabel}
93-
control={
94-
<Checkbox
95-
size="small"
96-
checked={form.values.isActiveVersion}
97-
onChange={async (e) => {
98-
await form.setFieldValue(
99-
"isActiveVersion",
100-
e.target.checked,
101-
);
102-
}}
103-
name="isActiveVersion"
104-
/>
105-
}
106-
/>
105+
<Stack direction={"row"}>
106+
<FormControlLabel
107+
label={Language.defaultCheckboxLabel}
108+
control={
109+
<Checkbox
110+
size="small"
111+
checked={form.values.isActiveVersion}
112+
onChange={async (e) => {
113+
await form.setFieldValue(
114+
"isActiveVersion",
115+
e.target.checked,
116+
);
117+
}}
118+
name="isActiveVersion"
119+
/>
120+
}
121+
/>
122+
123+
<HelpTooltip>
124+
<HelpTooltipTrigger />
125+
126+
<HelpTooltipContent>
127+
<HelpTooltipTitle>
128+
{Language.activeVersionHelpTitle}
129+
</HelpTooltipTitle>
130+
<HelpTooltipText>
131+
{Language.activeVersionHelpText}
132+
</HelpTooltipText>
133+
<HelpTooltipLinksGroup>
134+
<HelpTooltipLink
135+
href={docs(
136+
"/templates/general-settings#require-automatic-updates-enterprise",
137+
)}
138+
>
139+
{Language.activeVersionHelpBody}
140+
</HelpTooltipLink>
141+
</HelpTooltipLinksGroup>
142+
</HelpTooltipContent>
143+
</HelpTooltip>
144+
</Stack>
107145
</FormFields>
108146
</Stack>
109147
</form>

0 commit comments

Comments
 (0)