From c1c9abb9dfe2b2eafd454a6e01d816d162dec6b1 Mon Sep 17 00:00:00 2001 From: Samuel Hassine Date: Wed, 8 Mar 2023 16:21:07 +0100 Subject: [PATCH] [front] Enhance infrastructures list --- .../src/components/ItemPatternType.tsx | 4 +- .../analysis/ExternalReferences.tsx | 2 +- .../private/components/analysis/Reports.tsx | 16 +- .../private/components/cases/Incidents.tsx | 2 +- .../private/components/events/Incidents.tsx | 2 +- .../components/observations/Artifacts.js | 23 ++- .../components/observations/Indicators.tsx | 26 ++-- .../observations/Infrastructures.js | 53 +++++-- .../observations/StixCyberObservables.tsx | 4 +- .../observations/artifacts/ArtifactLine.js | 45 ++++++ .../observations/indicators/IndicatorLine.js | 42 +++-- .../indicators/IndicatorsLines.tsx | 146 +++++++++--------- .../infrastructures/InfrastructureLine.js | 92 ++++++++++- .../src/schema/relay.schema.graphql | 11 +- .../config/schema/opencti.graphql | 10 ++ .../opencti-graphql/src/generated/graphql.ts | 11 +- .../src/resolvers/attackPattern.js | 1 + .../opencti-graphql/src/resolvers/city.js | 1 + .../src/resolvers/container.js | 1 + .../opencti-graphql/src/resolvers/country.js | 1 + .../src/resolvers/courseOfAction.js | 1 + .../src/resolvers/individual.js | 1 + .../src/resolvers/infrastructure.js | 1 + .../opencti-graphql/src/resolvers/opinion.js | 3 +- 24 files changed, 361 insertions(+), 138 deletions(-) diff --git a/opencti-platform/opencti-front/src/components/ItemPatternType.tsx b/opencti-platform/opencti-front/src/components/ItemPatternType.tsx index a60576e31394..1765b8ffe7e8 100644 --- a/opencti-platform/opencti-front/src/components/ItemPatternType.tsx +++ b/opencti-platform/opencti-front/src/components/ItemPatternType.tsx @@ -1,7 +1,6 @@ import React, { FunctionComponent } from 'react'; import Chip from '@mui/material/Chip'; import makeStyles from '@mui/styles/makeStyles'; -import { useFormatter } from './i18n'; const styles = makeStyles(() => ({ chip: { @@ -93,7 +92,6 @@ const ItemPatternType: FunctionComponent = ({ variant, label, }) => { - const { t } = useFormatter(); const classes = styles(); const style = variant === 'inList' ? classes.chipInList : classes.chip; const hasPredefinedStyle = Object.keys(inlineStyles).includes(label); @@ -101,7 +99,7 @@ const ItemPatternType: FunctionComponent = ({ ); }; diff --git a/opencti-platform/opencti-front/src/private/components/analysis/ExternalReferences.tsx b/opencti-platform/opencti-front/src/private/components/analysis/ExternalReferences.tsx index 9570eb1b7105..ff30381adb66 100644 --- a/opencti-platform/opencti-front/src/private/components/analysis/ExternalReferences.tsx +++ b/opencti-platform/opencti-front/src/private/components/analysis/ExternalReferences.tsx @@ -63,7 +63,7 @@ const ExternalReferences: FunctionComponent = () => { isSortable: isRuntimeSort, }, created: { - label: 'Creation date', + label: 'Date', width: '15%', isSortable: true, }, diff --git a/opencti-platform/opencti-front/src/private/components/analysis/Reports.tsx b/opencti-platform/opencti-front/src/private/components/analysis/Reports.tsx index b2e15fdba651..121ba8c6d7f5 100644 --- a/opencti-platform/opencti-front/src/private/components/analysis/Reports.tsx +++ b/opencti-platform/opencti-front/src/private/components/analysis/Reports.tsx @@ -220,14 +220,14 @@ const Reports: FunctionComponent = ({ ); }; return ( - -
- {renderLines()} - - - -
-
+ +
+ {renderLines()} + + + +
+
); }; diff --git a/opencti-platform/opencti-front/src/private/components/cases/Incidents.tsx b/opencti-platform/opencti-front/src/private/components/cases/Incidents.tsx index fbf913501751..ec5576f55d25 100644 --- a/opencti-platform/opencti-front/src/private/components/cases/Incidents.tsx +++ b/opencti-platform/opencti-front/src/private/components/cases/Incidents.tsx @@ -106,7 +106,7 @@ const Incidents: FunctionComponent = () => { isSortable: false, }, created: { - label: 'Creation date', + label: 'Date', width: '10%', isSortable: true, }, diff --git a/opencti-platform/opencti-front/src/private/components/events/Incidents.tsx b/opencti-platform/opencti-front/src/private/components/events/Incidents.tsx index 37d4f9c12e1d..082777a8a4bd 100644 --- a/opencti-platform/opencti-front/src/private/components/events/Incidents.tsx +++ b/opencti-platform/opencti-front/src/private/components/events/Incidents.tsx @@ -110,7 +110,7 @@ const Incidents: FunctionComponent = () => { isSortable: false, }, created: { - label: 'Creation date', + label: 'Date', width: '10%', isSortable: true, }, diff --git a/opencti-platform/opencti-front/src/private/components/observations/Artifacts.js b/opencti-platform/opencti-front/src/private/components/observations/Artifacts.js index e45946873608..39062e22bba7 100644 --- a/opencti-platform/opencti-front/src/private/components/observations/Artifacts.js +++ b/opencti-platform/opencti-front/src/private/components/observations/Artifacts.js @@ -184,36 +184,47 @@ class StixCyberObservables extends Component { return { observable_value: { label: 'Value', - width: '15%', + width: '12%', isSortable: isRuntimeSort, }, file_name: { label: 'File name', - width: '20%', + width: '12%', isSortable: false, }, file_mime_type: { label: 'Mime/Type', - width: '15%', + width: '8%', isSortable: false, }, file_size: { label: 'File size', - width: '10%', + width: '8%', isSortable: false, }, + createdBy: { + label: 'Author', + width: '12%', + isSortable: isRuntimeSort, + }, + creator: { + label: 'Creators', + width: '12%', + isSortable: isRuntimeSort, + }, objectLabel: { label: 'Labels', width: '15%', isSortable: false, }, created_at: { - label: 'Creation date', - width: '15%', + label: 'Date', + width: '10%', isSortable: true, }, objectMarking: { label: 'Marking', + width: '10%', isSortable: isRuntimeSort, }, }; diff --git a/opencti-platform/opencti-front/src/private/components/observations/Indicators.tsx b/opencti-platform/opencti-front/src/private/components/observations/Indicators.tsx index 733b8c446f50..61f9f7d2f1dd 100644 --- a/opencti-platform/opencti-front/src/private/components/observations/Indicators.tsx +++ b/opencti-platform/opencti-front/src/private/components/observations/Indicators.tsx @@ -128,36 +128,42 @@ const Indicators = () => { const dataColumns = { pattern_type: { label: 'Pattern type', - width: '10%', + width: '8%', isSortable: true, }, name: { label: 'Name', - width: '25%', + width: '22%', isSortable: true, }, + createdBy: { + label: 'Author', + width: '12%', + isSortable: isRuntimeSort ?? false, + }, + creator: { + label: 'Creators', + width: '12%', + isSortable: isRuntimeSort ?? false, + }, objectLabel: { label: 'Labels', - width: '10%', + width: '15%', isSortable: false, }, created: { - label: 'Creation date', - width: '15%', - isSortable: true, - }, - creator: { - label: 'Creator', + label: 'Date', width: '10%', isSortable: true, }, valid_until: { label: 'Valid until', - width: '13%', + width: '10%', isSortable: true, }, objectMarking: { label: 'Marking', + width: '10%', isSortable: isRuntimeSort ?? false, }, }; diff --git a/opencti-platform/opencti-front/src/private/components/observations/Infrastructures.js b/opencti-platform/opencti-front/src/private/components/observations/Infrastructures.js index 1afe0178ea8c..f144655750ea 100644 --- a/opencti-platform/opencti-front/src/private/components/observations/Infrastructures.js +++ b/opencti-platform/opencti-front/src/private/components/observations/Infrastructures.js @@ -8,6 +8,7 @@ import { convertFilters, saveViewParameters, } from '../../../utils/ListParameters'; +import { UserContext } from '../../../utils/hooks/useAuth'; import inject18n from '../../../components/i18n'; import ListLines from '../../../components/list_lines/ListLines'; import InfrastructuresLines, { @@ -97,7 +98,7 @@ class Infrastructures extends Component { this.setState({ numberOfElements }); } - renderLines(paginationOptions) { + renderLines(paginationOptions, helper) { const { sortBy, orderAsc, @@ -106,26 +107,42 @@ class Infrastructures extends Component { openExports, numberOfElements, } = this.state; + const isRuntimeSort = helper?.isRuntimeFieldEnable() ?? false; const dataColumns = { name: { label: 'Name', - width: '35%', + width: '25%', + isSortable: true, + }, + infrastructure_types: { + label: 'Type', + width: '8%', isSortable: true, }, + createdBy: { + label: 'Author', + width: '12%', + isSortable: isRuntimeSort, + }, + creator: { + label: 'Creators', + width: '12%', + isSortable: isRuntimeSort, + }, objectLabel: { label: 'Labels', - width: '25%', + width: '15%', isSortable: false, }, created: { - label: 'Creation date', - width: '15%', + label: 'Date', + width: '10%', isSortable: true, }, - modified: { - label: 'Modification date', - width: '15%', - isSortable: true, + objectMarking: { + label: 'Marking', + isSortable: isRuntimeSort, + width: '8%', }, }; return ( @@ -181,12 +198,18 @@ class Infrastructures extends Component { filters: finalFilters, }; return ( -
- {view === 'lines' ? this.renderLines(paginationOptions) : ''} - - - -
+ + {({ helper }) => ( +
+ {view === 'lines' + ? this.renderLines(paginationOptions, helper) + : ''} + + + +
+ )} +
); } } diff --git a/opencti-platform/opencti-front/src/private/components/observations/StixCyberObservables.tsx b/opencti-platform/opencti-front/src/private/components/observations/StixCyberObservables.tsx index 6dd579dcdb0c..dcda84b5ed18 100644 --- a/opencti-platform/opencti-front/src/private/components/observations/StixCyberObservables.tsx +++ b/opencti-platform/opencti-front/src/private/components/observations/StixCyberObservables.tsx @@ -135,14 +135,14 @@ const StixCyberObservables: FunctionComponent = () => { isSortable: false, }, created_at: { - label: 'Creation', + label: 'Date', width: '10%', isSortable: true, }, objectMarking: { label: 'Marking', - isSortable: isRuntimeSort, width: '10%', + isSortable: isRuntimeSort, }, }; }; diff --git a/opencti-platform/opencti-front/src/private/components/observations/artifacts/ArtifactLine.js b/opencti-platform/opencti-front/src/private/components/observations/artifacts/ArtifactLine.js index 07028a386c81..3cec3ae012e4 100644 --- a/opencti-platform/opencti-front/src/private/components/observations/artifacts/ArtifactLine.js +++ b/opencti-platform/opencti-front/src/private/components/observations/artifacts/ArtifactLine.js @@ -120,6 +120,18 @@ class ArtifactLineComponent extends Component { > {b(file.size)} +
+ {node.createdBy?.name} +
+
+ {(node.creators ?? []).map((c) => c?.name).join(', ')} +
+
+ +
+
+ +
{ > {node.name}
+
+ {node.createdBy?.name} +
+
+ {(node.creators ?? []).map((c) => c?.name).join(', ')} +
{ > {nsdt(node.created)}
-
- {(node.creators ?? []).map((c) => c?.name).join(', ')} -
{
{
{
+ +
+
void; selectAll: boolean; - onLabelClick?: HandleAddFilter, + onLabelClick?: HandleAddFilter; } -const IndicatorsLines: FunctionComponent = ( - { - paginationOptions, - queryRef, - dataColumns, - onLabelClick, - setNumberOfElements, - onToggleEntity, - selectedElements, - deSelectedElements, - selectAll, - }, -) => { +const IndicatorsLines: FunctionComponent = ({ + paginationOptions, + queryRef, + dataColumns, + onLabelClick, + setNumberOfElements, + onToggleEntity, + selectedElements, + deSelectedElements, + selectAll, +}) => { const { data, hasMore, loadMore, isLoadingMore } = usePreloadedPaginationFragment< IndicatorsLinesPaginationQuery, - IndicatorsLines_data$key>( - { - linesQuery: indicatorsLinesQuery, - linesFragment: indicatorsLinesFragment, - queryRef, - nodePath: ['indicators', 'pageInfo', 'globalCount'], - setNumberOfElements, - }, - ); + IndicatorsLines_data$key + >({ + linesQuery: indicatorsLinesQuery, + linesFragment: indicatorsLinesFragment, + queryRef, + nodePath: ['indicators', 'pageInfo', 'globalCount'], + setNumberOfElements, + }); return ( ({ item: { @@ -42,11 +44,17 @@ const styles = (theme) => ({ height: '1em', backgroundColor: theme.palette.grey[700], }, + chipInList: { + fontSize: 12, + height: 20, + float: 'left', + width: 120, + }, }); class InfrastructureLineComponent extends Component { render() { - const { fd, classes, node, dataColumns, onLabelClick } = this.props; + const { fd, t, classes, node, dataColumns, onLabelClick } = this.props; return ( {node.name}
+
+ +
+
+ {node.createdBy?.name} +
+
+ {(node.creators ?? []).map((c) => c?.name).join(', ')} +
- {fd(node.modified)} +
} @@ -119,6 +154,14 @@ const InfrastructureLineFragment = createFragmentContainer( created modified confidence + infrastructure_types + createdBy { + ... on Identity { + id + name + entity_type + } + } objectMarking { edges { node { @@ -139,6 +182,10 @@ const InfrastructureLineFragment = createFragmentContainer( } } } + creators { + id + name + } } `, }, @@ -176,6 +223,39 @@ class InfrastructureLineDummyComponent extends Component { height="100%" /> +
+ +
+
+ +
+
+ +
diff --git a/opencti-platform/opencti-front/src/schema/relay.schema.graphql b/opencti-platform/opencti-front/src/schema/relay.schema.graphql index d86810ed942a..21a2bb67c117 100644 --- a/opencti-platform/opencti-front/src/schema/relay.schema.graphql +++ b/opencti-platform/opencti-front/src/schema/relay.schema.graphql @@ -2082,6 +2082,7 @@ enum AttackPatternsFilter { mitigatedBy revoked x_opencti_workflow_id + creator } input AttackPatternsFiltering { @@ -2335,6 +2336,7 @@ enum ContainersFilter { objectContains x_opencti_workflow_id revoked + creator } input ContainersFiltering { @@ -2924,6 +2926,7 @@ enum CoursesOfActionFilter { mitigatedBy x_opencti_workflow_id x_mitre_id + creator } input CoursesOfActionFiltering { @@ -3165,6 +3168,7 @@ enum IndividualsFilter { contact_information x_opencti_firstname x_opencti_lastname + creator } input IndividualsFiltering { @@ -3810,6 +3814,9 @@ enum InfrastructuresOrdering { updated_at x_opencti_workflow_id confidence + createdBy + objectMarking + creator } enum InfrastructuresFilter { @@ -3829,6 +3836,7 @@ enum InfrastructuresFilter { x_opencti_workflow_id revoked confidence + creator } input InfrastructuresFiltering { @@ -4312,6 +4320,7 @@ enum CitiesFilter { labelledBy x_opencti_workflow_id revoked + creator } input CitiesFiltering { @@ -4428,6 +4437,7 @@ enum CountriesFilter { labelledBy x_opencti_workflow_id revoked + creator } input CountriesFiltering { @@ -9688,7 +9698,6 @@ enum CasesOrdering { updated_at creator createdBy - markedBy x_opencti_workflow_id case_type confidence diff --git a/opencti-platform/opencti-graphql/config/schema/opencti.graphql b/opencti-platform/opencti-graphql/config/schema/opencti.graphql index 9bfea1387dc4..3819b94a280c 100644 --- a/opencti-platform/opencti-graphql/config/schema/opencti.graphql +++ b/opencti-platform/opencti-graphql/config/schema/opencti.graphql @@ -2128,6 +2128,7 @@ enum AttackPatternsFilter { mitigatedBy revoked x_opencti_workflow_id + creator } input AttackPatternsFiltering { key: [AttackPatternsFilter!]! @@ -2497,6 +2498,7 @@ enum ContainersFilter { objectContains x_opencti_workflow_id revoked + creator } input ContainersFiltering { key: [ContainersFilter!]! @@ -3477,6 +3479,7 @@ enum CoursesOfActionFilter { mitigatedBy x_opencti_workflow_id x_mitre_id + creator } input CoursesOfActionFiltering { key: [CoursesOfActionFilter!]! @@ -3832,6 +3835,7 @@ enum IndividualsFilter { contact_information x_opencti_firstname x_opencti_lastname + creator } input IndividualsFiltering { key: [IndividualsFilter!]! @@ -4772,6 +4776,9 @@ enum InfrastructuresOrdering { updated_at x_opencti_workflow_id confidence + createdBy + objectMarking + creator } enum InfrastructuresFilter { name @@ -4790,6 +4797,7 @@ enum InfrastructuresFilter { x_opencti_workflow_id revoked confidence + creator } input InfrastructuresFiltering { key: [InfrastructuresFilter!]! @@ -5505,6 +5513,7 @@ enum CitiesFilter { labelledBy x_opencti_workflow_id revoked + creator } input CitiesFiltering { key: [CitiesFilter!]! @@ -5680,6 +5689,7 @@ enum CountriesFilter { labelledBy x_opencti_workflow_id revoked + creator } input CountriesFiltering { key: [CountriesFilter!]! diff --git a/opencti-platform/opencti-graphql/src/generated/graphql.ts b/opencti-platform/opencti-graphql/src/generated/graphql.ts index 1a432e867a86..7160b35fe6cd 100644 --- a/opencti-platform/opencti-graphql/src/generated/graphql.ts +++ b/opencti-platform/opencti-graphql/src/generated/graphql.ts @@ -823,6 +823,7 @@ export enum AttackPatternsFilter { Created = 'created', CreatedBy = 'createdBy', CreatedAt = 'created_at', + Creator = 'creator', LabelledBy = 'labelledBy', MarkedBy = 'markedBy', MitigatedBy = 'mitigatedBy', @@ -1928,7 +1929,6 @@ export enum CasesOrdering { CreatedBy = 'createdBy', CreatedAt = 'created_at', Creator = 'creator', - MarkedBy = 'markedBy', Modified = 'modified', Name = 'name', ObjectMarking = 'objectMarking', @@ -2189,6 +2189,7 @@ export enum CitiesFilter { Created = 'created', CreatedBy = 'createdBy', CreatedAt = 'created_at', + Creator = 'creator', LabelledBy = 'labelledBy', MarkedBy = 'markedBy', Modified = 'modified', @@ -2734,6 +2735,7 @@ export enum ContainersFilter { Created = 'created', CreatedBy = 'createdBy', CreatedAt = 'created_at', + Creator = 'creator', EntityType = 'entity_type', LabelledBy = 'labelledBy', MarkedBy = 'markedBy', @@ -2781,6 +2783,7 @@ export enum CountriesFilter { Created = 'created', CreatedBy = 'createdBy', CreatedAt = 'created_at', + Creator = 'creator', LabelledBy = 'labelledBy', MarkedBy = 'markedBy', Modified = 'modified', @@ -3302,6 +3305,7 @@ export enum CoursesOfActionFilter { Created = 'created', CreatedBy = 'createdBy', CreatedAt = 'created_at', + Creator = 'creator', LabelledBy = 'labelledBy', MarkedBy = 'markedBy', MitigatedBy = 'mitigatedBy', @@ -8248,6 +8252,7 @@ export enum IndividualsFilter { Created = 'created', CreatedBy = 'createdBy', CreatedAt = 'created_at', + Creator = 'creator', Description = 'description', LabelledBy = 'labelledBy', MarkedBy = 'markedBy', @@ -8544,6 +8549,7 @@ export enum InfrastructuresFilter { Created = 'created', CreatedBy = 'createdBy', CreatedAt = 'created_at', + Creator = 'creator', FirstSeen = 'first_seen', InfrastructureTypes = 'infrastructure_types', LabelledBy = 'labelledBy', @@ -8566,12 +8572,15 @@ export type InfrastructuresFiltering = { export enum InfrastructuresOrdering { Confidence = 'confidence', Created = 'created', + CreatedBy = 'createdBy', CreatedAt = 'created_at', + Creator = 'creator', FirstSeen = 'first_seen', InfrastructureTypes = 'infrastructure_types', LastSeen = 'last_seen', Modified = 'modified', Name = 'name', + ObjectMarking = 'objectMarking', UpdatedAt = 'updated_at', XOpenctiWorkflowId = 'x_opencti_workflow_id' } diff --git a/opencti-platform/opencti-graphql/src/resolvers/attackPattern.js b/opencti-platform/opencti-graphql/src/resolvers/attackPattern.js index 0c51c036e077..ca7a2a9ebb77 100644 --- a/opencti-platform/opencti-graphql/src/resolvers/attackPattern.js +++ b/opencti-platform/opencti-graphql/src/resolvers/attackPattern.js @@ -47,6 +47,7 @@ const attackPatternResolvers = { markedBy: buildRefRelationKey(RELATION_OBJECT_MARKING), labelledBy: buildRefRelationKey(RELATION_OBJECT_LABEL), mitigatedBy: buildRefRelationKey(RELATION_MITIGATES), + creator: 'creator_id', }, Mutation: { attackPatternEdit: (_, { id }, context) => ({ diff --git a/opencti-platform/opencti-graphql/src/resolvers/city.js b/opencti-platform/opencti-graphql/src/resolvers/city.js index 729e38621c8b..a6968566eb83 100644 --- a/opencti-platform/opencti-graphql/src/resolvers/city.js +++ b/opencti-platform/opencti-graphql/src/resolvers/city.js @@ -25,6 +25,7 @@ const cityResolvers = { createdBy: buildRefRelationKey(RELATION_CREATED_BY), markedBy: buildRefRelationKey(RELATION_OBJECT_MARKING), labelledBy: buildRefRelationKey(RELATION_OBJECT_LABEL), + creator: 'creator_id', }, Mutation: { cityEdit: (_, { id }, context) => ({ diff --git a/opencti-platform/opencti-graphql/src/resolvers/container.js b/opencti-platform/opencti-graphql/src/resolvers/container.js index 8403c5646897..45a10c86f2c1 100644 --- a/opencti-platform/opencti-graphql/src/resolvers/container.js +++ b/opencti-platform/opencti-graphql/src/resolvers/container.js @@ -36,6 +36,7 @@ const containerResolvers = { markedBy: buildRefRelationKey(RELATION_OBJECT_MARKING), labelledBy: buildRefRelationKey(RELATION_OBJECT_LABEL), objectContains: buildRefRelationKey(RELATION_OBJECT, '*'), + creator: 'creator_id', }, Mutation: { containerEdit: (_, { id }, context) => ({ diff --git a/opencti-platform/opencti-graphql/src/resolvers/country.js b/opencti-platform/opencti-graphql/src/resolvers/country.js index bbcb20f88db9..f5ff60619064 100644 --- a/opencti-platform/opencti-graphql/src/resolvers/country.js +++ b/opencti-platform/opencti-graphql/src/resolvers/country.js @@ -23,6 +23,7 @@ const countryResolvers = { }, CountriesFilter: { createdBy: buildRefRelationKey(RELATION_CREATED_BY), + creator: 'creator_id', }, Mutation: { countryEdit: (_, { id }, context) => ({ diff --git a/opencti-platform/opencti-graphql/src/resolvers/courseOfAction.js b/opencti-platform/opencti-graphql/src/resolvers/courseOfAction.js index 884836a0fbca..2e7d98dcd96e 100644 --- a/opencti-platform/opencti-graphql/src/resolvers/courseOfAction.js +++ b/opencti-platform/opencti-graphql/src/resolvers/courseOfAction.js @@ -27,6 +27,7 @@ const courseOfActionResolvers = { markedBy: buildRefRelationKey(RELATION_OBJECT_MARKING), labelledBy: buildRefRelationKey(RELATION_OBJECT_LABEL), mitigatedBy: buildRefRelationKey(RELATION_MITIGATES), + creator: 'creator_id', }, Mutation: { courseOfActionEdit: (_, { id }, context) => ({ diff --git a/opencti-platform/opencti-graphql/src/resolvers/individual.js b/opencti-platform/opencti-graphql/src/resolvers/individual.js index b224d5072e19..b845d8428288 100644 --- a/opencti-platform/opencti-graphql/src/resolvers/individual.js +++ b/opencti-platform/opencti-graphql/src/resolvers/individual.js @@ -26,6 +26,7 @@ const individualResolvers = { createdBy: buildRefRelationKey(RELATION_CREATED_BY), markedBy: buildRefRelationKey(RELATION_OBJECT_MARKING), labelledBy: buildRefRelationKey(RELATION_OBJECT_LABEL), + creator: 'creator_id', }, Mutation: { individualEdit: (_, { id }, context) => ({ diff --git a/opencti-platform/opencti-graphql/src/resolvers/infrastructure.js b/opencti-platform/opencti-graphql/src/resolvers/infrastructure.js index 7652d769e662..a0f54d29dd0b 100644 --- a/opencti-platform/opencti-graphql/src/resolvers/infrastructure.js +++ b/opencti-platform/opencti-graphql/src/resolvers/infrastructure.js @@ -23,6 +23,7 @@ const infrastructureResolvers = { createdBy: buildRefRelationKey(RELATION_CREATED_BY), markedBy: buildRefRelationKey(RELATION_OBJECT_MARKING), labelledBy: buildRefRelationKey(RELATION_OBJECT_LABEL), + creator: 'creator_id', }, Infrastructure: { killChainPhases: (infrastructure, _, context) => killChainPhaseLoader.load(infrastructure.id, context, context.user), diff --git a/opencti-platform/opencti-graphql/src/resolvers/opinion.js b/opencti-platform/opencti-graphql/src/resolvers/opinion.js index dcbf9e27013a..6a66e966f6c9 100644 --- a/opencti-platform/opencti-graphql/src/resolvers/opinion.js +++ b/opencti-platform/opencti-graphql/src/resolvers/opinion.js @@ -61,7 +61,8 @@ const opinionResolvers = { createdBy: buildRefRelationKey(RELATION_CREATED_BY), markedBy: buildRefRelationKey(RELATION_OBJECT_MARKING), labelledBy: buildRefRelationKey(RELATION_OBJECT_LABEL), - objectContains: buildRefRelationKey(RELATION_OBJECT, '*') + objectContains: buildRefRelationKey(RELATION_OBJECT, '*'), + creator: 'creator_id', }, Mutation: { opinionEdit: (_, { id }, context) => ({