Skip to content

Commit

Permalink
[frontend] In Observable / Indicators composed with this observable v…
Browse files Browse the repository at this point in the history
…iew, fix the css(#9279)
  • Loading branch information
Gwendoline-FAVRE-FELIX authored Jan 28, 2025
1 parent 1fba256 commit 9276b5a
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import ListItemText from '@mui/material/ListItemText';
import { graphql } from 'react-relay';
import Skeleton from '@mui/material/Skeleton';
import * as R from 'ramda';
import { truncate } from '../../../../utils/String';
import ItemIcon from '../../../../components/ItemIcon';
import { deleteNodeFromEdge } from '../../../../utils/store';
import { useFormatter } from '../../../../components/i18n';
Expand Down Expand Up @@ -333,13 +332,9 @@ 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,
120,
);
const defaultDescription = (data) => (data.parent_types.includes('Stix-Cyber-Observable')
? data.x_opencti_description
: data.description);

return (
<>
Expand Down Expand Up @@ -393,6 +388,14 @@ const StixCoreRelationshipCreationFromEntityList = ({
<ListItemText
primary={node.name}
secondary={defaultDescription(node)}
sx={{
'.MuiListItemText-primary, .MuiListItemText-secondary': {
overflowX: 'hidden',
textOverflow: 'ellipsis',
whiteSpace: 'nowrap',
marginRight: '20px',
},
}}
/>
</ListItem>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const useStyles = makeStyles<Theme>((theme) => ({
createButtonContextual: {
position: 'fixed',
bottom: 30,
right: 100,
right: 30,
transition: theme.transitions.create('right', {
easing: theme.transitions.easing.sharp,
duration: theme.transitions.duration.enteringScreen,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class StixCyberObservableAddIndicators extends Component {
size="large"
color="primary"
>
<Close fontSize="small" color="primary" />
<Close fontSize="small" color="primary"/>
</IconButton>
<Typography variant="h6" classes={{ root: classes.title }}>
{t('Add indicators')}
Expand Down Expand Up @@ -134,8 +134,14 @@ class StixCyberObservableAddIndicators extends Component {
}}
/>
</div>
<div className={classes.createButton}>
<IndicatorCreation
display={open}
contextual
paginationOptions={paginationOptions}
/>
</div>
</Drawer>
<IndicatorCreation display={open} contextual paginationOptions={paginationOptions} />
</>
);
}
Expand Down

0 comments on commit 9276b5a

Please sign in to comment.