Skip to content

Commit

Permalink
run timeline blank state (#6674)
Browse files Browse the repository at this point in the history
* run timeline blank state

* clean up component

* fix error
  • Loading branch information
prha committed Feb 17, 2022
1 parent 43835eb commit 5db89f5
Showing 1 changed file with 25 additions and 15 deletions.
40 changes: 25 additions & 15 deletions js_modules/dagit/packages/core/src/runs/RunTimeline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -219,25 +219,29 @@ export const RunTimeline = ({jobs, range}: {jobs: TimelineJob[]; range: [number,
}
}, []);

const height = ROW_HEIGHT * jobs.length;
const height = ROW_HEIGHT * (jobs.length || 1);

return (
<Timeline $height={TIME_HEADER_HEIGHT + height} ref={containerRef}>
{width ? (
<>
<TimeDividers interval={ONE_HOUR_MSEC} range={range} height={height} />
<div>
{jobs.map((job, ii) => (
<RunTimelineRow
key={job.key}
job={job}
top={ii * ROW_HEIGHT + TIME_HEADER_HEIGHT}
range={range}
width={width}
/>
))}
</div>
</>
jobs.length ? (
<>
<TimeDividers interval={ONE_HOUR_MSEC} range={range} height={height} />
<div>
{jobs.map((job, ii) => (
<RunTimelineRow
key={job.key}
job={job}
top={ii * ROW_HEIGHT + TIME_HEADER_HEIGHT}
range={range}
width={width}
/>
))}
</div>
</>
) : (
<NoRunsTimeline />
)
) : null}
</Timeline>
);
Expand Down Expand Up @@ -525,6 +529,12 @@ const RunTimelineRow = ({
);
};

const NoRunsTimeline = () => (
<Box flex={{justifyContent: 'center', alignItems: 'center'}} padding={24}>
No runs or upcoming runs found for this time window.
</Box>
);

const Timeline = styled.div<{$height: number}>`
${({$height}) => `height: ${$height}px;`}
position: relative;
Expand Down

0 comments on commit 5db89f5

Please sign in to comment.