Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { truncate } from '../utils/String';
import { useFormatter } from './i18n';
import { FilterDefinition } from '../utils/hooks/useAuth';
import useAttributes from '../utils/hooks/useAttributes';
import useHelper from '../utils/hooks/useHelper';

export const filterValuesContentQuery = graphql`
query FilterValuesContentQuery($filters: FilterGroup!, $isMeValueForbidden: Boolean) {
Expand Down Expand Up @@ -37,9 +36,6 @@ const FilterValuesContent: FunctionComponent<
const { stixCoreObjectTypes } = useAttributes();
const completedStixCoreObjectTypes = stixCoreObjectTypes.concat(['Stix-Core-Object', 'Stix-Cyber-Observable']);

const { isFeatureEnable } = useHelper();
const isFintelForEntityFeatureEnabled = isFeatureEnable('FINTEL_FOR_ENTITY');

const filterType = filterDefinition?.type;
let displayedValue = isFilterTooltip
? filterValue(filterKey, value, filterType, filterOperator)
Expand All @@ -59,11 +55,7 @@ const FilterValuesContent: FunctionComponent<
</span>
<Tooltip
style={{ marginLeft: 3, marginTop: -5, paddingTop: 7 }}
title={
isFintelForEntityFeatureEnabled
? t_i18n('Current entity refers to the entity in which you will use the Fintel template. Removing this filter means you will lose the context of the entity in which the template is used.')
: t_i18n('Current entity refers to the entity in which you will use the Fintel template. Removing this filter means you will lose the context of the container in which the template is used.')
}
title={t_i18n('Current entity refers to the entity in which you will use the Fintel template. Removing this filter means you will lose the context of the entity in which the template is used.')}
>
<InformationOutline color="primary" />
</Tooltip>
Expand Down
17 changes: 1 addition & 16 deletions opencti-platform/opencti-front/src/utils/hooks/useAttributes.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import useVocabularyCategory from './useVocabularyCategory';
import useAuth from './useAuth';
import useHelper from './useHelper';

const ignoredAttributes = [
'id',
Expand Down Expand Up @@ -191,15 +190,6 @@ export const containerTypes = [
'Observed-Data',
];

// Old containers types to be removed when FINTEL_FOR_ENTITY will be deleted for all
export const typesWithFintelTemplatesContainer = [
'Report',
'Grouping',
'Case-Incident',
'Case-Rfi',
'Case-Rft',
];

export const typesWithFintelTemplates = [
// Containers
'Report',
Expand Down Expand Up @@ -258,11 +248,6 @@ const useAttributes = () => {

const { metrics_definition } = settings;

const { isFeatureEnable } = useHelper();
const typesWithFintelTemplatesEnabled = isFeatureEnable('FINTEL_FOR_ENTITY')
? typesWithFintelTemplates
: typesWithFintelTemplatesContainer;

const { sdos, scos } = schema;
const stixDomainObjectTypes = sdos.map((sdo) => sdo.id);
const stixCyberObservableTypes = scos.map((sco) => sco.id);
Expand All @@ -286,7 +271,7 @@ const useAttributes = () => {
typesContainers,
vocabularyAttributes: vocabularies.fields,
containerTypes,
typesWithFintelTemplates: typesWithFintelTemplatesEnabled,
typesWithFintelTemplates,
aliasedTypes,
metricsDefinition: metrics_definition,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { createEntity, deleteElementById, updateAttribute } from '../../database
import { type BasicStoreEntityFintelTemplate, ENTITY_TYPE_FINTEL_TEMPLATE, type StoreEntityFintelTemplate } from './fintelTemplate-types';
import { publishUserAction } from '../../listener/UserActionListener';
import { notify } from '../../database/redis';
import { BUS_TOPICS, isFeatureEnabled } from '../../config/conf';
import { BUS_TOPICS } from '../../config/conf';
import { ForbiddenAccess, FunctionalError } from '../../config/errors';
import { storeLoadById } from '../../database/middleware-loader';
import { generateFintelTemplateExecutiveSummary } from '../../utils/fintelTemplate/__executiveSummary.template';
Expand Down Expand Up @@ -94,8 +94,7 @@ export const addFintelTemplate = async (
checkFintelTemplateWidgetsValidity(input.fintel_template_widgets ?? []);
// get settings type
const { settings_types: [settings_type] } = input;
const isFintelForEntityFeatureEnabled = isFeatureEnabled('FINTEL_FOR_ENTITY');
const isContainer = isFintelForEntityFeatureEnabled ? isStixDomainObjectContainer(settings_type) : true;
const isContainer = isStixDomainObjectContainer(settings_type);
// add id to fintel template widgets
const widgetsWithIds = (input.fintel_template_widgets ?? []).map((templateWidget) => ({
...templateWidget,
Expand Down
Loading