Skip to content

Commit

Permalink
[SIEM] [Security] unified code structure phase 0 (#65965)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
XavierM and elasticmachine committed May 12, 2020
1 parent bf178de commit 3bb51bb
Show file tree
Hide file tree
Showing 2,196 changed files with 80,834 additions and 79,700 deletions.
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',
},
];
Loading

0 comments on commit 3bb51bb

Please sign in to comment.