From 8892c9c8a6f59b06c1d499f5de4797fd673b3f8d Mon Sep 17 00:00:00 2001 From: Zack Cerza Date: Thu, 3 Aug 2023 12:03:23 -0600 Subject: [PATCH] JobList: Hover on status col shows failure reason This truncates the longer strings to 200 chars. Signed-off-by: Zack Cerza --- src/components/JobList/index.tsx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/components/JobList/index.tsx b/src/components/JobList/index.tsx index 1b3d2bd..54c6ed0 100644 --- a/src/components/JobList/index.tsx +++ b/src/components/JobList/index.tsx @@ -1,4 +1,5 @@ import DescriptionIcon from "@mui/icons-material/Description"; +import Tooltip from '@mui/material/Tooltip'; import type { GridCellParams, GridFilterModel, @@ -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 ( +
+ +

{params.value}

+
+
+ ); + } }, { field: "links",