Skip to content

fix: [M3-9124] - Link styles in KubernetesClusterRow and clean up one-off styles #11523

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
Changes from all commits
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
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import { Chip } from '@linode/ui';
import Grid from '@mui/material/Unstable_Grid2';
import * as React from 'react';
import { Link } from 'react-router-dom';
import { makeStyles } from 'tss-react/mui';
import { Chip, Stack } from '@linode/ui';
import React from 'react';

import { DateTimeDisplay } from 'src/components/DateTimeDisplay';
import { Hidden } from 'src/components/Hidden';
import { Link } from 'src/components/Link';
import { TableCell } from 'src/components/TableCell';
import { TableRow } from 'src/components/TableRow';
import { useAllKubernetesNodePoolQuery } from 'src/queries/kubernetes';
Expand All @@ -23,33 +21,6 @@ import { ClusterChips } from './ClusterChips';

import type { KubeNodePoolResponse, KubernetesCluster } from '@linode/api-v4';

const useStyles = makeStyles()(() => ({
clusterRow: {
'&:before': {
display: 'none',
},
},
labelStatusWrapper: {
alignItems: 'center',
display: 'flex',
flexFlow: 'row nowrap',
whiteSpace: 'nowrap',
},
link: {
'&:hover, &:focus': {
textDecoration: 'underline',
},
display: 'block',
fontSize: '.875rem',
lineHeight: '1.125rem',
},
version: {
alignItems: 'center',
display: 'flex',
justifyContent: 'flex-start',
},
}));

export interface Props {
cluster: KubernetesCluster;
openDeleteDialog: (
Expand All @@ -62,7 +33,6 @@ export interface Props {

export const KubernetesClusterRow = (props: Props) => {
const { cluster, openDeleteDialog, openUpgradeDialog } = props;
const { classes } = useStyles();

const { data: pools } = useAllKubernetesNodePoolQuery(cluster.id);
const typesQuery = useSpecificTypes(pools?.map((pool) => pool.type) ?? []);
Expand All @@ -86,46 +56,35 @@ export const KubernetesClusterRow = (props: Props) => {

return (
<TableRow
className={classes.clusterRow}
data-qa-cluster-cell={cluster.id}
data-testid={'cluster-row'}
key={cluster.id}
>
<TableCell data-qa-cluster-label>
<Grid
alignItems="center"
container
<Stack
direction="row"
justifyContent="space-between"
wrap="nowrap"
spacing={1}
alignItems="center"
>
<Grid className="py0">
<div className={classes.labelStatusWrapper}>
<Link
className={classes.link}
tabIndex={0}
to={`/kubernetes/clusters/${cluster.id}/summary`}
>
{cluster.label}
</Link>
</div>
</Grid>
<ClusterChips cluster={cluster} sx={{ marginLeft: 1 }} />
</Grid>
<Link tabIndex={0} to={`/kubernetes/clusters/${cluster.id}/summary`}>
{cluster.label}
</Link>
<ClusterChips cluster={cluster} />
</Stack>
</TableCell>
<Hidden mdDown>
<TableCell data-qa-cluster-version>
<div className={classes.version}>
{cluster.k8s_version}
{hasUpgrade && (
<Chip
clickable
label="UPGRADE"
onClick={openUpgradeDialog}
size="small"
sx={{ mx: 2 }}
/>
)}
</div>
{cluster.k8s_version}
{hasUpgrade && (
<Chip
clickable
label="UPGRADE"
onClick={openUpgradeDialog}
size="small"
sx={{ mx: 2 }}
/>
)}
</TableCell>
<TableCell data-qa-cluster-date>
<DateTimeDisplay value={cluster.created} />
Expand Down
Loading