Skip to content

Commit

Permalink
[frontend] Clean up entity-type filter in Correlation Graphs
Browse files Browse the repository at this point in the history
The "entity_*" options shouldn't show up as an option in the Correlation
Knowledge graphs. Additionally, an Analysis Report Correlation Graph
shouldn't allow the Report or Reported-in options in the entity-type
filter, either.
  • Loading branch information
ckane committed Jun 3, 2024
1 parent e383348 commit faf3549
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -854,6 +854,9 @@ class GroupingKnowledgeCorrelationComponent extends Component {
const selectedEntities = [...this.selectedLinks, ...this.selectedNodes];
const sortByLabel = R.sortBy(R.compose(R.toLower, R.prop('tlabel')));
const stixCoreObjectsTypes = R.pipe(
R.filter((n) => n.node.entity_type
&& n.node.entity_type.length > 1
&& n.node.entity_type[0] !== n.node.entity_type[0].toLowerCase()),
R.map((n) => R.assoc(
'tlabel',
t(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -846,6 +846,9 @@ class ReportKnowledgeCorrelationComponent extends Component {
const selectedEntities = [...this.selectedLinks, ...this.selectedNodes];
const sortByLabel = R.sortBy(R.compose(R.toLower, R.prop('tlabel')));
const stixCoreObjectsTypes = R.pipe(
R.filter((n) => n.node.entity_type
&& n.node.entity_type.length > 1
&& n.node.entity_type[0] !== n.node.entity_type[0].toLowerCase()),
R.map((n) => R.assoc(
'tlabel',
t(
Expand All @@ -858,7 +861,6 @@ class ReportKnowledgeCorrelationComponent extends Component {
sortByLabel,
R.map((n) => n.node.entity_type),
R.filter((n) => n && n.length > 0),
R.concat(['Report', 'reported-in']),
R.uniq,
)(report.objects.edges);
const markedBy = R.uniqBy(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -853,6 +853,9 @@ class IncidentKnowledgeCorrelationComponent extends Component {
const selectedEntities = [...this.selectedLinks, ...this.selectedNodes];
const sortByLabel = R.sortBy(R.compose(R.toLower, R.prop('tlabel')));
const stixCoreObjectsTypes = R.pipe(
R.filter((n) => n.node.entity_type
&& n.node.entity_type.length > 1
&& n.node.entity_type[0] !== n.node.entity_type[0].toLowerCase()),
R.map((n) => R.assoc(
'tlabel',
t(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -853,6 +853,9 @@ class CaseRfiKnowledgeCorrelationComponent extends Component {
const selectedEntities = [...this.selectedLinks, ...this.selectedNodes];
const sortByLabel = R.sortBy(R.compose(R.toLower, R.prop('tlabel')));
const stixCoreObjectsTypes = R.pipe(
R.filter((n) => n.node.entity_type
&& n.node.entity_type.length > 1
&& n.node.entity_type[0] !== n.node.entity_type[0].toLowerCase()),
R.map((n) => R.assoc(
'tlabel',
t(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -854,6 +854,9 @@ class CaseRftKnowledgeCorrelationComponent extends Component {
const selectedEntities = [...this.selectedLinks, ...this.selectedNodes];
const sortByLabel = R.sortBy(R.compose(R.toLower, R.prop('tlabel')));
const stixCoreObjectsTypes = R.pipe(
R.filter((n) => n.node.entity_type
&& n.node.entity_type.length > 1
&& n.node.entity_type[0] !== n.node.entity_type[0].toLowerCase()),
R.map((n) => R.assoc(
'tlabel',
t(
Expand Down

0 comments on commit faf3549

Please sign in to comment.