mirror of
https://github.com/coder/coder.git
synced 2025-07-15 22:20:27 +00:00
fix: Don't show progress bar for new templates (#5298)
This commit is contained in:
@ -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({})
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user