Skip to content

Commit a3eeb9c

Browse files
committed
consistent formatting for alerts across pages
1 parent f0f7216 commit a3eeb9c

File tree

2 files changed

+40
-3
lines changed

2 files changed

+40
-3
lines changed

site/src/pages/CreateTemplatePage/BuildLogsDrawer.tsx

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ import { WorkspaceBuildLogs } from "modules/workspaces/WorkspaceBuildLogs/Worksp
1313
import { type FC, useLayoutEffect, useRef } from "react";
1414
import { navHeight } from "theme/constants";
1515
import { provisionersUnhealthy, useCompatibleProvisioners } from "modules/provisioners/useCompatibleProvisioners";
16+
import { Alert, AlertTitle } from "@mui/material";
17+
import { AlertDetail } from "components/Alert/Alert";
1618

1719
type BuildLogsDrawerProps = {
1820
error: unknown;
@@ -74,11 +76,33 @@ export const BuildLogsDrawer: FC<BuildLogsDrawerProps> = ({
7476

7577
{ !compatibleProvisioners && !logs ? (
7678
// If there are no compatible provisioners, warn that this job may be stuck
77-
<>No compatible provisioners</>
79+
<Alert
80+
severity="warning"
81+
css={{
82+
borderRadius: 0,
83+
border: 0,
84+
// borderBottom: `1px solid ${theme.palette.divider}`,
85+
// borderLeft: `2px solid ${theme.palette.error.main}`,
86+
}}
87+
>
88+
<AlertTitle>Build stuck</AlertTitle>
89+
<AlertDetail>No Compatible Provisioner Daemons have been configured</AlertDetail>
90+
</Alert>
7891
) : compatibleProvisionersUnhealthy && !logs && (
7992
// If there are compatible provisioners in the db, but they have not reported recent health checks,
8093
// warn that the job might be stuck
81-
<>Compatible provisioners are potentially unhealthy. Your job might be delayed</>
94+
<Alert
95+
severity="warning"
96+
css={{
97+
borderRadius: 0,
98+
border: 0,
99+
// borderBottom: `1px solid ${theme.palette.divider}`,
100+
// borderLeft: `2px solid ${theme.palette.error.main}`,
101+
}}
102+
>
103+
<AlertTitle>Build may be delayed</AlertTitle>
104+
<AlertDetail>Compatible Provisioner Daemons have been silent for a while. This may result in a delayed build</AlertDetail>
105+
</Alert>
82106
)}
83107

84108
{isMissingVariables ? (

site/src/pages/TemplateVersionEditorPage/TemplateVersionEditor.tsx

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -603,6 +603,19 @@ export const TemplateVersionEditor: FC<TemplateVersionEditorProps> = ({
603603
<AlertDetail>{templateVersion.job.error}</AlertDetail>
604604
</Alert>
605605
</div>
606+
) : !compatibleProvisioners ? (
607+
<Alert
608+
severity="warning"
609+
css={{
610+
borderRadius: 0,
611+
border: 0,
612+
borderBottom: `1px solid ${theme.palette.divider}`,
613+
borderLeft: `2px solid ${theme.palette.error.main}`,
614+
}}
615+
>
616+
<AlertTitle>Build stuck</AlertTitle>
617+
<AlertDetail>No Compatible Provisioner Daemons have been configured</AlertDetail>
618+
</Alert>
606619
) : compatibleProvisionersUnhealthy && (
607620
<div>
608621
<Alert
@@ -615,7 +628,7 @@ export const TemplateVersionEditor: FC<TemplateVersionEditorProps> = ({
615628
}}
616629
>
617630
<AlertTitle>Build may be delayed</AlertTitle>
618-
<AlertDetail>No Compatible Provisioner Daemons have been recently seen</AlertDetail>
631+
<AlertDetail>Compatible Provisioner Daemons have been silent for a while. This may result in a delayed build</AlertDetail>
619632
</Alert>
620633
</div>
621634
)}

0 commit comments

Comments
 (0)