diff --git a/src-docs/src/views/notification_event/notification_event_example.js b/src-docs/src/views/notification_event/notification_event_example.js index e8e00333fbc..0c51a80b19d 100644 --- a/src-docs/src/views/notification_event/notification_event_example.js +++ b/src-docs/src/views/notification_event/notification_event_example.js @@ -1,7 +1,6 @@ import React from 'react'; import { GuideSectionTypes } from '../../components'; import { Link } from 'react-router-dom'; -import { EuiNotificationEventMeta } from '../../../../src/components/notification/notification_event_meta'; import { EuiNotificationEvent, EuiText, @@ -91,7 +90,6 @@ export const NotificationEventExample = { ], props: { EuiNotificationEvent, - EuiNotificationEventMeta, EuiContextMenuItem, EuiPrimaryActionProps, }, @@ -192,7 +190,6 @@ export const NotificationEventExample = { ), props: { EuiNotificationEvent, - EuiNotificationEventMeta, EuiContextMenuItem, EuiPrimaryActionProps, }, @@ -219,7 +216,6 @@ export const NotificationEventExample = { ), props: { EuiNotificationEvent, - EuiNotificationEventMeta, EuiContextMenuItem, EuiPrimaryActionProps, }, diff --git a/src/components/notification/__snapshots__/notification_event.test.tsx.snap b/src/components/notification/__snapshots__/notification_event.test.tsx.snap index 1df78e35c2c..3bbb1d4038d 100644 --- a/src/components/notification/__snapshots__/notification_event.test.tsx.snap +++ b/src/components/notification/__snapshots__/notification_event.test.tsx.snap @@ -2,8 +2,10 @@ exports[`EuiNotificationEvent is rendered 1`] = `
{ test('is rendered', () => { @@ -21,6 +25,7 @@ describe('EuiNotificationEvent', () => { time="1 min ago" title="title" messages={['message']} + {...requiredProps} /> ); diff --git a/src/components/notification/notification_event.tsx b/src/components/notification/notification_event.tsx index 6ae70c83129..12184655698 100644 --- a/src/components/notification/notification_event.tsx +++ b/src/components/notification/notification_event.tsx @@ -6,8 +6,16 @@ * Side Public License, v 1. */ -import React, { FunctionComponent, ReactElement, createElement } from 'react'; +import React, { + FunctionComponent, + ReactElement, + createElement, + HTMLAttributes, +} from 'react'; import classNames from 'classnames'; + +import { CommonProps } from '../common'; + import { EuiNotificationEventMeta, EuiNotificationEventMetaProps, @@ -35,7 +43,9 @@ export type EuiNotificationEventProps = Omit< Omit< EuiNotificationEventReadButtonProps, 'onClick' | 'color' | 'eventName' | 'isRead' | 'id' - > & { + > & + CommonProps & + Omit, 'title'> & { /** * A unique identifier */ @@ -104,9 +114,12 @@ export const EuiNotificationEvent: FunctionComponent onClickTitle, onClickPrimaryAction, headingLevel = 'h2', + className, + ...rest }) => { const classes = classNames('euiNotificationEvent', { 'euiNotificationEvent--withReadState': typeof isRead === 'boolean', + className, }); const classesTitle = classNames('euiNotificationEvent__title', { @@ -122,7 +135,12 @@ export const EuiNotificationEvent: FunctionComponent }; return ( -
+
{typeof isRead === 'boolean' && (
{!!onRead ? ( diff --git a/upcoming_changelogs/6208.md b/upcoming_changelogs/6208.md new file mode 100644 index 00000000000..e2901b6c4aa --- /dev/null +++ b/upcoming_changelogs/6208.md @@ -0,0 +1,3 @@ +**Bug fixes** + +- Fixed bug where `className` and `rest` props were not being passed to the `EuiNotificationEvent`