File tree Expand file tree Collapse file tree 2 files changed +13
-11
lines changed
public/pages/CreateDetector/components/DefineDetector/components/DetectionRules Expand file tree Collapse file tree 2 files changed +13
-11
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ import React, { useState } from 'react';
8
8
import { RuleItem } from './types/interfaces' ;
9
9
import { getRulesColumns } from './utils/constants' ;
10
10
import { Search } from '@opensearch-project/oui/src/eui_components/basic_table' ;
11
- import { ruleTypes , ruleSeverity , ruleSource } from '../../../../../Rules/utils/constants' ;
11
+ import { ruleSeverity , ruleSource } from '../../../../../Rules/utils/constants' ;
12
12
13
13
export interface DetectionRulesTableProps {
14
14
ruleItems : RuleItem [ ] ;
@@ -43,15 +43,6 @@ export const DetectionRulesTable: React.FC<DetectionRulesTableProps> = ({
43
43
schema : true ,
44
44
} ,
45
45
filters : [
46
- {
47
- type : 'field_value_selection' ,
48
- field : 'logType' ,
49
- name : 'Log Type' ,
50
- multiSelect : true ,
51
- options : ruleTypes . map ( ( type : string ) => ( {
52
- value : type ,
53
- } ) ) ,
54
- } ,
55
46
{
56
47
type : 'field_value_selection' ,
57
48
field : 'severity' ,
@@ -76,7 +67,7 @@ export const DetectionRulesTable: React.FC<DetectionRulesTableProps> = ({
76
67
return ( rulePriorityBySeverity [ a . severity ] || 6 ) - ( rulePriorityBySeverity [ b . severity ] || 6 ) ;
77
68
} ) ;
78
69
79
- const onTableChangeHandler = ( pagination : CriteriaWithPagination < T > ) => {
70
+ const onTableChangeHandler = ( pagination : CriteriaWithPagination < RuleItem > ) => {
80
71
setPagination ( { pageIndex : pagination . page . index } ) ;
81
72
onTableChange && onTableChange ( pagination ) ;
82
73
} ;
Original file line number Diff line number Diff line change 4
4
*/
5
5
6
6
import { EuiBasicTableColumn , EuiLink , EuiSwitch } from '@elastic/eui' ;
7
+ import { capitalizeFirstLetter } from '../../../../../../../utils/helpers' ;
7
8
import React , { ReactNode } from 'react' ;
8
9
import { RuleItem } from '../types/interfaces' ;
9
10
@@ -35,18 +36,28 @@ export const getRulesColumns = (
35
36
</ EuiLink >
36
37
) ;
37
38
} ,
39
+ width : '30%' ,
40
+ sortable : true ,
38
41
} ,
39
42
{
40
43
field : 'severity' ,
41
44
name : 'Rule severity' ,
45
+ width : '10%' ,
46
+ sortable : true ,
47
+ render : ( severity : string ) => capitalizeFirstLetter ( severity ) ,
42
48
} ,
43
49
{
44
50
field : 'logType' ,
45
51
name : 'Log type' ,
52
+ width : '10%' ,
53
+ sortable : true ,
54
+ render : ( logType : string ) => capitalizeFirstLetter ( logType ) ,
46
55
} ,
47
56
{
48
57
field : 'library' ,
49
58
name : 'Source' ,
59
+ width : '10%' ,
60
+ render : ( library : string ) => capitalizeFirstLetter ( library ) ,
50
61
} ,
51
62
{
52
63
field : 'description' ,
You can’t perform that action at this time.
0 commit comments