Skip to content

chore(UI): remove template link from workspaces page row #6882

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

Merged
merged 2 commits into from
Mar 30, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 4 additions & 31 deletions site/src/components/WorkspacesTable/WorkspacesRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,13 @@ import KeyboardArrowRight from "@material-ui/icons/KeyboardArrowRight"
import { AvatarData } from "components/AvatarData/AvatarData"
import { WorkspaceStatusBadge } from "components/WorkspaceStatusBadge/WorkspaceStatusBadge"
import { FC } from "react"
import { useNavigate, Link as RouterLink } from "react-router-dom"
import { useNavigate } from "react-router-dom"
import { getDisplayWorkspaceTemplateName } from "util/workspace"
import { LastUsed } from "../LastUsed/LastUsed"
import { Workspace } from "api/typesGenerated"
import { OutdatedHelpTooltip } from "components/Tooltips/OutdatedHelpTooltip"
import { Avatar } from "components/Avatar/Avatar"
import { Stack } from "components/Stack/Stack"
import TemplateLinkIcon from "@material-ui/icons/OpenInNewOutlined"
import Link from "@material-ui/core/Link"
import { useClickableTableRow } from "hooks/useClickableTableRow"

export const WorkspacesRow: FC<{
Expand Down Expand Up @@ -58,20 +56,9 @@ export const WorkspacesRow: FC<{
</TableCell>

<TableCell>
<Link
component={RouterLink}
to={`/templates/${workspace.template_name}`}
className={styles.templateLink}
title={`Go to ${displayTemplateName} page`}
onClick={(e) => {
e.stopPropagation()
}}
>
<Stack direction="row" alignItems="center" spacing={1}>
<TemplateLinkIcon className={styles.templateLinkIcon} />
<span>{displayTemplateName}</span>
</Stack>
</Link>
<Stack direction="row" alignItems="center" spacing={1}>
<span>{displayTemplateName}</span>
</Stack>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can remove the Stack since there is a single element, you can also remove the span.

</TableCell>

<TableCell>
Expand Down Expand Up @@ -102,18 +89,4 @@ const useStyles = makeStyles((theme) => ({
display: "flex",
paddingLeft: theme.spacing(2),
},

templateLink: {
color: theme.palette.text.secondary,

"&:hover": {
color: theme.palette.text.primary,
textDecoration: "none",
},
},

templateLinkIcon: {
width: theme.spacing(1.5),
height: theme.spacing(1.5),
},
}))