mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
fix: removing noisy shutdown snapshots (#2899)
* fix: removing noisy shutdown snapshots resolves #2685 * removing workspaceSchedule stories
This commit is contained in:
@@ -6,13 +6,6 @@ import { WorkspaceSchedule, WorkspaceScheduleProps } from "./WorkspaceSchedule"
|
||||
|
||||
dayjs.extend(utc)
|
||||
|
||||
// REMARK: There's a known problem with storybook and using date libraries that
|
||||
// call string.toLowerCase
|
||||
// SEE: https:github.com/storybookjs/storybook/issues/12208#issuecomment-697044557
|
||||
const ONE = 1
|
||||
const SEVEN = 7
|
||||
const THIRTY = 30
|
||||
|
||||
export default {
|
||||
title: "components/WorkspaceSchedule",
|
||||
component: WorkspaceSchedule,
|
||||
@@ -53,46 +46,6 @@ NoTTL.args = {
|
||||
},
|
||||
}
|
||||
|
||||
export const ShutdownRealSoon = Template.bind({})
|
||||
ShutdownRealSoon.args = {
|
||||
workspace: {
|
||||
...Mocks.MockWorkspace,
|
||||
latest_build: {
|
||||
...Mocks.MockWorkspaceBuild,
|
||||
deadline: dayjs().add(THIRTY, "minute").utc().format(),
|
||||
transition: "start",
|
||||
},
|
||||
ttl_ms: 2 * 60 * 60 * 1000, // 2 hours
|
||||
},
|
||||
}
|
||||
|
||||
export const ShutdownSoon = Template.bind({})
|
||||
ShutdownSoon.args = {
|
||||
workspace: {
|
||||
...Mocks.MockWorkspace,
|
||||
latest_build: {
|
||||
...Mocks.MockWorkspaceBuild,
|
||||
deadline: dayjs().add(ONE, "hour").utc().format(),
|
||||
transition: "start",
|
||||
},
|
||||
ttl_ms: 2 * 60 * 60 * 1000, // 2 hours
|
||||
},
|
||||
}
|
||||
|
||||
export const ShutdownLong = Template.bind({})
|
||||
ShutdownLong.args = {
|
||||
workspace: {
|
||||
...Mocks.MockWorkspace,
|
||||
|
||||
latest_build: {
|
||||
...Mocks.MockWorkspaceBuild,
|
||||
deadline: dayjs().add(SEVEN, "days").utc().format(),
|
||||
transition: "start",
|
||||
},
|
||||
ttl_ms: 7 * 24 * 60 * 60 * 1000, // 7 days
|
||||
},
|
||||
}
|
||||
|
||||
export const WorkspaceOffShort = Template.bind({})
|
||||
WorkspaceOffShort.args = {
|
||||
workspace: {
|
||||
|
||||
@@ -54,16 +54,14 @@ export const WorkspaceSchedule: FC<WorkspaceScheduleProps> = ({
|
||||
</div>
|
||||
<div>
|
||||
<span className={styles.scheduleLabel}>{ScheduleLanguage.autoStartLabel}</span>
|
||||
<span className={[styles.scheduleValue, "chromatic-ignore"].join(" ")}>
|
||||
<span className={styles.scheduleValue}>
|
||||
{autoStartDisplay(workspace.autostart_schedule)}
|
||||
</span>
|
||||
</div>
|
||||
<div>
|
||||
<span className={styles.scheduleLabel}>{ScheduleLanguage.autoStopLabel}</span>
|
||||
<Stack direction="row">
|
||||
<span className={[styles.scheduleValue, "chromatic-ignore"].join(" ")}>
|
||||
{autoStopDisplay(workspace)}
|
||||
</span>
|
||||
<span className={styles.scheduleValue}>{autoStopDisplay(workspace)}</span>
|
||||
</Stack>
|
||||
</div>
|
||||
{canUpdateWorkspace && (
|
||||
|
||||
@@ -6,13 +6,6 @@ import { WorkspaceScheduleButton, WorkspaceScheduleButtonProps } from "./Workspa
|
||||
|
||||
dayjs.extend(utc)
|
||||
|
||||
// REMARK: There's a known problem with storybook and using date libraries that
|
||||
// call string.toLowerCase
|
||||
// SEE: https:github.com/storybookjs/storybook/issues/12208#issuecomment-697044557
|
||||
const ONE = 1
|
||||
const SEVEN = 7
|
||||
const THIRTY = 30
|
||||
|
||||
export default {
|
||||
title: "components/WorkspaceScheduleButton",
|
||||
component: WorkspaceScheduleButton,
|
||||
@@ -55,46 +48,6 @@ NoTTL.args = {
|
||||
},
|
||||
}
|
||||
|
||||
export const ShutdownRealSoon = Template.bind({})
|
||||
ShutdownRealSoon.args = {
|
||||
workspace: {
|
||||
...Mocks.MockWorkspace,
|
||||
latest_build: {
|
||||
...Mocks.MockWorkspaceBuild,
|
||||
deadline: dayjs().add(THIRTY, "minute").utc().format(),
|
||||
transition: "start",
|
||||
},
|
||||
ttl_ms: 2 * 60 * 60 * 1000, // 2 hours
|
||||
},
|
||||
}
|
||||
|
||||
export const ShutdownSoon = Template.bind({})
|
||||
ShutdownSoon.args = {
|
||||
workspace: {
|
||||
...Mocks.MockWorkspace,
|
||||
latest_build: {
|
||||
...Mocks.MockWorkspaceBuild,
|
||||
deadline: dayjs().add(ONE, "hour").utc().format(),
|
||||
transition: "start",
|
||||
},
|
||||
ttl_ms: 2 * 60 * 60 * 1000, // 2 hours
|
||||
},
|
||||
}
|
||||
|
||||
export const ShutdownLong = Template.bind({})
|
||||
ShutdownLong.args = {
|
||||
workspace: {
|
||||
...Mocks.MockWorkspace,
|
||||
|
||||
latest_build: {
|
||||
...Mocks.MockWorkspaceBuild,
|
||||
deadline: dayjs().add(SEVEN, "days").utc().format(),
|
||||
transition: "start",
|
||||
},
|
||||
ttl_ms: 7 * 24 * 60 * 60 * 1000, // 7 days
|
||||
},
|
||||
}
|
||||
|
||||
export const WorkspaceOffShort = Template.bind({})
|
||||
WorkspaceOffShort.args = {
|
||||
workspace: {
|
||||
|
||||
Reference in New Issue
Block a user