fix: convert workspace id in db2sdk.WorkspaceAppStatus (#17201)

This was causing no status to be rendered in the list, and
`latest_app_status` to always be nil.
This commit is contained in:
Kyle Carberry
2025-04-01 14:49:32 -04:00
committed by GitHub
parent 900e125e4a
commit f3e5bb9276
2 changed files with 8 additions and 2 deletions

View File

@ -539,6 +539,7 @@ func WorkspaceAppStatus(status database.WorkspaceAppStatus) codersdk.WorkspaceAp
return codersdk.WorkspaceAppStatus{
ID: status.ID,
CreatedAt: status.CreatedAt,
WorkspaceID: status.WorkspaceID,
AgentID: status.AgentID,
AppID: status.AppID,
NeedsUserAttention: status.NeedsUserAttention,

View File

@ -4,6 +4,7 @@ import AppsIcon from "@mui/icons-material/Apps";
import CheckCircle from "@mui/icons-material/CheckCircle";
import ErrorIcon from "@mui/icons-material/Error";
import HelpOutline from "@mui/icons-material/HelpOutline";
import HourglassEmpty from "@mui/icons-material/HourglassEmpty";
import InsertDriveFile from "@mui/icons-material/InsertDriveFile";
import OpenInNew from "@mui/icons-material/OpenInNew";
import Warning from "@mui/icons-material/Warning";
@ -18,7 +19,6 @@ import type {
} from "api/typesGenerated";
import { useProxy } from "contexts/ProxyContext";
import { formatDistance, formatDistanceToNow } from "date-fns";
import { DividerWithText } from "pages/DeploymentSettingsPage/LicensesSettingsPage/DividerWithText";
import type { FC } from "react";
import { createAppLinkHref } from "utils/apps";
@ -54,7 +54,12 @@ const getStatusIcon = (
case "failure":
return <ErrorIcon sx={{ color, fontSize: 18 }} />;
case "working":
return <CircularProgress size={18} sx={{ color }} />;
// Use Hourglass for past "working" states, spinner for the current one
return isLatest ? (
<CircularProgress size={18} sx={{ color }} />
) : (
<HourglassEmpty sx={{ color, fontSize: 18 }} />
);
default:
return <Warning sx={{ color, fontSize: 18 }} />;
}