Skip to content

Commit

Permalink
[frontend] Fix errors (#7634)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gwendoline-FAVRE-FELIX committed Sep 25, 2024
1 parent 104ca3f commit 87e8f82
Showing 1 changed file with 22 additions and 26 deletions.
48 changes: 22 additions & 26 deletions opencti-platform/opencti-front/src/utils/Graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -769,34 +769,30 @@ export const buildGraphData = (objects, graphData, t) => {
? 'relationship'
: n.entity_type
] || graphLevel.Unknown,
name: `${
n.relationship_type
? `<strong>${t(
`relationship_${n.relationship_type}`,
)}</strong>\n${t('Created the')} ${dateFormat(n.created)}\n${t(
'Start time',
)} ${
isNone(n.start_time || n.first_seen)
? '-'
: dateFormat(n.start_time || n.first_seen)
name: (() => {
if (n.relationship_type) {
return `<strong>${t(`relationship_${n.relationship_type}`)}</strong>\n${t('Created the')} ${dateFormat(n.created)}\n${t('Start time')} ${
isNone(n.start_time || n.first_seen) ? '-' : dateFormat(n.start_time || n.first_seen)
}\n${t('Stop time')} ${
isNone(n.stop_time || n.last_seen)
? '-'
: dateFormat(n.stop_time || n.last_seen)
}`
: n.entity_type === 'StixFile' && n.observable_value
? n.observable_value
: getMainRepresentative(n)
}\n${dateFormat(defaultDate(n))}`,
isNone(n.stop_time || n.last_seen) ? '-' : dateFormat(n.stop_time || n.last_seen)
}\n${dateFormat(defaultDate(n))}`;
} if (n.entity_type === 'StixFile' && n.observable_value) {
return `${n.observable_value}\n${dateFormat(defaultDate(n))}`;
}
return `${getMainRepresentative(n)}\n${dateFormat(defaultDate(n))}`;
})(),
defaultDate: jsDate(defaultDate(n)),
label: n.parent_types.includes('basic-relationship')
? t(`relationship_${n.relationship_type}`)
: n.entity_type === 'StixFile' && n.observable_value
? n.observable_value
: truncate(
getMainRepresentative(n),
n.entity_type === 'Attack-Pattern' ? 30 : 20,
),
label: (() => {
if (n.parent_types.includes('basic-relationship')) {
return t(`relationship_${n.relationship_type}`);
} if (n.entity_type === 'StixFile' && n.observable_value) {
return n.observable_value;
}
return truncate(
getMainRepresentative(n),
n.entity_type === 'Attack-Pattern' ? 30 : 20,
);
})(),
img:
graphImages[
n.parent_types.includes('basic-relationship')
Expand Down

0 comments on commit 87e8f82

Please sign in to comment.