From f8e5dbdbdcfd4eed68d2bdf1471caeaa50fbf98c Mon Sep 17 00:00:00 2001 From: BrunoQuaresma Date: Thu, 2 Nov 2023 16:33:10 +0000 Subject: [PATCH 1/2] Remove extra info from the ws header --- site/src/components/Stats/Stats.tsx | 4 +- .../WorkspaceOutdatedTooltip.tsx | 2 +- .../pages/WorkspacePage/WorkspaceStats.tsx | 42 +++---------------- 3 files changed, 8 insertions(+), 40 deletions(-) diff --git a/site/src/components/Stats/Stats.tsx b/site/src/components/Stats/Stats.tsx index 8fa17d7385a83..a54f8f3a0b260 100644 --- a/site/src/components/Stats/Stats.tsx +++ b/site/src/components/Stats/Stats.tsx @@ -1,6 +1,6 @@ import { type CSSObject, type Interpolation, type Theme } from "@emotion/react"; import Box from "@mui/material/Box"; -import { type ComponentProps, type FC } from "react"; +import { ReactNode, type ComponentProps, type FC } from "react"; export const Stats: FC> = (props) => { return ; @@ -9,7 +9,7 @@ export const Stats: FC> = (props) => { export const StatsItem: FC< { label: string; - value: string | number | JSX.Element; + value: ReactNode; } & ComponentProps > = ({ label, value, ...divProps }) => { return ( diff --git a/site/src/components/WorkspaceOutdatedTooltip/WorkspaceOutdatedTooltip.tsx b/site/src/components/WorkspaceOutdatedTooltip/WorkspaceOutdatedTooltip.tsx index 080357f3c9c7b..578924159e785 100644 --- a/site/src/components/WorkspaceOutdatedTooltip/WorkspaceOutdatedTooltip.tsx +++ b/site/src/components/WorkspaceOutdatedTooltip/WorkspaceOutdatedTooltip.tsx @@ -20,7 +20,7 @@ export const Language = { outdatedLabel: "Outdated", versionTooltipText: "This workspace version is outdated and a newer version is available.", - updateVersionLabel: "Update version", + updateVersionLabel: "Update", }; interface TooltipProps { diff --git a/site/src/pages/WorkspacePage/WorkspaceStats.tsx b/site/src/pages/WorkspacePage/WorkspaceStats.tsx index bf4c37d3ecf52..74231bc0774f1 100644 --- a/site/src/pages/WorkspacePage/WorkspaceStats.tsx +++ b/site/src/pages/WorkspacePage/WorkspaceStats.tsx @@ -2,9 +2,7 @@ import Link from "@mui/material/Link"; import { WorkspaceOutdatedTooltip } from "components/WorkspaceOutdatedTooltip/WorkspaceOutdatedTooltip"; import { FC } from "react"; import { Link as RouterLink } from "react-router-dom"; -import { createDayString } from "utils/createDayString"; import { - getDisplayWorkspaceBuildInitiatedBy, getDisplayWorkspaceTemplateName, isWorkspaceOn, workspaceUpdatePolicy, @@ -37,12 +35,6 @@ import { Stack } from "components/Stack/Stack"; const Language = { workspaceDetails: "Workspace Details", templateLabel: "Template", - statusLabel: "Workspace Status", - versionLabel: "Version", - lastBuiltLabel: "Last built", - outdated: "Outdated", - upToDate: "Up to date", - byLabel: "Last built by", costLabel: "Daily cost", updatePolicy: "Update policy", }; @@ -70,9 +62,6 @@ export const WorkspaceStats: FC = ({ onDeadlineMinus, onDeadlinePlus, }) => { - const initiatedBy = getDisplayWorkspaceBuildInitiatedBy( - workspace.latest_build, - ); const displayTemplateName = getDisplayWorkspaceTemplateName(workspace); const styles = useStyles(); const deadlinePlusEnabled = maxDeadlineIncrease >= 1; @@ -92,24 +81,12 @@ export const WorkspaceStats: FC = ({ className={styles.statsItem} label={Language.templateLabel} value={ - - {displayTemplateName} - - } - /> - +
- {workspace.latest_build.template_version_name} + {displayTemplateName} {workspace.outdated && ( @@ -120,19 +97,10 @@ export const WorkspaceStats: FC = ({ ariaLabel="update version" /> )} - - } - /> - - {upperFirst(createDayString(workspace.latest_build.created_at))}{" "} - by {initiatedBy} - +
} /> + {shouldDisplayScheduleLabel(workspace) && ( Date: Thu, 2 Nov 2023 16:37:31 +0000 Subject: [PATCH 2/2] Minor row updates --- site/src/pages/WorkspacePage/BuildRow.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/site/src/pages/WorkspacePage/BuildRow.tsx b/site/src/pages/WorkspacePage/BuildRow.tsx index 693e1508dd5af..0356a87fa757e 100644 --- a/site/src/pages/WorkspacePage/BuildRow.tsx +++ b/site/src/pages/WorkspacePage/BuildRow.tsx @@ -58,7 +58,11 @@ export const BuildRow: React.FC = ({ build }) => { - + Reason: {build.reason} @@ -94,6 +98,9 @@ const styles = { buildSummary: (theme) => ({ ...(theme.typography.body1 as CSSObject), fontFamily: "inherit", + "& strong": { + fontWeight: 600, + }, }), buildInfo: (theme) => ({