@@ -18,97 +18,51 @@ export default {
18
18
19
19
const Template : Story < WorkspaceScheduleFormProps > = ( args ) => < WorkspaceScheduleForm { ...args } />
20
20
21
- export const WorkspaceNotRunning = Template . bind ( { } )
22
- WorkspaceNotRunning . args = {
23
- now : dayjs ( "2022-05-17T17:40:00Z" ) ,
21
+ export const WorkspaceWillNotShutDown = Template . bind ( { } )
22
+ WorkspaceWillNotShutDown . args = {
24
23
initialValues : {
25
24
...defaultWorkspaceSchedule ( 5 ) ,
26
- timezone : "UTC" ,
27
- } ,
28
- workspace : {
29
- ...Mocks . MockWorkspace ,
30
- latest_build : {
31
- ...Mocks . MockWorkspaceBuild ,
32
- transition : "stop" ,
33
- updated_at : "2022-05-17T17:39:00Z" ,
34
- } ,
25
+ ttl : 0 ,
35
26
} ,
36
27
onCancel : ( ) => action ( "onCancel" ) ,
37
28
onSubmit : ( ) => action ( "onSubmit" ) ,
38
29
}
39
30
40
- export const WorkspaceWillNotShutDown = Template . bind ( { } )
41
- WorkspaceWillNotShutDown . args = {
42
- now : dayjs ( "2022-05-17T17:40:00Z" ) ,
31
+ export const WorkspaceWillShutdownInAnHour = Template . bind ( { } )
32
+ WorkspaceWillShutdownInAnHour . args = {
43
33
initialValues : {
44
34
...defaultWorkspaceSchedule ( 5 ) ,
45
- timezone : "UTC" ,
46
- ttl : 0 ,
47
- } ,
48
- workspace : {
49
- ...Mocks . MockWorkspace ,
50
- latest_build : {
51
- ...Mocks . MockWorkspaceBuild ,
52
- updated_at : "2022-05-17T17:39:00Z" ,
53
- } ,
35
+ ttl : 1 ,
54
36
} ,
55
37
onCancel : ( ) => action ( "onCancel" ) ,
56
38
onSubmit : ( ) => action ( "onSubmit" ) ,
57
39
}
58
40
59
- export const WorkspaceWillShutdown = Template . bind ( { } )
60
- WorkspaceWillShutdown . args = {
61
- now : dayjs ( "2022-05-17T17:40:00Z" ) ,
41
+ export const WorkspaceWillShutdownInTwoHours = Template . bind ( { } )
42
+ WorkspaceWillShutdownInTwoHours . args = {
62
43
initialValues : {
63
- ...defaultWorkspaceSchedule ( 5 ) ,
64
- timezone : "UTC" ,
65
- } ,
66
- workspace : {
67
- ...Mocks . MockWorkspace ,
68
- latest_build : {
69
- ...Mocks . MockWorkspaceBuild ,
70
- updated_at : "2022-05-17T17:39:00Z" ,
71
- } ,
44
+ ...defaultWorkspaceSchedule ( 2 ) ,
45
+ ttl : 2 ,
72
46
} ,
73
47
onCancel : ( ) => action ( "onCancel" ) ,
74
48
onSubmit : ( ) => action ( "onSubmit" ) ,
75
49
}
76
50
77
- export const WorkspaceWillShutdownSoon = Template . bind ( { } )
78
- WorkspaceWillShutdownSoon . args = {
79
- now : dayjs ( "2022-05-17T16:39:00Z" ) ,
51
+ export const WorkspaceWillShutdownInADay = Template . bind ( { } )
52
+ WorkspaceWillShutdownInADay . args = {
80
53
initialValues : {
81
54
...defaultWorkspaceSchedule ( 2 ) ,
82
- timezone : "UTC" ,
83
- ttl : 1 ,
84
- } ,
85
- workspace : {
86
- ...Mocks . MockWorkspace ,
87
- latest_build : {
88
- ...Mocks . MockWorkspaceBuild ,
89
- deadline : "2022-05-17T18:09:00Z" ,
90
- } ,
91
- ttl_ms : 2 * 60 * 60 * 1000 , // 2 hours = shuts off at 18:09
55
+ ttl : 24 ,
92
56
} ,
93
57
onCancel : ( ) => action ( "onCancel" ) ,
94
58
onSubmit : ( ) => action ( "onSubmit" ) ,
95
59
}
96
60
97
- export const WorkspaceWillShutdownImmediately = Template . bind ( { } )
98
- WorkspaceWillShutdownImmediately . args = {
99
- now : dayjs ( "2022-05-17T17:09:00Z" ) ,
61
+ export const WorkspaceWillShutdownInTwoDays = Template . bind ( { } )
62
+ WorkspaceWillShutdownInTwoDays . args = {
100
63
initialValues : {
101
- ...defaultWorkspaceSchedule ( 1 ) ,
102
- timezone : "UTC" ,
103
- ttl : 1 ,
104
- } ,
105
- workspace : {
106
- ...Mocks . MockWorkspace ,
107
- latest_build : {
108
- ...Mocks . MockWorkspaceBuild ,
109
- deadline : "2022-05-17T18:09:00Z" ,
110
- } ,
111
- ttl_ms : 2 * 60 * 60 * 1000 , // 2 hours = shuts off at 18:09
64
+ ...defaultWorkspaceSchedule ( 2 ) ,
65
+ ttl : 48 ,
112
66
} ,
113
67
onCancel : ( ) => action ( "onCancel" ) ,
114
68
onSubmit : ( ) => action ( "onSubmit" ) ,
0 commit comments