Skip to content

Commit

Permalink
JobList: Hover on status col shows failure reason
Browse files Browse the repository at this point in the history
This truncates the longer strings to 200 chars.

Signed-off-by: Zack Cerza <[email protected]>
  • Loading branch information
zmc committed Aug 23, 2023
1 parent 3a30b59 commit 8892c9c
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/components/JobList/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import DescriptionIcon from "@mui/icons-material/Description";
import Tooltip from '@mui/material/Tooltip';
import type {
GridCellParams,
GridFilterModel,
Expand Down Expand Up @@ -28,6 +29,21 @@ const columns: GridColDef[] = [
field: "status",
width: 85,
cellClassName: (params: GridCellParams) => `status-${params.value}`,
renderCell: (params: GridRenderCellParams) => {
let failure_reason = params.row.failure_reason || "";
const max_length = 800;
const ellipsis = "...";
if ( failure_reason.length > max_length ) {
failure_reason = failure_reason.substring(0, max_length - ellipsis.length) + ellipsis;
}
return (
<div>
<Tooltip title={failure_reason}>
<p>{params.value}</p>
</Tooltip>
</div>
);
}
},
{
field: "links",
Expand Down

0 comments on commit 8892c9c

Please sign in to comment.