Skip to content

Commit 7f42047

Browse files
[SIEM] [Security] unified code structure phase 0 (#65965)
* apply new structure for teh security solutions * fix few imports + store * fix types * update path in test * miss path in api_integration Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> # Conflicts: # x-pack/plugins/siem/public/components/paginated_table/index.tsx # x-pack/plugins/siem/public/containers/hosts/index.tsx # x-pack/plugins/siem/public/pages/detection_engine/components/activity_monitor/columns.tsx # x-pack/plugins/siem/public/pages/detection_engine/components/activity_monitor/index.tsx # x-pack/plugins/siem/public/pages/detection_engine/rules/all/columns.tsx # x-pack/plugins/siem/public/pages/network/ip_details/index.test.tsx
1 parent 4eb2cdf commit 7f42047

2,196 files changed

Lines changed: 80834 additions & 79694 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the Elastic License;
4+
* you may not use this file except in compliance with the Elastic License.
5+
*/
6+
7+
/* eslint-disable react/display-name */
8+
9+
import {
10+
EuiIconTip,
11+
EuiLink,
12+
EuiTextColor,
13+
EuiBasicTableColumn,
14+
EuiTableActionsColumnType,
15+
} from '@elastic/eui';
16+
import React from 'react';
17+
import { getEmptyTagValue } from '../../../common/components/empty_value';
18+
import { ColumnTypes } from './types';
19+
20+
const actions: EuiTableActionsColumnType<ColumnTypes>['actions'] = [
21+
{
22+
available: (item: ColumnTypes) => item.status === 'Running',
23+
description: 'Stop',
24+
icon: 'stop',
25+
isPrimary: true,
26+
name: 'Stop',
27+
onClick: () => {},
28+
type: 'icon',
29+
},
30+
{
31+
available: (item: ColumnTypes) => item.status === 'Stopped',
32+
description: 'Resume',
33+
icon: 'play',
34+
isPrimary: true,
35+
name: 'Resume',
36+
onClick: () => {},
37+
type: 'icon',
38+
},
39+
];
40+
41+
// Michael: Are we able to do custom, in-table-header filters, as shown in my wireframes?
42+
export const columns: Array<EuiBasicTableColumn<ColumnTypes>> = [
43+
{
44+
field: 'rule' as const,
45+
name: 'Rule',
46+
render: (value: ColumnTypes['rule'], _: ColumnTypes) => (
47+
<EuiLink href={value.href}>{value.name}</EuiLink>
48+
),
49+
sortable: true,
50+
truncateText: true,
51+
},
52+
{
53+
field: 'ran' as const,
54+
name: 'Ran',
55+
render: (value: ColumnTypes['ran'], _: ColumnTypes) => '--',
56+
sortable: true,
57+
truncateText: true,
58+
},
59+
{
60+
field: 'lookedBackTo' as const,
61+
name: 'Looked back to',
62+
render: (value: ColumnTypes['lookedBackTo'], _: ColumnTypes) => '--',
63+
sortable: true,
64+
truncateText: true,
65+
},
66+
{
67+
field: 'status' as const,
68+
name: 'Status',
69+
sortable: true,
70+
truncateText: true,
71+
},
72+
{
73+
field: 'response' as const,
74+
name: 'Response',
75+
render: (value: ColumnTypes['response'], _: ColumnTypes) => {
76+
return value === undefined ? (
77+
getEmptyTagValue()
78+
) : (
79+
<>
80+
{value === 'Fail' ? (
81+
<EuiTextColor color="danger">
82+
{value} <EuiIconTip content="Full fail message here." type="iInCircle" />
83+
</EuiTextColor>
84+
) : (
85+
<EuiTextColor color="secondary">{value}</EuiTextColor>
86+
)}
87+
</>
88+
);
89+
},
90+
sortable: true,
91+
truncateText: true,
92+
},
93+
{
94+
actions,
95+
width: '40px',
96+
},
97+
];

x-pack/plugins/siem/public/pages/detection_engine/components/activity_monitor/index.test.tsx renamed to x-pack/plugins/siem/public/alerts/components/activity_monitor/index.test.tsx

File renamed without changes.

0 commit comments

Comments
 (0)