From fecb90d60b837d16c0aa4231faa57170b9b82a36 Mon Sep 17 00:00:00 2001 From: Kyle Carberry Date: Tue, 1 Apr 2025 14:30:51 -0400 Subject: [PATCH] fix: convert workspace id in db2sdk.WorkspaceAppStatus This was causing no status to be rendered in the list, and `latest_app_status` to always be nil. --- coderd/database/db2sdk/db2sdk.go | 1 + site/src/pages/WorkspacePage/AppStatuses.tsx | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/coderd/database/db2sdk/db2sdk.go b/coderd/database/db2sdk/db2sdk.go index 89676b1d94d46..e6d529ddadbfe 100644 --- a/coderd/database/db2sdk/db2sdk.go +++ b/coderd/database/db2sdk/db2sdk.go @@ -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, diff --git a/site/src/pages/WorkspacePage/AppStatuses.tsx b/site/src/pages/WorkspacePage/AppStatuses.tsx index 6a6376291879c..cee2ed33069ae 100644 --- a/site/src/pages/WorkspacePage/AppStatuses.tsx +++ b/site/src/pages/WorkspacePage/AppStatuses.tsx @@ -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 ; case "working": - return ; + // Use Hourglass for past "working" states, spinner for the current one + return isLatest ? ( + + ) : ( + + ); default: return ; }