Skip to content

fix: removing noisy shutdown snapshots #2899

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 11, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions site/src/components/WorkspaceSchedule/WorkspaceSchedule.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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: {
Expand Down