Skip to content

Commit

Permalink
Add labels to deployments list page (#3811)
Browse files Browse the repository at this point in the history
  • Loading branch information
khanhtc1202 authored Jul 20, 2022
1 parent ac2a709 commit e05265b
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion web/src/components/deployments-page/deployment-item/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Box, ListItem, makeStyles, Typography } from "@material-ui/core";
import { Box, Chip, ListItem, makeStyles, Typography } from "@material-ui/core";
import dayjs from "dayjs";
import { FC, memo } from "react";
import { Link as RouterLink } from "react-router-dom";
Expand Down Expand Up @@ -34,6 +34,10 @@ const useStyles = makeStyles((theme) => ({
...ellipsis,
color: theme.palette.text.hint,
},
labelChip: {
marginLeft: theme.spacing(1),
marginBottom: theme.spacing(0.25),
},
}));

export interface DeploymentItemProps {
Expand Down Expand Up @@ -89,6 +93,13 @@ export const DeploymentItem: FC<DeploymentItemProps> = memo(
className={classes.info}
>
{APPLICATION_KIND_TEXT[deployment.kind]}
{deployment?.labelsMap.map(([key, value], i) => (
<Chip
label={key + ": " + value}
className={classes.labelChip}
key={i}
/>
))}
</Typography>
</Box>
<Typography variant="body1" className={classes.description}>
Expand Down

0 comments on commit e05265b

Please sign in to comment.