Skip to content

Commit

Permalink
[frontend/backend] Cannot hide entity type "External references" (#6327)
Browse files Browse the repository at this point in the history
  • Loading branch information
SarahBocognano committed Mar 21, 2024
1 parent 4cd8e99 commit d06e9dd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { fieldSpacingContainerStyle } from '../../../../utils/field';
import HiddenTypesIndicator from './HiddenTypesIndicator';

export const groups = new Map<string, string[]>([
['Analysis', ['Report', 'Grouping', 'Note', 'Malware-Analysis']],
['Analysis', ['Report', 'Grouping', 'Note', 'Malware-Analysis', 'External-Reference']],
['Cases', ['Case-Incident', 'Feedback', 'Case-Rfi', 'Case-Rft', 'Task']],
['Events', ['stix-sighting-relationship', 'Incident', 'Observed-Data']],
['Observations', ['Stix-Cyber-Observable', 'Artifact', 'Indicator', 'Infrastructure']],
Expand Down
2 changes: 2 additions & 0 deletions opencti-platform/opencti-graphql/src/domain/subType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { ABSTRACT_STIX_NESTED_REF_RELATIONSHIP } from '../schema/stixRefRelation
import { ENTITY_HASHED_OBSERVABLE_ARTIFACT } from '../schema/stixCyberObservable';
import { telemetry } from '../config/tracing';
import type { AuthContext, AuthUser } from '../types/user';
import { ENTITY_TYPE_EXTERNAL_REFERENCE } from '../schema/stixMetaObject';

// -- ENTITY TYPES --

Expand All @@ -23,6 +24,7 @@ export const queryDefaultSubTypes = async (context: AuthContext, user: AuthUser,
R.append({ node: { id: ABSTRACT_STIX_CORE_RELATIONSHIP, label: ABSTRACT_STIX_CORE_RELATIONSHIP } }),
R.append({ node: { id: STIX_SIGHTING_RELATIONSHIP, label: STIX_SIGHTING_RELATIONSHIP } }),
R.append({ node: { id: ABSTRACT_STIX_CYBER_OBSERVABLE, label: ABSTRACT_STIX_CYBER_OBSERVABLE } }),
R.append({ node: { id: ENTITY_TYPE_EXTERNAL_REFERENCE, label: ENTITY_TYPE_EXTERNAL_REFERENCE } }),
R.append({ node: { id: ENTITY_HASHED_OBSERVABLE_ARTIFACT, label: ENTITY_HASHED_OBSERVABLE_ARTIFACT } }),
R.uniqBy(R.path(['node', 'id'])),
)(types);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { isNumericAttribute, schemaAttributesDefinition } from '../../schema/sch
import { isEmptyField } from '../../database/utils';
import type { MandatoryType } from '../../schema/attribute-definition';
import { schemaRelationsRefDefinition } from '../../schema/schema-relationsRef';
import { ENTITY_TYPE_EXTERNAL_REFERENCE } from '../../schema/stixMetaObject';

export type typeAvailableSetting = boolean | string;

Expand Down Expand Up @@ -68,6 +69,7 @@ export const availableSettings: Record<string, Array<string>> = {
[ABSTRACT_STIX_CORE_RELATIONSHIP]: ['attributes_configuration', 'enforce_reference', 'workflow_configuration'],
[STIX_SIGHTING_RELATIONSHIP]: ['attributes_configuration', 'enforce_reference', 'platform_hidden_type', 'workflow_configuration'],
[ABSTRACT_STIX_CYBER_OBSERVABLE]: ['platform_hidden_type'],
[ENTITY_TYPE_EXTERNAL_REFERENCE]: ['platform_hidden_type'],
// enforce_reference not available on specific entities
[ENTITY_TYPE_CONTAINER_NOTE]: ['attributes_configuration', 'platform_entity_files_ref', 'platform_hidden_type', 'workflow_configuration'],
[ENTITY_TYPE_CONTAINER_OPINION]: ['attributes_configuration', 'platform_entity_files_ref', 'platform_hidden_type', 'workflow_configuration'],
Expand Down

0 comments on commit d06e9dd

Please sign in to comment.