■ ■ ■ ■ ■ ■ ■
opencti-platform/opencti-front/src/private/components/common/lists/Filters.js
| skipped 8 lines |
9 | 9 | | import Popover from '@mui/material/Popover'; |
10 | 10 | | import IconButton from '@mui/material/IconButton'; |
11 | 11 | | import InputAdornment from '@mui/material/InputAdornment'; |
12 | | - | import { BiotechOutlined, FilterListOutlined, PaletteOutlined } from '@mui/icons-material'; |
| 12 | + | import { |
| 13 | + | BiotechOutlined, |
| 14 | + | FilterListOutlined, |
| 15 | + | PaletteOutlined, |
| 16 | + | } from '@mui/icons-material'; |
13 | 17 | | import * as PropTypes from 'prop-types'; |
14 | 18 | | import Tooltip from '@mui/material/Tooltip'; |
15 | 19 | | import DialogTitle from '@mui/material/DialogTitle'; |
| skipped 10 lines |
26 | 30 | | import MenuItem from '@mui/material/MenuItem'; |
27 | 31 | | import { fetchQuery } from '../../../../relay/environment'; |
28 | 32 | | import inject18n from '../../../../components/i18n'; |
29 | | - | import { identitySearchCreatorsSearchQuery, identitySearchIdentitiesSearchQuery } from '../identities/IdentitySearch'; |
| 33 | + | import { |
| 34 | + | identitySearchCreatorsSearchQuery, |
| 35 | + | identitySearchIdentitiesSearchQuery, |
| 36 | + | } from '../identities/IdentitySearch'; |
30 | 37 | | import { labelsSearchQuery } from '../../settings/LabelsQuery'; |
31 | 38 | | import { attributesSearchQuery } from '../../settings/AttributesQuery'; |
32 | 39 | | import { markingDefinitionsLinesSearchQuery } from '../../settings/marking_definitions/MarkingDefinitionsLines'; |
| skipped 2 lines |
35 | 42 | | import { stixDomainObjectsLinesSearchQuery } from '../stix_domain_objects/StixDomainObjectsLines'; |
36 | 43 | | import { statusFieldStatusesSearchQuery } from '../form/StatusField'; |
37 | 44 | | import { defaultValue } from '../../../../utils/Graph'; |
| 45 | + | import { openVocabularies } from '../../../../utils/Entity'; |
38 | 46 | | |
39 | 47 | | export const filtersAllTypesQuery = graphql` |
40 | 48 | | query FiltersAllTypesQuery { |
| skipped 309 lines |
350 | 358 | | searchEntities(filterKey, event) { |
351 | 359 | | const { searchScope } = this.state; |
352 | 360 | | const baseScores = ['1', '2', '3', '4', '5', '6', '7', '8', '9']; |
353 | | - | const scores = ['0', '10', '20', '30', '40', '50', '60', '70', '80', '90', '100']; |
| 361 | + | const scores = [ |
| 362 | + | '0', |
| 363 | + | '10', |
| 364 | + | '20', |
| 365 | + | '30', |
| 366 | + | '40', |
| 367 | + | '50', |
| 368 | + | '60', |
| 369 | + | '70', |
| 370 | + | '80', |
| 371 | + | '90', |
| 372 | + | '100', |
| 373 | + | ]; |
354 | 374 | | const confidences = ['0', '15', '50', '75', '85']; |
355 | 375 | | const { t, theme, availableEntityTypes, availableRelationshipTypes } = this.props; |
356 | 376 | | if (!event) { |
| skipped 428 lines |
785 | 805 | | 'tanium-signal', |
786 | 806 | | 'spl', |
787 | 807 | | 'eql', |
| 808 | + | 'shodan', |
788 | 809 | | ]); |
789 | 810 | | this.setState({ |
790 | 811 | | entities: { |
| skipped 5 lines |
796 | 817 | | }, |
797 | 818 | | }); |
798 | 819 | | break; |
| 820 | + | case 'indicator_types': |
| 821 | + | // eslint-disable-next-line no-case-declarations |
| 822 | + | const indicatorTypesEntities = R.pipe( |
| 823 | + | R.map((n) => ({ |
| 824 | + | label: t(n.description), |
| 825 | + | value: n.key, |
| 826 | + | type: 'attribute', |
| 827 | + | })), |
| 828 | + | )(openVocabularies['indicator-type-ov']); |
| 829 | + | this.setState({ |
| 830 | + | entities: { |
| 831 | + | ...this.state.entities, |
| 832 | + | indicator_types: R.union( |
| 833 | + | indicatorTypesEntities, |
| 834 | + | this.state.entities.indicator_types, |
| 835 | + | ), |
| 836 | + | }, |
| 837 | + | }); |
| 838 | + | break; |
| 839 | + | case 'incident_type': |
| 840 | + | // eslint-disable-next-line no-case-declarations |
| 841 | + | const incidentTypeEntities = R.pipe( |
| 842 | + | R.map((n) => ({ |
| 843 | + | label: t(n.key), |
| 844 | + | value: n.key, |
| 845 | + | type: 'attribute', |
| 846 | + | })), |
| 847 | + | )(openVocabularies['incident-type-ov']); |
| 848 | + | this.setState({ |
| 849 | + | entities: { |
| 850 | + | ...this.state.entities, |
| 851 | + | incident_type: R.union( |
| 852 | + | incidentTypeEntities, |
| 853 | + | this.state.entities.incident_type, |
| 854 | + | ), |
| 855 | + | }, |
| 856 | + | }); |
| 857 | + | break; |
799 | 858 | | case 'x_opencti_base_severity': |
800 | 859 | | fetchQuery(attributesSearchQuery, { |
801 | 860 | | attributeName: 'x_opencti_base_severity', |
| skipped 555 lines |
1357 | 1416 | | |
1358 | 1417 | | handleChange(filterKey, event, value) { |
1359 | 1418 | | if (value) { |
1360 | | - | const group = !onlyGroupOrganization.includes(filterKey) ? value.group : undefined; |
| 1419 | + | const group = !onlyGroupOrganization.includes(filterKey) |
| 1420 | + | ? value.group |
| 1421 | + | : undefined; |
1361 | 1422 | | const filterAdd = `${filterKey}${group ? `_${group}` : ''}`; |
1362 | 1423 | | if (this.props.variant === 'dialog') { |
1363 | 1424 | | this.handleAddFilter(filterAdd, value.value, value.label, event); |
| skipped 116 lines |
1480 | 1541 | | ? (option) => option.type |
1481 | 1542 | | : (option) => t(option.group ? option.group : `filter_${filterKey}`) |
1482 | 1543 | | } |
1483 | | - | isOptionEqualToValue={(option, value) => option.value === value.value} |
| 1544 | + | isOptionEqualToValue={(option, value) => option.value === value.value |
| 1545 | + | } |
1484 | 1546 | | renderInput={(params) => ( |
1485 | 1547 | | <TextField |
1486 | 1548 | | {...R.dissoc('InputProps', params)} |
| skipped 405 lines |