From 39aa43992973a713241110d6c431d208ffe0beed Mon Sep 17 00:00:00 2001 From: Steph Milovic Date: Thu, 24 Oct 2019 17:27:00 -0500 Subject: [PATCH] [SIEM] Table columns, number related design tweaks (#48969) --- .../field_renderers.test.tsx.snap | 3 +- .../field_renderers/field_renderers.test.tsx | 6 +-- .../field_renderers/field_renderers.tsx | 14 ++---- .../components/formatted_date/index.test.tsx | 45 ++++++++++++++++++- .../components/formatted_date/index.tsx | 34 ++++++++++++++ .../components/last_event_time/index.test.tsx | 3 +- .../components/last_event_time/index.tsx | 21 ++++----- .../get_anomalies_host_table_columns.tsx | 10 +---- .../get_anomalies_network_table_columns.tsx | 11 ++--- .../timelines_table/common_columns.tsx | 4 +- .../hosts/authentications_table/index.tsx | 15 +++---- .../page/hosts/first_last_seen_host/index.tsx | 9 ++-- .../page/hosts/hosts_table/columns.tsx | 10 +---- .../hosts/uncommon_process_table/index.tsx | 4 ++ .../page/network/ip_overview/index.tsx | 10 ++++- .../network/network_dns_table/columns.tsx | 4 ++ .../page/network/users_table/columns.tsx | 1 + .../containers/events/last_event_time/mock.ts | 8 ++-- 18 files changed, 135 insertions(+), 77 deletions(-) diff --git a/x-pack/legacy/plugins/siem/public/components/field_renderers/__snapshots__/field_renderers.test.tsx.snap b/x-pack/legacy/plugins/siem/public/components/field_renderers/__snapshots__/field_renderers.test.tsx.snap index 928f62cffd720..6ae9268966480 100644 --- a/x-pack/legacy/plugins/siem/public/components/field_renderers/__snapshots__/field_renderers.test.tsx.snap +++ b/x-pack/legacy/plugins/siem/public/components/field_renderers/__snapshots__/field_renderers.test.tsx.snap @@ -35,8 +35,7 @@ exports[`Field Renderers #autonomousSystemRenderer it renders correctly against exports[`Field Renderers #dateRenderer it renders correctly against snapshot 1`] = ` - diff --git a/x-pack/legacy/plugins/siem/public/components/field_renderers/field_renderers.test.tsx b/x-pack/legacy/plugins/siem/public/components/field_renderers/field_renderers.test.tsx index 6306dc0d288cf..0fd63bc3f2bf2 100644 --- a/x-pack/legacy/plugins/siem/public/components/field_renderers/field_renderers.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/field_renderers/field_renderers.test.tsx @@ -60,16 +60,14 @@ describe('Field Renderers', () => { describe('#dateRenderer', () => { test('it renders correctly against snapshot', () => { const wrapper = shallow( - {dateRenderer('firstSeen', mockData.complete.source!)} + {dateRenderer(mockData.complete.source!.firstSeen)} ); expect(toJson(wrapper)).toMatchSnapshot(); }); test('it renders emptyTagValue when invalid field provided', () => { - const wrapper = mount( - {dateRenderer('geo.spark_plug', mockData.complete.source!)} - ); + const wrapper = mount({dateRenderer(null)}); expect(wrapper.text()).toEqual(getEmptyValue()); }); }); diff --git a/x-pack/legacy/plugins/siem/public/components/field_renderers/field_renderers.tsx b/x-pack/legacy/plugins/siem/public/components/field_renderers/field_renderers.tsx index 1045f9c52e5e1..ffad36c7f9396 100644 --- a/x-pack/legacy/plugins/siem/public/components/field_renderers/field_renderers.tsx +++ b/x-pack/legacy/plugins/siem/public/components/field_renderers/field_renderers.tsx @@ -11,17 +11,11 @@ import React, { Fragment, useState } from 'react'; import { pure } from 'recompose'; import styled from 'styled-components'; -import { - AutonomousSystem, - FlowTarget, - HostEcsFields, - IpOverviewData, - Overview, -} from '../../graphql/types'; +import { AutonomousSystem, FlowTarget, HostEcsFields, IpOverviewData } from '../../graphql/types'; import { escapeDataProviderId } from '../drag_and_drop/helpers'; import { DefaultDraggable } from '../draggables'; import { getEmptyTagValue } from '../empty_value'; -import { FormattedDate } from '../formatted_date'; +import { FormattedRelativePreferenceDate } from '../formatted_date'; import { HostDetailsLink, ReputationLink, VirusTotalLink, WhoIsLink } from '../links'; import { Spacer } from '../page'; import * as i18n from '../page/network/ip_overview/translations'; @@ -58,8 +52,8 @@ export const locationRenderer = (fieldNames: string[], data: IpOverviewData): Re getEmptyTagValue() ); -export const dateRenderer = (fieldName: string, data: Overview): React.ReactElement => ( - +export const dateRenderer = (timestamp?: string | null): React.ReactElement => ( + ); export const autonomousSystemRenderer = ( diff --git a/x-pack/legacy/plugins/siem/public/components/formatted_date/index.test.tsx b/x-pack/legacy/plugins/siem/public/components/formatted_date/index.test.tsx index a66ec399a838d..bb0b947f149f4 100644 --- a/x-pack/legacy/plugins/siem/public/components/formatted_date/index.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/formatted_date/index.test.tsx @@ -13,8 +13,8 @@ import { useKibanaUiSetting } from '../../lib/settings/use_kibana_ui_setting'; import { mockFrameworks, TestProviders, MockFrameworks, getMockKibanaUiSetting } from '../../mock'; -import { PreferenceFormattedDate, FormattedDate } from '.'; -import { getEmptyValue } from '../empty_value'; +import { PreferenceFormattedDate, FormattedDate, FormattedRelativePreferenceDate } from '.'; +import { getEmptyString, getEmptyValue } from '../empty_value'; const mockUseKibanaUiSetting: jest.Mock = useKibanaUiSetting as jest.Mock; jest.mock('../../lib/settings/use_kibana_ui_setting', () => ({ @@ -162,4 +162,45 @@ describe('formatted_date', () => { }); }); }); + + describe('FormattedRelativePreferenceDate', () => { + describe('rendering', () => { + test('renders time over an hour correctly against snapshot', () => { + const isoDateString = '2019-02-25T22:27:05.000Z'; + const wrapper = shallow(); + expect(wrapper.find('[data-test-subj="preference-time"]').exists()).toBe(true); + }); + test('renders time under an hour correctly against snapshot', () => { + const timeTwelveMinutesAgo = new Date(new Date().getTime() - 12 * 60 * 1000).toISOString(); + const wrapper = shallow(); + expect(wrapper.find('[data-test-subj="relative-time"]').exists()).toBe(true); + }); + test('renders empty string value correctly', () => { + const wrapper = mount( + + + + ); + expect(wrapper.text()).toBe(getEmptyString()); + }); + + test('renders undefined value correctly', () => { + const wrapper = mount( + + + + ); + expect(wrapper.text()).toBe(getEmptyValue()); + }); + + test('renders null value correctly', () => { + const wrapper = mount( + + + + ); + expect(wrapper.text()).toBe(getEmptyValue()); + }); + }); + }); }); diff --git a/x-pack/legacy/plugins/siem/public/components/formatted_date/index.tsx b/x-pack/legacy/plugins/siem/public/components/formatted_date/index.tsx index 22a3893cf0f98..32c064096fcf9 100644 --- a/x-pack/legacy/plugins/siem/public/components/formatted_date/index.tsx +++ b/x-pack/legacy/plugins/siem/public/components/formatted_date/index.tsx @@ -6,6 +6,7 @@ import moment from 'moment-timezone'; import * as React from 'react'; +import { FormattedRelative } from '@kbn/i18n/react'; import { pure } from 'recompose'; import { @@ -62,3 +63,36 @@ export const FormattedDate = pure<{ ); FormattedDate.displayName = 'FormattedDate'; + +/** + * Renders the specified date value according to under/over one hour + * Under an hour = relative format + * Over an hour = in a format determined by the user's preferences, + * with a tooltip that renders: + * - the name of the field + * - a humanized relative date (e.g. 16 minutes ago) + * - a long representation of the date that includes the day of the week (e.g. Thursday, March 21, 2019 6:47pm) + * - the raw date value (e.g. 2019-03-22T00:47:46Z) + */ + +export const FormattedRelativePreferenceDate = ({ value }: { value?: string | number | null }) => { + if (value == null) { + return getOrEmptyTagFromValue(value); + } + const maybeDate = getMaybeDate(value); + if (!maybeDate.isValid()) { + return getOrEmptyTagFromValue(value); + } + const date = maybeDate.toDate(); + return ( + + {moment(date) + .add(1, 'hours') + .isBefore(new Date()) ? ( + + ) : ( + + )} + + ); +}; diff --git a/x-pack/legacy/plugins/siem/public/components/last_event_time/index.test.tsx b/x-pack/legacy/plugins/siem/public/components/last_event_time/index.test.tsx index bcf5e3c1de408..c23a757647a42 100644 --- a/x-pack/legacy/plugins/siem/public/components/last_event_time/index.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/last_event_time/index.test.tsx @@ -53,8 +53,7 @@ describe('Last Event Time Stat', () => { ); - - expect(wrapper.html()).toBe('Last event: 12 days ago'); + expect(wrapper.html()).toBe('Last event: 12 minutes ago'); }); test('Bad date time string', async () => { mockUseLastEventTimeQuery.mockImplementation(() => ({ diff --git a/x-pack/legacy/plugins/siem/public/components/last_event_time/index.tsx b/x-pack/legacy/plugins/siem/public/components/last_event_time/index.tsx index cb9895bebcf09..2493a1378e944 100644 --- a/x-pack/legacy/plugins/siem/public/components/last_event_time/index.tsx +++ b/x-pack/legacy/plugins/siem/public/components/last_event_time/index.tsx @@ -5,18 +5,20 @@ */ import { EuiIcon, EuiLoadingSpinner, EuiToolTip } from '@elastic/eui'; -import { FormattedMessage, FormattedRelative } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n/react'; import React, { memo } from 'react'; import { LastEventIndexKey } from '../../graphql/types'; import { useLastEventTimeQuery } from '../../containers/events/last_event_time'; import { getEmptyTagValue } from '../empty_value'; +import { FormattedRelativePreferenceDate } from '../formatted_date'; export interface LastEventTimeProps { hostName?: string; indexKey: LastEventIndexKey; ip?: string; } + export const LastEventTime = memo(({ hostName, indexKey, ip }) => { const { loading, lastSeen, errorMessage } = useLastEventTimeQuery( indexKey, @@ -37,6 +39,7 @@ export const LastEventTime = memo(({ hostName, indexKey, ip ); } + return ( <> {loading && } @@ -44,15 +47,13 @@ export const LastEventTime = memo(({ hostName, indexKey, ip ? lastSeen : !loading && lastSeen != null && ( - - , - }} - /> - + , + }} + /> )} {!loading && lastSeen == null && getEmptyTagValue()} diff --git a/x-pack/legacy/plugins/siem/public/components/ml/tables/get_anomalies_host_table_columns.tsx b/x-pack/legacy/plugins/siem/public/components/ml/tables/get_anomalies_host_table_columns.tsx index 6650449dd8200..daac4835adb28 100644 --- a/x-pack/legacy/plugins/siem/public/components/ml/tables/get_anomalies_host_table_columns.tsx +++ b/x-pack/legacy/plugins/siem/public/components/ml/tables/get_anomalies_host_table_columns.tsx @@ -6,7 +6,6 @@ import React from 'react'; import { EuiFlexGroup, EuiFlexItem, EuiLink } from '@elastic/eui'; -import moment from 'moment'; import { Columns } from '../../paginated_table'; import { AnomaliesByHost, Anomaly, NarrowDateRange } from '../types'; import { getRowItemDraggable } from '../../tables/helpers'; @@ -18,10 +17,9 @@ import * as i18n from './translations'; import { getEntries } from '../get_entries'; import { DraggableScore } from '../score/draggable_score'; import { createExplorerLink } from '../links/create_explorer_link'; -import { LocalizedDateTooltip } from '../../localized_date_tooltip'; -import { PreferenceFormattedDate } from '../../formatted_date'; import { HostsType } from '../../../store/hosts/model'; import { escapeDataProviderId } from '../../drag_and_drop/helpers'; +import { FormattedRelativePreferenceDate } from '../../formatted_date'; export const getAnomaliesHostTableColumns = ( startDate: number, @@ -126,11 +124,7 @@ export const getAnomaliesHostTableColumns = ( name: i18n.TIME_STAMP, field: 'anomaly.time', sortable: true, - render: time => ( - - - - ), + render: time => , }, ]; diff --git a/x-pack/legacy/plugins/siem/public/components/ml/tables/get_anomalies_network_table_columns.tsx b/x-pack/legacy/plugins/siem/public/components/ml/tables/get_anomalies_network_table_columns.tsx index 1e1628fb077dd..2113d3b82f52e 100644 --- a/x-pack/legacy/plugins/siem/public/components/ml/tables/get_anomalies_network_table_columns.tsx +++ b/x-pack/legacy/plugins/siem/public/components/ml/tables/get_anomalies_network_table_columns.tsx @@ -6,7 +6,7 @@ import React from 'react'; import { EuiFlexGroup, EuiFlexItem, EuiLink } from '@elastic/eui'; -import moment from 'moment'; + import { Columns } from '../../paginated_table'; import { Anomaly, NarrowDateRange, AnomaliesByNetwork } from '../types'; import { getRowItemDraggable } from '../../tables/helpers'; @@ -18,8 +18,7 @@ import * as i18n from './translations'; import { getEntries } from '../get_entries'; import { DraggableScore } from '../score/draggable_score'; import { createExplorerLink } from '../links/create_explorer_link'; -import { LocalizedDateTooltip } from '../../localized_date_tooltip'; -import { PreferenceFormattedDate } from '../../formatted_date'; +import { FormattedRelativePreferenceDate } from '../../formatted_date'; import { NetworkType } from '../../../store/network/model'; import { escapeDataProviderId } from '../../drag_and_drop/helpers'; @@ -120,11 +119,7 @@ export const getAnomaliesNetworkTableColumns = ( name: i18n.TIME_STAMP, field: 'anomaly.time', sortable: true, - render: time => ( - - - - ), + render: time => , }, ]; diff --git a/x-pack/legacy/plugins/siem/public/components/open_timeline/timelines_table/common_columns.tsx b/x-pack/legacy/plugins/siem/public/components/open_timeline/timelines_table/common_columns.tsx index 9818a33385286..8eeb29794f5a6 100644 --- a/x-pack/legacy/plugins/siem/public/components/open_timeline/timelines_table/common_columns.tsx +++ b/x-pack/legacy/plugins/siem/public/components/open_timeline/timelines_table/common_columns.tsx @@ -14,7 +14,7 @@ import { NotePreviews } from '../note_previews'; import * as i18n from '../translations'; import { OnOpenTimeline, OnToggleShowNotes, OpenTimelineResult } from '../types'; import { getEmptyTagValue } from '../../empty_value'; -import { FormattedDate } from '../../formatted_date'; +import { FormattedRelativePreferenceDate } from '../../formatted_date'; /** * Returns the column definitions (passed as the `columns` prop to @@ -96,7 +96,7 @@ export const getCommonColumns = ({ render: (date: number, timelineResult: OpenTimelineResult) => (
{timelineResult.updated != null ? ( - + ) : ( getEmptyTagValue() )} diff --git a/x-pack/legacy/plugins/siem/public/components/page/hosts/authentications_table/index.tsx b/x-pack/legacy/plugins/siem/public/components/page/hosts/authentications_table/index.tsx index fe280c2899327..b9b132b4f50a4 100644 --- a/x-pack/legacy/plugins/siem/public/components/page/hosts/authentications_table/index.tsx +++ b/x-pack/legacy/plugins/siem/public/components/page/hosts/authentications_table/index.tsx @@ -4,8 +4,6 @@ * you may not use this file except in compliance with the Elastic License. */ -import { EuiToolTip } from '@elastic/eui'; -import { FormattedRelative } from '@kbn/i18n/react'; import { has } from 'lodash/fp'; import React from 'react'; import { connect } from 'react-redux'; @@ -18,6 +16,7 @@ import { hostsModel, hostsSelectors, State } from '../../../../store'; import { DragEffects, DraggableWrapper } from '../../../drag_and_drop/draggable_wrapper'; import { escapeDataProviderId } from '../../../drag_and_drop/helpers'; import { getEmptyTagValue } from '../../../empty_value'; +import { FormattedRelativePreferenceDate } from '../../../formatted_date'; import { HostDetailsLink, IPDetailsLink } from '../../../links'; import { Columns, ItemsPerRow, PaginatedTable } from '../../../paginated_table'; import { IS_OPERATOR } from '../../../timeline/data_providers/data_provider'; @@ -200,6 +199,7 @@ const getAuthenticationColumns = (): AuthTableColumns => [ /> ); }, + width: '8%', }, { name: i18n.FAILURES, @@ -237,16 +237,15 @@ const getAuthenticationColumns = (): AuthTableColumns => [ /> ); }, + width: '8%', }, { name: i18n.LAST_SUCCESSFUL_TIME, truncateText: false, hideForMobile: false, render: ({ node }) => - has('lastSuccess.timestamp', node) ? ( - - - + has('lastSuccess.timestamp', node) && node.lastSuccess!.timestamp != null ? ( + ) : ( getEmptyTagValue() ), @@ -291,9 +290,7 @@ const getAuthenticationColumns = (): AuthTableColumns => [ hideForMobile: false, render: ({ node }) => has('lastFailure.timestamp', node) && node.lastFailure!.timestamp != null ? ( - - - + ) : ( getEmptyTagValue() ), diff --git a/x-pack/legacy/plugins/siem/public/components/page/hosts/first_last_seen_host/index.tsx b/x-pack/legacy/plugins/siem/public/components/page/hosts/first_last_seen_host/index.tsx index 665f1f46bc7c1..553615e950b8d 100644 --- a/x-pack/legacy/plugins/siem/public/components/page/hosts/first_last_seen_host/index.tsx +++ b/x-pack/legacy/plugins/siem/public/components/page/hosts/first_last_seen_host/index.tsx @@ -5,15 +5,14 @@ */ import { EuiIcon, EuiLoadingSpinner, EuiText, EuiToolTip } from '@elastic/eui'; -import moment from 'moment'; + import React from 'react'; import { ApolloConsumer } from 'react-apollo'; import { pure } from 'recompose'; import { useFirstLastSeenHostQuery } from '../../../../containers/hosts/first_last_seen'; import { getEmptyTagValue } from '../../../empty_value'; -import { PreferenceFormattedDate } from '../../../formatted_date'; -import { LocalizedDateTooltip } from '../../../localized_date_tooltip'; +import { FormattedRelativePreferenceDate } from '../../../formatted_date'; export enum FirstLastSeenHostType { FIRST_SEEN = 'first-seen', @@ -52,9 +51,7 @@ export const FirstLastSeenHost = pure<{ hostname: string; type: FirstLastSeenHos : !loading && valueSeen != null && ( - - - + )} {!loading && valueSeen == null && getEmptyTagValue()} diff --git a/x-pack/legacy/plugins/siem/public/components/page/hosts/hosts_table/columns.tsx b/x-pack/legacy/plugins/siem/public/components/page/hosts/hosts_table/columns.tsx index b626df58b007f..8d490d2c152d9 100644 --- a/x-pack/legacy/plugins/siem/public/components/page/hosts/hosts_table/columns.tsx +++ b/x-pack/legacy/plugins/siem/public/components/page/hosts/hosts_table/columns.tsx @@ -5,14 +5,12 @@ */ import { EuiIcon, EuiToolTip } from '@elastic/eui'; -import moment from 'moment'; import React from 'react'; import { DragEffects, DraggableWrapper } from '../../../drag_and_drop/draggable_wrapper'; import { escapeDataProviderId } from '../../../drag_and_drop/helpers'; import { getEmptyTagValue } from '../../../empty_value'; -import { PreferenceFormattedDate } from '../../../formatted_date'; import { HostDetailsLink } from '../../../links'; -import { LocalizedDateTooltip } from '../../../localized_date_tooltip'; +import { FormattedRelativePreferenceDate } from '../../../formatted_date'; import { IS_OPERATOR } from '../../../timeline/data_providers/data_provider'; import { Provider } from '../../../timeline/data_providers/provider'; import { AddFilterToGlobalSearchBar, createFilter } from '../../add_filter_to_global_search_bar'; @@ -75,11 +73,7 @@ export const getHostsColumns = (): HostsTableColumns => [ sortable: true, render: lastSeen => { if (lastSeen != null) { - return ( - - - - ); + return ; } return getEmptyTagValue(); }, diff --git a/x-pack/legacy/plugins/siem/public/components/page/hosts/uncommon_process_table/index.tsx b/x-pack/legacy/plugins/siem/public/components/page/hosts/uncommon_process_table/index.tsx index 6fd2cab90efea..2f2d84306e25e 100644 --- a/x-pack/legacy/plugins/siem/public/components/page/hosts/uncommon_process_table/index.tsx +++ b/x-pack/legacy/plugins/siem/public/components/page/hosts/uncommon_process_table/index.tsx @@ -161,16 +161,20 @@ const getUncommonColumns = (): UncommonProcessTableColumns => [ width: '20%', }, { + align: 'right', name: i18n.NUMBER_OF_HOSTS, truncateText: false, hideForMobile: false, render: ({ node }) => <>{node.hosts != null ? node.hosts.length : getEmptyValue()}, + width: '8%', }, { + align: 'right', name: i18n.NUMBER_OF_INSTANCES, truncateText: false, hideForMobile: false, render: ({ node }) => defaultToEmptyTag(node.instances), + width: '8%', }, { name: i18n.HOSTS, diff --git a/x-pack/legacy/plugins/siem/public/components/page/network/ip_overview/index.tsx b/x-pack/legacy/plugins/siem/public/components/page/network/ip_overview/index.tsx index 7c695e37386ef..b71d786e643eb 100644 --- a/x-pack/legacy/plugins/siem/public/components/page/network/ip_overview/index.tsx +++ b/x-pack/legacy/plugins/siem/public/components/page/network/ip_overview/index.tsx @@ -114,8 +114,14 @@ export const IpOverview = pure( const descriptionLists: Readonly = [ firstColumn, [ - { title: i18n.FIRST_SEEN, description: dateRenderer('firstSeen', typeData) }, - { title: i18n.LAST_SEEN, description: dateRenderer('lastSeen', typeData) }, + { + title: i18n.FIRST_SEEN, + description: typeData ? dateRenderer(typeData.firstSeen) : getEmptyTagValue(), + }, + { + title: i18n.LAST_SEEN, + description: typeData ? dateRenderer(typeData.lastSeen) : getEmptyTagValue(), + }, ], [ { diff --git a/x-pack/legacy/plugins/siem/public/components/page/network/network_dns_table/columns.tsx b/x-pack/legacy/plugins/siem/public/components/page/network/network_dns_table/columns.tsx index 353699c5158bc..b1c1b26cd498d 100644 --- a/x-pack/legacy/plugins/siem/public/components/page/network/network_dns_table/columns.tsx +++ b/x-pack/legacy/plugins/siem/public/components/page/network/network_dns_table/columns.tsx @@ -69,6 +69,7 @@ export const getNetworkDnsColumns = (type: networkModel.NetworkType): NetworkDns }, }, { + align: 'right', field: `node.${NetworkDnsFields.queryCount}`, name: i18n.TOTAL_QUERIES, sortable: true, @@ -83,6 +84,7 @@ export const getNetworkDnsColumns = (type: networkModel.NetworkType): NetworkDns }, }, { + align: 'right', field: `node.${NetworkDnsFields.uniqueDomains}`, name: i18n.UNIQUE_DOMAINS, sortable: true, @@ -97,6 +99,7 @@ export const getNetworkDnsColumns = (type: networkModel.NetworkType): NetworkDns }, }, { + align: 'right', field: `node.${NetworkDnsFields.dnsBytesIn}`, name: i18n.DNS_BYTES_IN, sortable: true, @@ -111,6 +114,7 @@ export const getNetworkDnsColumns = (type: networkModel.NetworkType): NetworkDns }, }, { + align: 'right', field: `node.${NetworkDnsFields.dnsBytesOut}`, name: i18n.DNS_BYTES_OUT, sortable: true, diff --git a/x-pack/legacy/plugins/siem/public/components/page/network/users_table/columns.tsx b/x-pack/legacy/plugins/siem/public/components/page/network/users_table/columns.tsx index 2c51fb8f94561..b732ac5bfd5fa 100644 --- a/x-pack/legacy/plugins/siem/public/components/page/network/users_table/columns.tsx +++ b/x-pack/legacy/plugins/siem/public/components/page/network/users_table/columns.tsx @@ -73,6 +73,7 @@ export const getUsersColumns = (flowTarget: FlowTarget, tableId: string): UsersC }), }, { + align: 'right', field: 'node.user.count', name: i18n.DOCUMENT_COUNT, truncateText: false, diff --git a/x-pack/legacy/plugins/siem/public/containers/events/last_event_time/mock.ts b/x-pack/legacy/plugins/siem/public/containers/events/last_event_time/mock.ts index 09cdfbd07bffd..ca8786077851f 100644 --- a/x-pack/legacy/plugins/siem/public/containers/events/last_event_time/mock.ts +++ b/x-pack/legacy/plugins/siem/public/containers/events/last_event_time/mock.ts @@ -28,11 +28,11 @@ interface MockLastEventTimeQuery { }; } -const getTimeTwelveDaysAgo = () => { +const getTimeTwelveMinutesAgo = () => { const d = new Date(); const ts = d.getTime(); - const twelveDays = ts - 12 * 24 * 60 * 60 * 1000; - return new Date(twelveDays).toISOString(); + const twelveMinutes = ts - 12 * 60 * 1000; + return new Date(twelveMinutes).toISOString(); }; export const mockLastEventTimeQuery: MockLastEventTimeQuery[] = [ @@ -51,7 +51,7 @@ export const mockLastEventTimeQuery: MockLastEventTimeQuery[] = [ source: { id: 'default', LastEventTime: { - lastSeen: getTimeTwelveDaysAgo(), + lastSeen: getTimeTwelveMinutesAgo(), errorMessage: null, }, },