Skip to content
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 @@ -78,6 +78,10 @@ export const Logs: Story = {
...MockTemplateVersion.job,
status: "running",
},
matched_provisioners: {
count: 1,
available: 1,
},
},
},
decorators: [withWebSocket],
Expand Down
10 changes: 5 additions & 5 deletions site/src/pages/CreateTemplatePage/BuildLogsDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ export const BuildLogsDrawer: FC<BuildLogsDrawerProps> = ({
variablesSectionRef,
...drawerProps
}) => {
const matchingProvisioners = templateVersion?.matched_provisioners?.count;
const availableProvisioners =
templateVersion?.matched_provisioners?.available;

const logs = useWatchVersionLogs(templateVersion);
const logsContainer = useRef<HTMLDivElement>(null);

Expand Down Expand Up @@ -60,6 +56,10 @@ export const BuildLogsDrawer: FC<BuildLogsDrawerProps> = ({
error instanceof JobError &&
error.job.error_code === "REQUIRED_TEMPLATE_VARIABLES";

const matchingProvisioners = templateVersion?.matched_provisioners?.count;
const availableProvisioners =
templateVersion?.matched_provisioners?.available;

return (
<Drawer anchor="right" {...drawerProps}>
<div css={styles.root}>
Expand All @@ -85,7 +85,7 @@ export const BuildLogsDrawer: FC<BuildLogsDrawerProps> = ({
drawerProps.onClose();
}}
/>
) : logs ? (
) : availableProvisioners && availableProvisioners > 0 && logs ? (
<section ref={logsContainer} css={styles.logs}>
<WorkspaceBuildLogs logs={logs} css={{ border: 0 }} />
</section>
Expand Down
Loading