mirror of
https://github.com/coder/coder.git
synced 2026-06-02 20:48:20 +00:00
fix: disable autoupdate workspace setting when template setting enabled (#10662)
This commit is contained in:
+2
-2
@@ -187,7 +187,7 @@ export const TemplateSettingsForm: FC<TemplateSettingsForm> = ({
|
||||
spacing={0.5}
|
||||
css={styles.optionText}
|
||||
>
|
||||
Require the active template version for workspace builds.
|
||||
Require workspaces automatically update when started.
|
||||
<HelpTooltip>
|
||||
<HelpTooltipText>
|
||||
This setting is not enforced for template admins.
|
||||
@@ -196,7 +196,7 @@ export const TemplateSettingsForm: FC<TemplateSettingsForm> = ({
|
||||
</Stack>
|
||||
<span css={styles.optionHelperText}>
|
||||
Workspaces that are manually started or auto-started will
|
||||
use the promoted template version.
|
||||
use the active template version.
|
||||
</span>
|
||||
</Stack>
|
||||
</Stack>
|
||||
|
||||
@@ -83,9 +83,19 @@ export const WorkspaceSettingsForm: FC<{
|
||||
{...getFieldHelpers("automatic_updates")}
|
||||
id="automatic_updates"
|
||||
label="Update Policy"
|
||||
value={form.values.automatic_updates}
|
||||
value={
|
||||
workspace.template_require_active_version
|
||||
? "always"
|
||||
: form.values.automatic_updates
|
||||
}
|
||||
select
|
||||
disabled={form.isSubmitting}
|
||||
disabled={
|
||||
form.isSubmitting || workspace.template_require_active_version
|
||||
}
|
||||
helperText={
|
||||
workspace.template_require_active_version &&
|
||||
"The template for this workspace requires automatic updates."
|
||||
}
|
||||
>
|
||||
{AutomaticUpdateses.map((value) => (
|
||||
<MenuItem value={value} key={value}>
|
||||
|
||||
Reference in New Issue
Block a user