-
Notifications
You must be signed in to change notification settings - Fork 988
feat: show organization name in workspaces table #14547
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
Changes from 1 commit
bfdfd38
936c21e
1d5ecdb
c4a06e9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,8 @@ import type { FC, ReactNode } from "react"; | |
import { useNavigate } from "react-router-dom"; | ||
import { getDisplayWorkspaceTemplateName } from "utils/workspace"; | ||
import { WorkspacesEmpty } from "./WorkspacesEmpty"; | ||
import { useDashboard } from "modules/dashboard/useDashboard"; | ||
import { visuallyHidden } from "@mui/utils"; | ||
|
||
export interface WorkspacesTableProps { | ||
workspaces?: readonly Workspace[]; | ||
|
@@ -52,6 +54,7 @@ export const WorkspacesTable: FC<WorkspacesTableProps> = ({ | |
canCreateTemplate, | ||
}) => { | ||
const theme = useTheme(); | ||
const dashboard = useDashboard(); | ||
|
||
return ( | ||
<TableContainer> | ||
|
@@ -172,7 +175,7 @@ export const WorkspacesTable: FC<WorkspacesTableProps> = ({ | |
)} | ||
</Stack> | ||
} | ||
subtitle={workspace.owner_name} | ||
subtitle={`user:${workspace.owner_name}`} | ||
avatar={ | ||
<ExternalAvatar | ||
src={workspace.template_icon} | ||
|
@@ -189,7 +192,29 @@ export const WorkspacesTable: FC<WorkspacesTableProps> = ({ | |
</TableCell> | ||
|
||
<TableCell> | ||
{getDisplayWorkspaceTemplateName(workspace)} | ||
<span css={{ display: "block" }}> | ||
{getDisplayWorkspaceTemplateName(workspace)} | ||
</span> | ||
|
||
{dashboard.showOrganizations && ( | ||
<span | ||
css={{ | ||
display: "block", | ||
fontSize: 13, | ||
color: theme.palette.text.secondary, | ||
lineHeight: 1.5, | ||
}} | ||
> | ||
{/* | ||
Only using shorthand version of "organizations" for aesthetics, | ||
but because screen readers don't care about aesthetics, we can | ||
always display the full text to them | ||
*/} | ||
org | ||
<span css={{ ...visuallyHidden }}>anization</span>: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. are screen readers going to handle this split well though? my gut feeling is they say "org anization" with some awful disconnected pronounciation There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tried it with the built-in Mac screen reader, but (1) I think I was just assuming that any elements that are semantically inline elements wouldn't affect pronunciation, and (2) the Mac screen reader isn't even the most popular reader by a long shot Let me change this just to be on the safe side |
||
{workspace.organization_name} | ||
</span> | ||
)} | ||
</TableCell> | ||
|
||
<TableCell> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah the wonderful subtleties of css. so annoying that this actually means something different. 🙃
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CSS is so silly sometimes