Skip to content

Commit bfdfd38

Browse files
committed
chore: add organization label to workspace template column
1 parent 4843062 commit bfdfd38

File tree

2 files changed

+28
-3
lines changed

2 files changed

+28
-3
lines changed

site/src/components/AvatarData/AvatarData.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export const AvatarData: FC<AvatarDataProps> = ({
5454
css={{
5555
fontSize: 13,
5656
color: theme.palette.text.secondary,
57-
lineHeight: "150%",
57+
lineHeight: 1.5,
5858
maxWidth: 540,
5959
}}
6060
>

site/src/pages/WorkspacesPage/WorkspacesTable.tsx

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ import type { FC, ReactNode } from "react";
2828
import { useNavigate } from "react-router-dom";
2929
import { getDisplayWorkspaceTemplateName } from "utils/workspace";
3030
import { WorkspacesEmpty } from "./WorkspacesEmpty";
31+
import { useDashboard } from "modules/dashboard/useDashboard";
32+
import { visuallyHidden } from "@mui/utils";
3133

3234
export interface WorkspacesTableProps {
3335
workspaces?: readonly Workspace[];
@@ -52,6 +54,7 @@ export const WorkspacesTable: FC<WorkspacesTableProps> = ({
5254
canCreateTemplate,
5355
}) => {
5456
const theme = useTheme();
57+
const dashboard = useDashboard();
5558

5659
return (
5760
<TableContainer>
@@ -172,7 +175,7 @@ export const WorkspacesTable: FC<WorkspacesTableProps> = ({
172175
)}
173176
</Stack>
174177
}
175-
subtitle={workspace.owner_name}
178+
subtitle={`user:${workspace.owner_name}`}
176179
avatar={
177180
<ExternalAvatar
178181
src={workspace.template_icon}
@@ -189,7 +192,29 @@ export const WorkspacesTable: FC<WorkspacesTableProps> = ({
189192
</TableCell>
190193

191194
<TableCell>
192-
{getDisplayWorkspaceTemplateName(workspace)}
195+
<span css={{ display: "block" }}>
196+
{getDisplayWorkspaceTemplateName(workspace)}
197+
</span>
198+
199+
{dashboard.showOrganizations && (
200+
<span
201+
css={{
202+
display: "block",
203+
fontSize: 13,
204+
color: theme.palette.text.secondary,
205+
lineHeight: 1.5,
206+
}}
207+
>
208+
{/*
209+
Only using shorthand version of "organizations" for aesthetics,
210+
but because screen readers don't care about aesthetics, we can
211+
always display the full text to them
212+
*/}
213+
org
214+
<span css={{ ...visuallyHidden }}>anization</span>:
215+
{workspace.organization_name}
216+
</span>
217+
)}
193218
</TableCell>
194219

195220
<TableCell>

0 commit comments

Comments
 (0)