From 6b4cd15646c45a9ad30cbf6b04124c16eca68e1f Mon Sep 17 00:00:00 2001 From: BrunoQuaresma Date: Wed, 14 May 2025 17:55:15 +0000 Subject: [PATCH 1/2] fix: show no provisioners warning --- site/src/pages/CreateTemplatePage/BuildLogsDrawer.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/site/src/pages/CreateTemplatePage/BuildLogsDrawer.tsx b/site/src/pages/CreateTemplatePage/BuildLogsDrawer.tsx index 35ad8eaba60cf..3f7099ebe673a 100644 --- a/site/src/pages/CreateTemplatePage/BuildLogsDrawer.tsx +++ b/site/src/pages/CreateTemplatePage/BuildLogsDrawer.tsx @@ -29,10 +29,6 @@ export const BuildLogsDrawer: FC = ({ variablesSectionRef, ...drawerProps }) => { - const matchingProvisioners = templateVersion?.matched_provisioners?.count; - const availableProvisioners = - templateVersion?.matched_provisioners?.available; - const logs = useWatchVersionLogs(templateVersion); const logsContainer = useRef(null); @@ -60,6 +56,10 @@ export const BuildLogsDrawer: FC = ({ error instanceof JobError && error.job.error_code === "REQUIRED_TEMPLATE_VARIABLES"; + const matchingProvisioners = templateVersion?.matched_provisioners?.count; + const availableProvisioners = + templateVersion?.matched_provisioners?.available; + return (
@@ -85,7 +85,7 @@ export const BuildLogsDrawer: FC = ({ drawerProps.onClose(); }} /> - ) : logs ? ( + ) : availableProvisioners && availableProvisioners > 0 && logs ? (
From 99df7a431194b9e484d0ddae49e1f65edfa073db Mon Sep 17 00:00:00 2001 From: BrunoQuaresma Date: Wed, 14 May 2025 18:15:08 +0000 Subject: [PATCH 2/2] Fix storybook --- site/src/pages/CreateTemplatePage/BuildLogsDrawer.stories.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/site/src/pages/CreateTemplatePage/BuildLogsDrawer.stories.tsx b/site/src/pages/CreateTemplatePage/BuildLogsDrawer.stories.tsx index 29229fadfd0ad..f2a773c09c099 100644 --- a/site/src/pages/CreateTemplatePage/BuildLogsDrawer.stories.tsx +++ b/site/src/pages/CreateTemplatePage/BuildLogsDrawer.stories.tsx @@ -78,6 +78,10 @@ export const Logs: Story = { ...MockTemplateVersion.job, status: "running", }, + matched_provisioners: { + count: 1, + available: 1, + }, }, }, decorators: [withWebSocket],