@@ -59,7 +59,7 @@ export interface TemplateScheduleForm {
59
59
onCancel : ( ) => void
60
60
isSubmitting : boolean
61
61
error ?: unknown
62
- canSetMaxTTL : boolean
62
+ allowAdvancedScheduling : boolean
63
63
// Helpful to show field errors on Storybook
64
64
initialTouched ?: FormikTouched < UpdateTemplateMeta >
65
65
}
@@ -69,7 +69,7 @@ export const TemplateScheduleForm: FC<TemplateScheduleForm> = ({
69
69
onSubmit,
70
70
onCancel,
71
71
error,
72
- canSetMaxTTL ,
72
+ allowAdvancedScheduling ,
73
73
isSubmitting,
74
74
initialTouched,
75
75
} ) => {
@@ -81,7 +81,9 @@ export const TemplateScheduleForm: FC<TemplateScheduleForm> = ({
81
81
default_ttl_ms : template . default_ttl_ms / MS_HOUR_CONVERSION ,
82
82
// the API ignores this value, but to avoid tripping up validation set
83
83
// it to zero if the user can't set the field.
84
- max_ttl_ms : canSetMaxTTL ? template . max_ttl_ms / MS_HOUR_CONVERSION : 0 ,
84
+ max_ttl_ms : allowAdvancedScheduling
85
+ ? template . max_ttl_ms / MS_HOUR_CONVERSION
86
+ : 0 ,
85
87
allow_user_autostart : template . allow_user_autostart ,
86
88
allow_user_autostop : template . allow_user_autostop ,
87
89
} ,
@@ -134,7 +136,7 @@ export const TemplateScheduleForm: FC<TemplateScheduleForm> = ({
134
136
< TextField
135
137
{ ...getFieldHelpers (
136
138
"max_ttl_ms" ,
137
- canSetMaxTTL ? (
139
+ allowAdvancedScheduling ? (
138
140
< TTLHelperText
139
141
translationName = "maxTTLHelperText"
140
142
ttl = { form . values . max_ttl_ms }
@@ -149,7 +151,7 @@ export const TemplateScheduleForm: FC<TemplateScheduleForm> = ({
149
151
</ >
150
152
) ,
151
153
) }
152
- disabled = { isSubmitting || ! canSetMaxTTL }
154
+ disabled = { isSubmitting || ! allowAdvancedScheduling }
153
155
fullWidth
154
156
inputProps = { { min : 0 , step : 1 } }
155
157
label = { t ( "maxTtlLabel" ) }
@@ -161,15 +163,15 @@ export const TemplateScheduleForm: FC<TemplateScheduleForm> = ({
161
163
162
164
< FormSection
163
165
title = "Allow users scheduling"
164
- description = "Allow users to set custom auto-start and auto-stop scheduling options for workspaces created from this template."
166
+ description = "Allow users to set custom autostart and autostop scheduling options for workspaces created from this template."
165
167
>
166
168
< Stack direction = "column" >
167
169
< Stack direction = "row" alignItems = "center" >
168
170
< Checkbox
169
171
id = "allow_user_autostart"
170
172
size = "small"
171
173
color = "primary"
172
- disabled = { isSubmitting || ! canSetMaxTTL }
174
+ disabled = { isSubmitting || ! allowAdvancedScheduling }
173
175
onChange = { async ( ) => {
174
176
await form . setFieldValue (
175
177
"allow_user_autostart" ,
@@ -181,7 +183,7 @@ export const TemplateScheduleForm: FC<TemplateScheduleForm> = ({
181
183
/>
182
184
< Stack spacing = { 0.5 } >
183
185
< strong >
184
- Allow users to auto-start workspaces on a schedule.
186
+ Allow users to autostart workspaces on a schedule.
185
187
</ strong >
186
188
</ Stack >
187
189
</ Stack >
@@ -190,7 +192,7 @@ export const TemplateScheduleForm: FC<TemplateScheduleForm> = ({
190
192
id = "allow-user-autostop"
191
193
size = "small"
192
194
color = "primary"
193
- disabled = { isSubmitting || ! canSetMaxTTL }
195
+ disabled = { isSubmitting || ! allowAdvancedScheduling }
194
196
onChange = { async ( ) => {
195
197
await form . setFieldValue (
196
198
"allow_user_autostop" ,
@@ -202,7 +204,7 @@ export const TemplateScheduleForm: FC<TemplateScheduleForm> = ({
202
204
/>
203
205
< Stack spacing = { 0.5 } >
204
206
< strong >
205
- Allow users to customize auto-stop duration for workspaces.
207
+ Allow users to customize autostop duration for workspaces.
206
208
</ strong >
207
209
< span className = { styles . optionDescription } >
208
210
Workspaces will always use the default TTL if this is set.
0 commit comments