Skip to content

Commit

Permalink
title updates
Browse files Browse the repository at this point in the history
  • Loading branch information
christineweng committed Feb 21, 2024
1 parent bba0226 commit 8650791
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ describe('<EventHeaderTitle />', () => {
expect(getByTestId(SEVERITY_VALUE_TEST_ID)).toBeInTheDocument();
});

it('should render event kind as title if event.kind is not event', () => {
it('should render event details as title if event.kind is not event', () => {
const mockGetFieldsData = (field: string) => {
switch (field) {
case 'event.kind':
Expand All @@ -60,7 +60,7 @@ describe('<EventHeaderTitle />', () => {
getFieldsData: mockGetFieldsData,
});

expect(getByTestId(EVENT_HEADER_TEXT_TEST_ID)).toHaveTextContent('Alert');
expect(getByTestId(EVENT_HEADER_TEXT_TEST_ID)).toHaveTextContent('Event details');
});

it('should render event category as title if event.kind is event', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import type { FC } from 'react';
import React, { memo, useMemo } from 'react';
import { EuiSpacer } from '@elastic/eui';
import { startCase } from 'lodash';
import { i18n } from '@kbn/i18n';
import { FlyoutTitle } from '../../../shared/components/flyout_title';
import { DocumentSeverity } from './severity';
Expand All @@ -34,8 +33,6 @@ export const EventHeaderTitle: FC = memo(() => {
if (eventKind === 'event' && eventCategory) {
const fieldName = EVENT_CATEGORY_TO_FIELD[eventCategory];
eventTitle = getField(getFieldsData(fieldName));
} else if (eventKind && eventKind !== null) {
eventTitle = startCase(eventKind);
}
return (
eventTitle ??
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,12 @@ export const getEcsAllowedValueDescription = (fieldName: string, value: string):

// mapping of event category to the field displayed as title
export const EVENT_CATEGORY_TO_FIELD: Record<string, string> = {
authentication: '',
authentication: 'user.name',
configuration: '',
database: '',
driver: '',
email: '',
file: '',
file: 'file.name',
host: 'host.name',
iam: '',
intrusion_detection: '',
Expand Down

0 comments on commit 8650791

Please sign in to comment.