@@ -61,6 +61,7 @@ export interface TemplateSettingsForm {
61
61
// Helpful to show field errors on Storybook
62
62
initialTouched ?: FormikTouched < UpdateTemplateMeta > ;
63
63
accessControlEnabled : boolean ;
64
+ advancedSchedulingEnabled : boolean ;
64
65
portSharingExperimentEnabled : boolean ;
65
66
portSharingControlsEnabled : boolean ;
66
67
}
@@ -73,6 +74,7 @@ export const TemplateSettingsForm: FC<TemplateSettingsForm> = ({
73
74
isSubmitting,
74
75
initialTouched,
75
76
accessControlEnabled,
77
+ advancedSchedulingEnabled,
76
78
portSharingExperimentEnabled,
77
79
portSharingControlsEnabled,
78
80
} ) => {
@@ -195,39 +197,54 @@ export const TemplateSettingsForm: FC<TemplateSettingsForm> = ({
195
197
</ Stack >
196
198
</ Stack >
197
199
</ label >
198
- < label htmlFor = "require_active_version" >
199
- < Stack direction = "row" spacing = { 1 } >
200
- < Checkbox
201
- id = "require_active_version"
202
- name = "require_active_version"
203
- checked = { form . values . require_active_version }
204
- onChange = { form . handleChange }
205
- />
200
+ < Stack spacing = { 2 } >
201
+ < label htmlFor = "require_active_version" >
202
+ < Stack direction = "row" spacing = { 1 } >
203
+ < Checkbox
204
+ id = "require_active_version"
205
+ name = "require_active_version"
206
+ checked = { form . values . require_active_version }
207
+ onChange = { form . handleChange }
208
+ disabled = {
209
+ ! template . require_active_version &&
210
+ ! advancedSchedulingEnabled
211
+ }
212
+ />
206
213
207
- < Stack direction = "column" spacing = { 0.5 } >
208
- < Stack
209
- direction = "row"
210
- alignItems = "center"
211
- spacing = { 0.5 }
212
- css = { styles . optionText }
213
- >
214
- Require workspaces automatically update when started.
215
- < HelpTooltip >
216
- < HelpTooltipTrigger />
217
- < HelpTooltipContent >
218
- < HelpTooltipText >
219
- This setting is not enforced for template admins.
220
- </ HelpTooltipText >
221
- </ HelpTooltipContent >
222
- </ HelpTooltip >
214
+ < Stack direction = "column" spacing = { 0.5 } >
215
+ < Stack
216
+ direction = "row"
217
+ alignItems = "center"
218
+ spacing = { 0.5 }
219
+ css = { styles . optionText }
220
+ >
221
+ Require workspaces automatically update when started.
222
+ < HelpTooltip >
223
+ < HelpTooltipTrigger />
224
+ < HelpTooltipContent >
225
+ < HelpTooltipText >
226
+ This setting is not enforced for template admins.
227
+ </ HelpTooltipText >
228
+ </ HelpTooltipContent >
229
+ </ HelpTooltip >
230
+ </ Stack >
231
+ < span css = { styles . optionHelperText } >
232
+ Workspaces that are manually started or auto-started will
233
+ use the active template version.
234
+ </ span >
223
235
</ Stack >
236
+ </ Stack >
237
+ </ label >
238
+
239
+ { ! advancedSchedulingEnabled && (
240
+ < Stack direction = "row" >
241
+ < EnterpriseBadge />
224
242
< span css = { styles . optionHelperText } >
225
- Workspaces that are manually started or auto-started will use
226
- the active template version.
243
+ Enterprise license required to enabled.
227
244
</ span >
228
245
</ Stack >
229
- </ Stack >
230
- </ label >
246
+ ) }
247
+ </ Stack >
231
248
</ Stack >
232
249
</ FormSection >
233
250
@@ -241,7 +258,9 @@ export const TemplateSettingsForm: FC<TemplateSettingsForm> = ({
241
258
helperText :
242
259
"Leave the message empty to keep the template active. Any message provided will mark the template as deprecated. Use this message to inform users of the deprecation and how to migrate to a new template." ,
243
260
} ) }
244
- disabled = { isSubmitting || ! accessControlEnabled }
261
+ disabled = {
262
+ isSubmitting || ( ! template . deprecated && ! accessControlEnabled )
263
+ }
245
264
fullWidth
246
265
label = "Deprecation Message"
247
266
/>
@@ -250,6 +269,8 @@ export const TemplateSettingsForm: FC<TemplateSettingsForm> = ({
250
269
< EnterpriseBadge />
251
270
< span css = { styles . optionHelperText } >
252
271
Enterprise license required to deprecate templates.
272
+ { template . deprecated &&
273
+ " You cannot change the message, but you may remove it to mark this template as no longer deprecated." }
253
274
</ span >
254
275
</ Stack >
255
276
) }
0 commit comments