Skip to content

Commit

Permalink
[frontend] Fix truncate by CSS (#9279)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gwendoline-FAVRE-FELIX committed Jan 28, 2025
1 parent 14ffdc5 commit a6d42e8
Showing 1 changed file with 9 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -333,14 +333,6 @@ const StixCoreRelationshipCreationFromEntityList = ({
.filter((edge) => edge.node.id !== entity.id)
.map((edge) => edge.node);

const defaultDescription = (data) => truncate(
// eslint-disable-next-line no-nested-ternary
data.parent_types.includes('Stix-Cyber-Observable')
? data.x_opencti_description
: data.description,
130,
);

return (
<>
{showForm ? (
Expand Down Expand Up @@ -392,11 +384,15 @@ const StixCoreRelationshipCreationFromEntityList = ({
</ListItemIcon>
<ListItemText
primary={node.name}
secondary={
<span style={{ whiteSpace: 'nowrap' }}>
{defaultDescription(node)}
</span>
}
secondary={node.description}
sx={{
'.MuiListItemText-primary, .MuiListItemText-secondary': {
overflowX: 'hidden',
textOverflow: 'ellipsis',
whiteSpace: 'nowrap',
marginRight: '20px',
},
}}
/>
</ListItem>
);
Expand Down

0 comments on commit a6d42e8

Please sign in to comment.