From 30e18a89441789c1961b4de2407e941f9f753f89 Mon Sep 17 00:00:00 2001 From: Valentin Bouzin Date: Fri, 15 Nov 2024 09:13:28 +0100 Subject: [PATCH 1/2] [backend] When adding a relationship to a container assigned to someone, notification shows unknown (#8684) --- .../opencti-graphql/src/database/entity-representative.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/opencti-platform/opencti-graphql/src/database/entity-representative.js b/opencti-platform/opencti-graphql/src/database/entity-representative.js index 1cffe7a1d873..9ee65baa93fe 100644 --- a/opencti-platform/opencti-graphql/src/database/entity-representative.js +++ b/opencti-platform/opencti-graphql/src/database/entity-representative.js @@ -58,6 +58,8 @@ export const extractEntityRepresentativeName = (entityData) => { mainValue = entityData.observable_value; } else if (isNotEmptyField(entityData.indicator_pattern)) { mainValue = entityData.indicator_pattern; + } else if (isNotEmptyField(entityData.relationship_type)) { + mainValue = extractRelationshipRepresentativeName(entityData); } else if (isNotEmptyField(entityData.source_name)) { mainValue = `${entityData.source_name}${entityData.external_id ? ` (${entityData.external_id})` : ''}`; } else if (isNotEmptyField(entityData.phase_name)) { From 5f7f77fa4629d4e7c9108aa6ac3911a266d2c285 Mon Sep 17 00:00:00 2001 From: Valentin Bouzin Date: Fri, 15 Nov 2024 10:23:16 +0100 Subject: [PATCH 2/2] add query function edited to avoid duplications --- .../StixCoreRelationshipCreation.jsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/opencti-platform/opencti-front/src/private/components/common/stix_core_relationships/StixCoreRelationshipCreation.jsx b/opencti-platform/opencti-front/src/private/components/common/stix_core_relationships/StixCoreRelationshipCreation.jsx index 13c0c0dbf054..a63576b5772e 100644 --- a/opencti-platform/opencti-front/src/private/components/common/stix_core_relationships/StixCoreRelationshipCreation.jsx +++ b/opencti-platform/opencti-front/src/private/components/common/stix_core_relationships/StixCoreRelationshipCreation.jsx @@ -292,13 +292,13 @@ class StixCoreRelationshipCreation extends Component { ), )(values); // eslint-disable-next-line no-await-in-loop - latestResponse = await commitWithPromise(finalValues, this.props.handleResult); - this.props.handleResult(latestResponse, true); + latestResponse = await commitWithPromise(finalValues); + const lastObject = current === total; + this.props.handleResult(latestResponse, !lastObject); current += 1; this.setState({ progress: Math.round((current * 100) / total) }); } } - this.props.handleResult(latestResponse); this.setState({ progress: 0, displayProgress: false }); }