Skip to content
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

Show component work types in component list items #1479

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Changes from 7 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
Expand Up @@ -10,6 +10,7 @@ import ListItemSecondaryAction from "@mui/material/ListItemSecondaryAction";
import ZoomInIcon from "@mui/icons-material/ZoomIn";
import IconButton from "@mui/material/IconButton";
import ListItemText from "@mui/material/ListItemText";
import { Grid, Chip } from "@mui/material";
import ErrorOutlineIcon from "@mui/icons-material/ErrorOutline";
import { COLORS } from "./mapStyleSettings";
import ProjectStatusBadge from "../ProjectStatusBadge";
Expand All @@ -33,6 +34,16 @@ const useStyles = makeStyles((theme) => ({
additionalListItemText: {
display: "block",
},
workTypeChip: {
"& .MuiChip-label": {
display: "block",
whiteSpace: "normal",
},
fontWeight: "500",
fontSize: "12px",
borderRadius: "2rem",
height: "1.75rem",
},
}));

export default function ComponentListItem({
Expand Down Expand Up @@ -107,6 +118,18 @@ export default function ComponentListItem({
/>
</ListItem>
)}
<ListItem className={classes.nested}>
<Grid container spacing={0.5}>
{component.moped_proj_component_work_types.map((element) => (
<Grid item key={element.id}>
<Chip
label={element.moped_work_type.name}
className={classes.workTypeChip}
/>
</Grid>
))}
</Grid>
</ListItem>
{component.description && (
<ListItem className={classes.nested}>
<ListItemText secondary={component.description} />
Expand Down