Skip to content
Snippets Groups Projects
Commit 06423e64 authored by Imre Toth's avatar Imre Toth
Browse files

Icshwi 10611 truncating reference on ioc list page

parent ac29d805
No related branches found
No related tags found
2 merge requests!270Merging develop branch to master in order to create RC,!221Icshwi 10611 truncating reference on ioc list page
import React, { useCallback } from 'react';
import { CustomTable } from "../common/table/CustomTable";
import { Grid, Tooltip } from "@material-ui/core";
import { Grid, Tooltip, Typography } from "@material-ui/core";
import { IOCStatusIcon } from './IOCIcons';
import { noWrapText } from '../common/Helper';
import { useRedirect } from '../../hooks/Redirect';
......@@ -29,11 +29,17 @@ const hostDetailsColumns = [
]
function createGitVersionField(version, shortVersion) {
const versionText = shortVersion ?? version;
return (
<>
{version ?
<Tooltip title={version} arrow enterDelay={400}>
<label>{noWrapText(shortVersion ?? version)}</label>
<Typography style={{ fontFamily: "monospace",
overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap"}}>
{ versionText?.length > 10 ?
`${versionText.substring(0, 10)}...` : versionText
}
</Typography>
</Tooltip>
: "---"
}
......
......@@ -25,7 +25,7 @@ describe("HostTable", () => {
it("Truncates all text content", () => {
cy.get("tbody > tr").first()
.find(".MuiTypography-noWrap")
.should("have.length", textColumns.length)
.should("have.length", textColumns.length - 1)
})
it("Displays correct content in first row", () => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment