Skip to content

Commit

Permalink
[back/front] Cumulate creator_id when upserting an entity (#2886)
Browse files Browse the repository at this point in the history
  • Loading branch information
richard-julien authored Mar 5, 2023
1 parent 15903c5 commit c34a9fd
Show file tree
Hide file tree
Showing 179 changed files with 2,274 additions and 1,917 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ const LastIngestedAnalysis = () => {
name
report_types
}
creator {
creators {
id
name
}
Expand Down Expand Up @@ -606,7 +606,7 @@ const LastIngestedAnalysis = () => {
{pathOr('', ['createdBy', 'name'], stixDomainObject)}
</div>
<div className={classes.itemCreator}>
{pathOr('', ['creator', 'name'], stixDomainObject)}
{(stixDomainObject.creators ?? []).map((c) => c?.name).join(', ')}
</div>
<div className={classes.itemDate}>
{fsd(stixDomainObject.created_at)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,16 +296,8 @@ const SearchBulk = () => {
markings: resolvedStixCoreObject.objectMarking,
reports: resolvedStixCoreObject.reports,
updated_at: resolvedStixCoreObject.updated_at,
author: R.pathOr(
'',
['createdBy', 'name'],
resolvedStixCoreObject,
),
creator: R.pathOr(
'',
['creator', 'name'],
resolvedStixCoreObject,
),
author: R.pathOr('', ['createdBy', 'name'], resolvedStixCoreObject),
creators: (resolvedStixCoreObject.creators ?? []).map((c) => c?.name).join(', '),
in_platform: true,
}),
);
Expand Down Expand Up @@ -462,7 +454,7 @@ const SearchBulk = () => {
{SortHeader('type', 'Type', true)}
{SortHeader('value', 'Value', true)}
{SortHeader('author', 'Author', true)}
{SortHeader('creator', 'Creator', true)}
{SortHeader('creator', 'Creators', true)}
{SortHeader('labels', 'Labels', true)}
{SortHeader('created_at', 'Creation date', true)}
{SortHeader('reports', 'Reports', true)}
Expand Down Expand Up @@ -534,7 +526,7 @@ const SearchBulk = () => {
className={classes.bodyItem}
style={inlineStyles.creator}
>
{entity.in_platform && entity.creator}
{entity.in_platform && entity.creators}
</div>
<div
className={classes.bodyItem}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ const Groupings: FunctionComponent<GroupingsProps> = ({
isSortable: isRuntimeSort ?? false,
},
creator: {
label: 'Creator',
label: 'Creators',
width: '12%',
isSortable: isRuntimeSort ?? false,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ class Notes extends Component {
isSortable: isRuntimeSort,
},
creator: {
label: 'Creator',
label: 'Creators',
width: '12%',
isSortable: isRuntimeSort,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ class Opinions extends Component {
isSortable: isRuntimeSort,
},
creator: {
label: 'Creator',
label: 'Creators',
width: '12%',
isSortable: isRuntimeSort,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ const Reports: FunctionComponent<ReportsProps> = ({
isSortable: isRuntimeSort ?? false,
},
creator: {
label: 'Creator',
label: 'Creators',
width: '12%',
isSortable: isRuntimeSort ?? false,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,6 @@ export const externalReferenceCreationMutation = graphql`
external_id
created
fileId
creator {
id
name
}
}
}
`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,17 @@ ExternalReferenceDetailsComponentProps
<Typography
variant="h3"
gutterBottom={true}
style={{ marginTop: 20 }}
>
{t('Creator')}
style={{ marginTop: 20 }}>
{t('Creators')}
</Typography>
<ItemCreator creator={externalReference.creator} />
<div>
{(externalReference.creators ?? []).map((c) => {
return <div key={`creator-${c.id}`} style={{ float: 'left', marginRight: '10px' }}>
<ItemCreator creator={c} />
</div>;
})}
<div style={{ clear: 'both' }}/>
</div>
</Grid>
<Grid item={true} xs={6}>
<Typography variant="h3" gutterBottom={true}>
Expand Down Expand Up @@ -135,7 +141,7 @@ const ExternalReferenceDetails = createFragmentContainer(
id
external_id
url
creator {
creators {
id
name
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ ExternalReferenceLineComponentProps
className={classes.bodyItem}
style={{ width: dataColumns?.creator.width }}
>
{node?.creator?.name}
{(node?.creators ?? []).map((c) => c?.name).join(', ')}
</div>
<div
className={classes.bodyItem}
Expand Down Expand Up @@ -199,7 +199,7 @@ const ExternalReferenceLineFragment = createFragmentContainer(
external_id
url
created
creator {
creators {
id
name
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export default createFragmentContainer(GroupingComponent, {
entity_type
}
}
creator {
creators {
id
name
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,6 @@ export const groupingKnowledgeAttackPatternsGraphQuery = graphql`
}
}
}
creator {
id
name
}
killChainPhases {
edges {
node {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ class GroupingLineComponent extends Component {
className={classes.bodyItem}
style={{ width: dataColumns.creator.width }}
>
{node.creator?.name}
{(node.creators ?? []).map((c) => c?.name).join(', ')}
</div>
<div
className={classes.bodyItem}
Expand Down Expand Up @@ -230,7 +230,7 @@ const GroupingLineFragment = createFragmentContainer(GroupingLineComponent, {
}
}
}
creator {
creators {
id
name
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ const Note = createFragmentContainer(NoteComponent, {
name
entity_type
}
creator {
creators {
id
name
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ class NoteLineComponent extends Component {
className={classes.bodyItem}
style={{ width: dataColumns.creator.width }}
>
{node.creator?.name}
{(node.creators ?? []).map((c) => c?.name).join(', ')}
</div>
<div
className={classes.bodyItem}
Expand Down Expand Up @@ -230,7 +230,7 @@ const NoteLineFragment = createFragmentContainer(NoteLineComponent, {
}
}
}
creator {
creators {
id
name
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ const Opinion = createFragmentContainer(OpinionComponent, {
entity_type
}
}
creator {
creators {
id
name
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class OpinionLineComponent extends Component {
className={classes.bodyItem}
style={{ width: dataColumns.creator.width }}
>
{node.creator?.name}
{(node.creators ?? []).map((c) => c?.name).join(', ')}
</div>
<div
className={classes.bodyItem}
Expand Down Expand Up @@ -202,7 +202,7 @@ const OpinionLineFragment = createFragmentContainer(OpinionLineComponent, {
}
}
}
creator {
creators {
id
name
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ const Report = createFragmentContainer(ReportComponent, {
entity_type
}
}
creator {
creators {
id
name
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,6 @@ export const reportKnowledgeAttackPatternsGraphQuery = graphql`
}
}
}
creator {
id
name
}
killChainPhases {
edges {
node {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ const ReportLineComponent: FunctionComponent<ReportLineComponentProps> = ({
className={classes.bodyItem}
style={{ width: dataColumns.creator.width }}
>
{node.creator?.name}
{(node.creators ?? []).map((c) => c?.name).join(', ')}
</div>
<div
className={classes.bodyItem}
Expand Down Expand Up @@ -243,7 +243,7 @@ export const ReportLine = createFragmentContainer(ReportLineComponent, {
}
}
}
creator {
creators {
id
name
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,6 @@ const reportsLineFragment = graphql`
}
}
}
creator {
id
name
}
...ReportLine_node
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const Vulnerabilities = () => {
isSortable: true,
},
creator: {
label: 'Creator',
label: 'Creators',
width: '12%',
isSortable: true,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ const Channel = createFragmentContainer(ChannelComponent, {
entity_type
}
}
creator {
creators {
id
name
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ const Malware = createFragmentContainer(MalwareComponent, {
entity_type
}
}
creator {
creators {
id
name
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,10 +246,6 @@ const MalwareDetails = createFragmentContainer(MalwareDetailsComponent, {
architecture_execution_envs
implementation_languages
capabilities
creator {
id
name
}
killChainPhases {
edges {
node {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ const Tool = createFragmentContainer(ToolComponent, {
entity_type
}
}
creator {
creators {
id
name
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,6 @@ const vulnerabilitiesLinesFragment = graphql`
id
name
description
creator {
id
name
}
...VulnerabilityLine_node
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ const Vulnerability = createFragmentContainer(VulnerabilityComponent, {
entity_type
}
}
creator {
creators {
id
name
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const vulnerabilityLineFragment = graphql`
}
}
}
creator {
creators {
id
name
}
Expand Down Expand Up @@ -141,7 +141,7 @@ export const VulnerabilityLine: FunctionComponent<VulnerabilityLineProps> = ({
className={classes.bodyItem}
style={{ width: dataColumns.creator.width }}
>
{data.creator?.name}
{(data.creators ?? []).map((c) => c?.name).join(', ')}
</div>
</div>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ const Feedbacks: FunctionComponent<CasesProps> = () => {
isSortable: isRuntimeSort ?? false,
},
creator: {
label: 'Creator',
label: 'Creators',
width: '12%',
isSortable: isRuntimeSort ?? false,
},
Expand Down
Loading

0 comments on commit c34a9fd

Please sign in to comment.