added defaultColumns property to default security solutions timeline (#109086)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
a2b8b22929
commit
ff58841d89
8 changed files with 102 additions and 89 deletions
|
@ -245,6 +245,7 @@ export const mockGlobalState: State = {
|
|||
id: 'test',
|
||||
savedObjectId: null,
|
||||
columns: defaultHeaders,
|
||||
defaultColumns: defaultHeaders,
|
||||
indexNames: DEFAULT_INDEX_PATTERN,
|
||||
itemsPerPage: 5,
|
||||
dataProviders: [],
|
||||
|
|
|
@ -1930,46 +1930,48 @@ export const mockTimelineResults: OpenTimelineResult[] = [
|
|||
},
|
||||
];
|
||||
|
||||
const mockTimelineModelColumns: TimelineModel['columns'] = [
|
||||
{
|
||||
columnHeaderType: 'not-filtered',
|
||||
id: '@timestamp',
|
||||
initialWidth: 190,
|
||||
},
|
||||
{
|
||||
columnHeaderType: 'not-filtered',
|
||||
id: 'message',
|
||||
initialWidth: 180,
|
||||
},
|
||||
{
|
||||
columnHeaderType: 'not-filtered',
|
||||
id: 'event.category',
|
||||
initialWidth: 180,
|
||||
},
|
||||
{
|
||||
columnHeaderType: 'not-filtered',
|
||||
id: 'host.name',
|
||||
initialWidth: 180,
|
||||
},
|
||||
{
|
||||
columnHeaderType: 'not-filtered',
|
||||
id: 'source.ip',
|
||||
initialWidth: 180,
|
||||
},
|
||||
{
|
||||
columnHeaderType: 'not-filtered',
|
||||
id: 'destination.ip',
|
||||
initialWidth: 180,
|
||||
},
|
||||
{
|
||||
columnHeaderType: 'not-filtered',
|
||||
id: 'user.name',
|
||||
initialWidth: 180,
|
||||
},
|
||||
];
|
||||
export const mockTimelineModel: TimelineModel = {
|
||||
activeTab: TimelineTabs.query,
|
||||
prevActiveTab: TimelineTabs.notes,
|
||||
columns: [
|
||||
{
|
||||
columnHeaderType: 'not-filtered',
|
||||
id: '@timestamp',
|
||||
initialWidth: 190,
|
||||
},
|
||||
{
|
||||
columnHeaderType: 'not-filtered',
|
||||
id: 'message',
|
||||
initialWidth: 180,
|
||||
},
|
||||
{
|
||||
columnHeaderType: 'not-filtered',
|
||||
id: 'event.category',
|
||||
initialWidth: 180,
|
||||
},
|
||||
{
|
||||
columnHeaderType: 'not-filtered',
|
||||
id: 'host.name',
|
||||
initialWidth: 180,
|
||||
},
|
||||
{
|
||||
columnHeaderType: 'not-filtered',
|
||||
id: 'source.ip',
|
||||
initialWidth: 180,
|
||||
},
|
||||
{
|
||||
columnHeaderType: 'not-filtered',
|
||||
id: 'destination.ip',
|
||||
initialWidth: 180,
|
||||
},
|
||||
{
|
||||
columnHeaderType: 'not-filtered',
|
||||
id: 'user.name',
|
||||
initialWidth: 180,
|
||||
},
|
||||
],
|
||||
columns: mockTimelineModelColumns,
|
||||
defaultColumns: mockTimelineModelColumns,
|
||||
dataProviders: [],
|
||||
dateRange: {
|
||||
end: '2020-03-18T13:52:38.929Z',
|
||||
|
@ -2076,21 +2078,23 @@ export const mockTimelineResult = {
|
|||
stale: false,
|
||||
};
|
||||
|
||||
const defaultTimelineColumns: CreateTimelineProps['timeline']['columns'] = [
|
||||
{ columnHeaderType: 'not-filtered', id: '@timestamp', type: 'number', initialWidth: 190 },
|
||||
{ columnHeaderType: 'not-filtered', id: 'message', initialWidth: 180 },
|
||||
{ columnHeaderType: 'not-filtered', id: 'event.category', initialWidth: 180 },
|
||||
{ columnHeaderType: 'not-filtered', id: 'event.action', initialWidth: 180 },
|
||||
{ columnHeaderType: 'not-filtered', id: 'host.name', initialWidth: 180 },
|
||||
{ columnHeaderType: 'not-filtered', id: 'source.ip', initialWidth: 180 },
|
||||
{ columnHeaderType: 'not-filtered', id: 'destination.ip', initialWidth: 180 },
|
||||
{ columnHeaderType: 'not-filtered', id: 'user.name', initialWidth: 180 },
|
||||
];
|
||||
export const defaultTimelineProps: CreateTimelineProps = {
|
||||
from: '2018-11-05T18:58:25.937Z',
|
||||
timeline: {
|
||||
activeTab: TimelineTabs.query,
|
||||
prevActiveTab: TimelineTabs.query,
|
||||
columns: [
|
||||
{ columnHeaderType: 'not-filtered', id: '@timestamp', type: 'number', initialWidth: 190 },
|
||||
{ columnHeaderType: 'not-filtered', id: 'message', initialWidth: 180 },
|
||||
{ columnHeaderType: 'not-filtered', id: 'event.category', initialWidth: 180 },
|
||||
{ columnHeaderType: 'not-filtered', id: 'event.action', initialWidth: 180 },
|
||||
{ columnHeaderType: 'not-filtered', id: 'host.name', initialWidth: 180 },
|
||||
{ columnHeaderType: 'not-filtered', id: 'source.ip', initialWidth: 180 },
|
||||
{ columnHeaderType: 'not-filtered', id: 'destination.ip', initialWidth: 180 },
|
||||
{ columnHeaderType: 'not-filtered', id: 'user.name', initialWidth: 180 },
|
||||
],
|
||||
columns: defaultTimelineColumns,
|
||||
defaultColumns: defaultTimelineColumns,
|
||||
dataProviders: [
|
||||
{
|
||||
and: [],
|
||||
|
|
|
@ -19,6 +19,7 @@ export const timelineDefaults: SubsetTimelineModel &
|
|||
activeTab: TimelineTabs.query,
|
||||
prevActiveTab: TimelineTabs.query,
|
||||
columns: defaultHeaders,
|
||||
defaultColumns: defaultHeaders,
|
||||
dataProviders: [],
|
||||
dateRange: { start, end },
|
||||
deletedEventIds: [],
|
||||
|
|
|
@ -14,51 +14,53 @@ import { TimelineModel } from './model';
|
|||
describe('Epic Timeline', () => {
|
||||
describe('#convertTimelineAsInput ', () => {
|
||||
test('should return a TimelineInput instead of TimelineModel ', () => {
|
||||
const columns: TimelineModel['columns'] = [
|
||||
{
|
||||
columnHeaderType: 'not-filtered',
|
||||
id: '@timestamp',
|
||||
initialWidth: 190,
|
||||
},
|
||||
{
|
||||
columnHeaderType: 'not-filtered',
|
||||
id: 'message',
|
||||
initialWidth: 180,
|
||||
},
|
||||
{
|
||||
columnHeaderType: 'not-filtered',
|
||||
id: 'event.category',
|
||||
initialWidth: 180,
|
||||
},
|
||||
{
|
||||
columnHeaderType: 'not-filtered',
|
||||
id: 'event.action',
|
||||
initialWidth: 180,
|
||||
},
|
||||
{
|
||||
columnHeaderType: 'not-filtered',
|
||||
id: 'host.name',
|
||||
initialWidth: 180,
|
||||
},
|
||||
{
|
||||
columnHeaderType: 'not-filtered',
|
||||
id: 'source.ip',
|
||||
initialWidth: 180,
|
||||
},
|
||||
{
|
||||
columnHeaderType: 'not-filtered',
|
||||
id: 'destination.ip',
|
||||
initialWidth: 180,
|
||||
},
|
||||
{
|
||||
columnHeaderType: 'not-filtered',
|
||||
id: 'user.name',
|
||||
initialWidth: 180,
|
||||
},
|
||||
];
|
||||
const timelineModel: TimelineModel = {
|
||||
activeTab: TimelineTabs.query,
|
||||
prevActiveTab: TimelineTabs.notes,
|
||||
columns: [
|
||||
{
|
||||
columnHeaderType: 'not-filtered',
|
||||
id: '@timestamp',
|
||||
initialWidth: 190,
|
||||
},
|
||||
{
|
||||
columnHeaderType: 'not-filtered',
|
||||
id: 'message',
|
||||
initialWidth: 180,
|
||||
},
|
||||
{
|
||||
columnHeaderType: 'not-filtered',
|
||||
id: 'event.category',
|
||||
initialWidth: 180,
|
||||
},
|
||||
{
|
||||
columnHeaderType: 'not-filtered',
|
||||
id: 'event.action',
|
||||
initialWidth: 180,
|
||||
},
|
||||
{
|
||||
columnHeaderType: 'not-filtered',
|
||||
id: 'host.name',
|
||||
initialWidth: 180,
|
||||
},
|
||||
{
|
||||
columnHeaderType: 'not-filtered',
|
||||
id: 'source.ip',
|
||||
initialWidth: 180,
|
||||
},
|
||||
{
|
||||
columnHeaderType: 'not-filtered',
|
||||
id: 'destination.ip',
|
||||
initialWidth: 180,
|
||||
},
|
||||
{
|
||||
columnHeaderType: 'not-filtered',
|
||||
id: 'user.name',
|
||||
initialWidth: 180,
|
||||
},
|
||||
],
|
||||
columns,
|
||||
defaultColumns: columns,
|
||||
dataProviders: [
|
||||
{
|
||||
id: 'hosts-table-hostName-DESKTOP-QBBSCUT',
|
||||
|
|
|
@ -80,6 +80,7 @@ export type SubsetTimelineModel = Readonly<
|
|||
| 'activeTab'
|
||||
| 'prevActiveTab'
|
||||
| 'columns'
|
||||
| 'defaultColumns'
|
||||
| 'dataProviders'
|
||||
| 'deletedEventIds'
|
||||
| 'description'
|
||||
|
|
|
@ -80,6 +80,7 @@ const basicTimeline: TimelineModel = {
|
|||
activeTab: TimelineTabs.query,
|
||||
prevActiveTab: TimelineTabs.graph,
|
||||
columns: [],
|
||||
defaultColumns: [],
|
||||
dataProviders: [{ ...basicDataProvider }],
|
||||
dateRange: {
|
||||
start: '2020-07-07T08:20:18.966Z',
|
||||
|
|
|
@ -62,6 +62,7 @@ export const defaultHeaders: ColumnHeaderOptions[] = [
|
|||
|
||||
export const tGridDefaults: SubsetTGridModel = {
|
||||
columns: defaultHeaders,
|
||||
defaultColumns: defaultHeaders,
|
||||
dateRange: { start: '', end: '' },
|
||||
deletedEventIds: [],
|
||||
excludedRowRendererIds: [],
|
||||
|
|
|
@ -87,6 +87,7 @@ export interface TGridModel extends TGridModelSettings {
|
|||
export type TGridModelForTimeline = Pick<
|
||||
TGridModel,
|
||||
| 'columns'
|
||||
| 'defaultColumns'
|
||||
| 'dataProviders'
|
||||
| 'dateRange'
|
||||
| 'deletedEventIds'
|
||||
|
@ -114,6 +115,7 @@ export type SubsetTGridModel = Readonly<
|
|||
Pick<
|
||||
TGridModel,
|
||||
| 'columns'
|
||||
| 'defaultColumns'
|
||||
| 'dateRange'
|
||||
| 'deletedEventIds'
|
||||
| 'excludedRowRendererIds'
|
||||
|
|
Loading…
Reference in a new issue