-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[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 <[email protected]>
- Loading branch information
1 parent
bf178de
commit 3bb51bb
Showing
2,196 changed files
with
80,834 additions
and
79,700 deletions.
There are no files selected for viewing
97 changes: 97 additions & 0 deletions
97
x-pack/plugins/siem/public/alerts/components/activity_monitor/columns.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
/* eslint-disable react/display-name */ | ||
|
||
import { | ||
EuiIconTip, | ||
EuiLink, | ||
EuiTextColor, | ||
EuiBasicTableColumn, | ||
EuiTableActionsColumnType, | ||
} from '@elastic/eui'; | ||
import React from 'react'; | ||
import { getEmptyTagValue } from '../../../common/components/empty_value'; | ||
import { ColumnTypes } from './types'; | ||
|
||
const actions: EuiTableActionsColumnType<ColumnTypes>['actions'] = [ | ||
{ | ||
available: (item: ColumnTypes) => item.status === 'Running', | ||
description: 'Stop', | ||
icon: 'stop', | ||
isPrimary: true, | ||
name: 'Stop', | ||
onClick: () => {}, | ||
type: 'icon', | ||
}, | ||
{ | ||
available: (item: ColumnTypes) => item.status === 'Stopped', | ||
description: 'Resume', | ||
icon: 'play', | ||
isPrimary: true, | ||
name: 'Resume', | ||
onClick: () => {}, | ||
type: 'icon', | ||
}, | ||
]; | ||
|
||
// Michael: Are we able to do custom, in-table-header filters, as shown in my wireframes? | ||
export const columns: Array<EuiBasicTableColumn<ColumnTypes>> = [ | ||
{ | ||
field: 'rule' as const, | ||
name: 'Rule', | ||
render: (value: ColumnTypes['rule'], _: ColumnTypes) => ( | ||
<EuiLink href={value.href}>{value.name}</EuiLink> | ||
), | ||
sortable: true, | ||
truncateText: true, | ||
}, | ||
{ | ||
field: 'ran' as const, | ||
name: 'Ran', | ||
render: (value: ColumnTypes['ran'], _: ColumnTypes) => '--', | ||
sortable: true, | ||
truncateText: true, | ||
}, | ||
{ | ||
field: 'lookedBackTo' as const, | ||
name: 'Looked back to', | ||
render: (value: ColumnTypes['lookedBackTo'], _: ColumnTypes) => '--', | ||
sortable: true, | ||
truncateText: true, | ||
}, | ||
{ | ||
field: 'status' as const, | ||
name: 'Status', | ||
sortable: true, | ||
truncateText: true, | ||
}, | ||
{ | ||
field: 'response' as const, | ||
name: 'Response', | ||
render: (value: ColumnTypes['response'], _: ColumnTypes) => { | ||
return value === undefined ? ( | ||
getEmptyTagValue() | ||
) : ( | ||
<> | ||
{value === 'Fail' ? ( | ||
<EuiTextColor color="danger"> | ||
{value} <EuiIconTip content="Full fail message here." type="iInCircle" /> | ||
</EuiTextColor> | ||
) : ( | ||
<EuiTextColor color="secondary">{value}</EuiTextColor> | ||
)} | ||
</> | ||
); | ||
}, | ||
sortable: true, | ||
truncateText: true, | ||
}, | ||
{ | ||
actions, | ||
width: '40px', | ||
}, | ||
]; |
File renamed without changes.
Oops, something went wrong.