Skip to content

Commit 78e903e

Browse files
committed
update storybook
1 parent 4f9bed5 commit 78e903e

File tree

1 file changed

+17
-63
lines changed

1 file changed

+17
-63
lines changed

site/src/components/WorkspaceScheduleForm/WorkspaceScheduleForm.stories.tsx

+17-63
Original file line numberDiff line numberDiff line change
@@ -18,97 +18,51 @@ export default {
1818

1919
const Template: Story<WorkspaceScheduleFormProps> = (args) => <WorkspaceScheduleForm {...args} />
2020

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 = {
2423
initialValues: {
2524
...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,
3526
},
3627
onCancel: () => action("onCancel"),
3728
onSubmit: () => action("onSubmit"),
3829
}
3930

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 = {
4333
initialValues: {
4434
...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,
5436
},
5537
onCancel: () => action("onCancel"),
5638
onSubmit: () => action("onSubmit"),
5739
}
5840

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 = {
6243
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,
7246
},
7347
onCancel: () => action("onCancel"),
7448
onSubmit: () => action("onSubmit"),
7549
}
7650

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 = {
8053
initialValues: {
8154
...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,
9256
},
9357
onCancel: () => action("onCancel"),
9458
onSubmit: () => action("onSubmit"),
9559
}
9660

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 = {
10063
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,
11266
},
11367
onCancel: () => action("onCancel"),
11468
onSubmit: () => action("onSubmit"),

0 commit comments

Comments
 (0)