fix: disable autoupdate workspace setting when template setting enabled (#10662)

This commit is contained in:
Jon Ayers
2023-11-15 16:58:55 -06:00
committed by GitHub
parent 8ddc8b3447
commit 9ac44aa74f
2 changed files with 14 additions and 4 deletions
@@ -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}>