Skip to content

fix(site): show wsproxy errors in context in WorkspaceProxyPage #11556

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 11, 2024
Merged
Changes from 1 commit
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
Next Next commit
fix(site): WorkspaceProxyPage: show wsproxy errors in context
  • Loading branch information
johnstcn committed Jan 11, 2024
commit 5ada1439c5f00f160da20e49e1f19b83ece911c7
13 changes: 10 additions & 3 deletions site/src/pages/HealthPage/WorkspaceProxyPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ export const WorkspaceProxyPage = () => {
</Header>

<Main>
{workspace_proxy.error ? (
<Alert severity="error">{workspace_proxy.error}</Alert>
) : null}
{workspace_proxy.warnings.map((warning) => {
return (
<Alert key={warning.code} severity="warning">
Expand All @@ -48,6 +51,7 @@ export const WorkspaceProxyPage = () => {
})}

{regions.map((region) => {
const errors = region.status?.report?.errors ?? [];
const warnings = region.status?.report?.warnings ?? [];

return (
Expand Down Expand Up @@ -138,14 +142,17 @@ export const WorkspaceProxyPage = () => {
color: theme.palette.text.secondary,
}}
>
{warnings.length > 0 ? (
{warnings.length === 0 && errors.length === 0 ? (
<span>OK</span>
) : (
<div css={{ display: "flex", flexDirection: "column" }}>
{errors.map((error, i) => (
<span key={i}>{error}</span>
))}
{warnings.map((warning, i) => (
<span key={i}>{warning}</span>
))}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried turning this into an <ul> and playing around with list-style-type to prefix these with 🚫 or ⚠️ respectively, but this didn't seem to do what I wanted.

</div>
) : (
<span>No warnings</span>
)}
<span data-chromatic="ignore">
{createDayString(region.updated_at)}
Expand Down