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

JobList: Hover on status col shows failure reason #38

Merged
merged 1 commit into from
Aug 30, 2023
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
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