Skip to content

site: don't show progress bar for new templates #5298

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
Dec 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,21 @@ Starting.args = {
},
}

// When the transition stats are returning null, the progress bar should not be
// displayed
export const StartingUnknown = Template.bind({})
StartingUnknown.args = {
...Starting.args,
transitionStats: undefined,
transitionStats: {
// HACK: the codersdk type generator doesn't support null values, but this
// can be null when the template is new.
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- Read comment above
// @ts-ignore-error
P50: null,
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- Read comment above
// @ts-ignore-error
P95: null,
},
}

export const StartingPassedEstimate = Template.bind({})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ export const WorkspaceBuildProgress: FC<WorkspaceBuildProgressProps> = ({
setTimeout(updateProgress, 5)
}, [progressValue, job, transitionStats])

// HACK: the codersdk type generator doesn't support null values, but this
// can be null when the template is new.
if ((transitionStats.P50 as number | null) === null) {
return <></>
}
return (
<div className={styles.stack}>
<LinearProgress
Expand Down