From 7b061c0282150a4fc7463434f3add7cab81d2edf Mon Sep 17 00:00:00 2001 From: das31 <31259710+das31@users.noreply.github.com> Date: Tue, 25 Apr 2023 17:25:22 -0400 Subject: [PATCH] CEC-4206-ecu-page-cut-off (#321) * CEC-4206-ecu-page-cut-off * fix test * Update snapshots * Fix tooltip title warning --------- Co-authored-by: jwu-fisker Co-authored-by: John Wu <76966357+jwu-fisker@users.noreply.github.com> --- .../__snapshots__/ECUsTab.test.jsx.snap | 170 +++++++++++++----- .../Controls/CarECUsTable/index.jsx | 11 +- src/components/useStyles.jsx | 7 +- 3 files changed, 145 insertions(+), 43 deletions(-) diff --git a/src/components/Cars/Status/__snapshots__/ECUsTab.test.jsx.snap b/src/components/Cars/Status/__snapshots__/ECUsTab.test.jsx.snap index 89f219b..8ec2646 100644 --- a/src/components/Cars/Status/__snapshots__/ECUsTab.test.jsx.snap +++ b/src/components/Cars/Status/__snapshots__/ECUsTab.test.jsx.snap @@ -273,49 +273,94 @@ exports[`ECUsTab Render 1`] = ` class="MuiTableRow-root" > - ECUA + + ECUA + - SWVERSION + + SWVERSION + - HWVERSION + + HWVERSION + - VENDOR + + VENDOR + - SUPPLIER_SW_VERSION + + SUPPLIER_SW_VERSION + - SERIAL_NUMBER + + SERIAL_NUMBER + - BOOT_LOADER + + BOOT_LOADER + - CONFIG + + CONFIG + - FINGERPRINT + + FINGERPRINT + - ECUB + + ECUB + - SWVERSION + + SWVERSION + - HWVERSION + + HWVERSION + - - - - - CONFIG + + class="MuiTableCell-root MuiTableCell-body makeStyles-limitWidthTableCell-0 MuiTableCell-alignCenter" + > + + + + + + + + + + + CONFIG + + + + + diff --git a/src/components/Controls/CarECUsTable/index.jsx b/src/components/Controls/CarECUsTable/index.jsx index 1292e2c..af32ffc 100644 --- a/src/components/Controls/CarECUsTable/index.jsx +++ b/src/components/Controls/CarECUsTable/index.jsx @@ -4,7 +4,8 @@ import { TableCell, TableFooter, TablePagination, - TableRow + TableRow, + Tooltip } from "@material-ui/core"; import clsx from "clsx"; import React, { useEffect, useState } from "react"; @@ -136,7 +137,13 @@ const CarECUsTable = ({ vin, token, classes }) => { {tableColumns.map((column, j) => { const key = `${row.ecu + i}${column.id}` if (column.id === "updated_at") return ({LocalDateTimeString(row.updated)}); - return ({row[column.id]}); + return ( + + + {row[column.id]} + + + ); })} ))} diff --git a/src/components/useStyles.jsx b/src/components/useStyles.jsx index 1931093..edb09bc 100644 --- a/src/components/useStyles.jsx +++ b/src/components/useStyles.jsx @@ -288,7 +288,12 @@ const useStyles = makeStyles((theme) => ({ tableHeader: { textDecorationStyle: "solid", fontWeight:500, - } + }, + limitWidthTableCell: { + maxWidth: "200px", + whiteSpace: "normal", + wordWrap: "break-word", + }, })); export default useStyles;