File tree Expand file tree Collapse file tree 3 files changed +4
-3
lines changed
components/WorkspaceScheduleForm
pages/WorkspaceSchedulePage Expand file tree Collapse file tree 3 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,6 @@ import {
21
21
defaultSchedule ,
22
22
emptySchedule ,
23
23
} from "pages/WorkspaceSchedulePage/schedule"
24
- import { defaultTTL } from "pages/WorkspaceSchedulePage/ttl"
25
24
import { ChangeEvent , FC } from "react"
26
25
import * as Yup from "yup"
27
26
import { getFormHelpers } from "../../util/formUtils"
@@ -81,6 +80,7 @@ export interface WorkspaceScheduleFormProps {
81
80
onSubmit : ( values : WorkspaceScheduleFormValues ) => void
82
81
// for storybook
83
82
initialTouched ?: FormikTouched < WorkspaceScheduleFormValues >
83
+ defaultTTL : number
84
84
}
85
85
86
86
export interface WorkspaceScheduleFormValues {
@@ -192,6 +192,7 @@ export const WorkspaceScheduleForm: FC<
192
192
onCancel,
193
193
onSubmit,
194
194
initialTouched,
195
+ defaultTTL
195
196
} ) => {
196
197
const styles = useStyles ( )
197
198
Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ export const WorkspaceSchedulePage: React.FC = () => {
35
35
getWorkspaceError,
36
36
permissions,
37
37
workspace,
38
+ template
38
39
} = scheduleState . context
39
40
40
41
// Get workspace on mount and whenever the args for getting a workspace change.
@@ -103,6 +104,7 @@ export const WorkspaceSchedulePage: React.FC = () => {
103
104
submitScheduleError = { submitScheduleError }
104
105
initialValues = { { ...autoStart , ...autoStop } }
105
106
isLoading = { scheduleState . tags . has ( "loading" ) }
107
+ defaultTTL = { template . default_ttl_ms }
106
108
onCancel = { ( ) => {
107
109
navigate ( `/@${ username } /${ workspaceName } ` )
108
110
} }
Original file line number Diff line number Diff line change @@ -5,8 +5,6 @@ export interface AutoStop {
5
5
6
6
export const emptyTTL = 0
7
7
8
- export const defaultTTL = 12
9
-
10
8
const msToHours = ( ms : number ) => Math . round ( ms / ( 1000 * 60 * 60 ) )
11
9
12
10
export const ttlMsToAutoStop = ( ttl_ms ?: number ) : AutoStop =>
You can’t perform that action at this time.
0 commit comments