Conversation
* Add notification event meta * WIP * adding i18n * Fixing axe error in docs example * Adding context menus items * contetx menu item anchor position * Adding tests * Update src/components/notification/notification_event_meta.tsx Co-authored-by: Caroline Horn <549577+cchaos@users.noreply.github.com> * Improving code based on PR review * More PR review * Better description * Update src/components/notification/notification_event_meta.tsx Co-authored-by: Caroline Horn <549577+cchaos@users.noreply.github.com> * Update src-docs/src/views/notification_events/notification_events.js Co-authored-by: Caroline Horn <549577+cchaos@users.noreply.github.com> * Badge 100% width * ES lint * Read and unread states * Make sure overflow menu stays in the top right * Improving a11y * Adding playground for event read button * Removing EuiNotificationEventMeta from exported on index * Add a behavior unit test, update context menu test to snapshot the menu items * Update src/components/notification/notification_event_meta.tsx Co-authored-by: Chandler Prall <chandler.prall@gmail.com> * Update src/components/notification/notification_event_read_button.tsx Co-authored-by: Chandler Prall <chandler.prall@gmail.com> Co-authored-by: Caroline Horn <549577+cchaos@users.noreply.github.com> Co-authored-by: Chandler Prall <chandler.prall@gmail.com>
…utton (#4424) * Adding animation and hasBackground props to EuiHeaderSectionItemButton * A few improvements * Docs props * Removing hasBackground prop * Using JS do hide and show on xs breakpoints * Adding a snippet * refactor animation prop into a ref method * Snapshots. Trigger animation comments. * Deleting unused css animation * triggerAnimation explanation * Cleaned up some logic and created a docs example specifically for the notifications * re-enable the animation test * Update src-docs/src/views/header/header_animate.js Co-authored-by: Chandler Prall <chandler.prall@gmail.com> * Update src-docs/src/views/header/header_example.js Co-authored-by: Chandler Prall <chandler.prall@gmail.com> * Update src-docs/src/views/header/header_alert.js Co-authored-by: Chandler Prall <chandler.prall@gmail.com> * Update src-docs/src/views/header/header_alert.js Co-authored-by: Chandler Prall <chandler.prall@gmail.com> * Update src-docs/src/views/header/header_animate.js Co-authored-by: Chandler Prall <chandler.prall@gmail.com> * Update src-docs/src/views/header/header_example.js Co-authored-by: Chandler Prall <chandler.prall@gmail.com> * renaming animate methods to euiAnimate * euiAnimate into header example * simplifying onClick closeFlyout * Update src-docs/src/views/header/header_example.js Co-authored-by: Caroline Horn <549577+cchaos@users.noreply.github.com> Co-authored-by: Chandler Prall <chandler.prall@gmail.com> Co-authored-by: cchaos <caroline.horn@elastic.co> Co-authored-by: Caroline Horn <549577+cchaos@users.noreply.github.com>
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_4513/ |
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_4513/ |
* Notification events * Looping through EuiNotificationEvent * Adding props table and more methods * wip * Renaming event notifications to event messages * onClickNoNewsTitles * Toggle mark as read/unread * Initial documentation * Improving examples * Fixing TS error * Refactored EuiEventNotification context menu item creation * improving data * Notifications data * Primary example buttons * Reset data * More docs * snippets * Adding tests * Better messages explanation * Better snippets * Small fixes * Missing prop explanation * Adding heading level * Adding flexible comp section * More a11y * Update src/components/notification/notification_event_messages.tsx Co-authored-by: Michail Yasonik <michail@yasonik.com> * Button messages ay11 * test * Better descriptions * Tests * Adding icon arial label into notifications feed example * i18n token * i18n token * i18 token again * primaryAction description * More description * Update src/components/notification/notification_event_messages.tsx Co-authored-by: Caroline Horn <549577+cchaos@users.noreply.github.com> * Update src/components/notification/notification_event_messages.tsx Co-authored-by: Caroline Horn <549577+cchaos@users.noreply.github.com> * Update src-docs/src/views/notification_event/notification_event_example.js Co-authored-by: Caroline Horn <549577+cchaos@users.noreply.github.com> * Update src-docs/src/views/notification_event/notification_event_example.js Co-authored-by: Caroline Horn <549577+cchaos@users.noreply.github.com> * Update src-docs/src/views/notification_event/notification_event_example.js Co-authored-by: Caroline Horn <549577+cchaos@users.noreply.github.com> * Update src-docs/src/views/notification_event/notification_event_example.js Co-authored-by: Caroline Horn <549577+cchaos@users.noreply.github.com> * Update src-docs/src/views/notification_event/notification_event_example.js Co-authored-by: Caroline Horn <549577+cchaos@users.noreply.github.com> * Addressing PR review * More improvements * Adding comment * Excluding `eventName` at top level and changing title vs aria-label on read button * Fix title * Fixing tests and removing evenName from docs usage * Fixing icon margin * More tests and small fixes * Moving read button from event meta comp to event comp * Split primaryAction and primaryActionProps * Exposing EuiPrimaryActionProps in props table * Update src-docs/src/views/notification_event/notification_event_example.js Co-authored-by: Caroline Horn <549577+cchaos@users.noreply.github.com> * Update src-docs/src/views/notification_event/notification_event_example.js Co-authored-by: Caroline Horn <549577+cchaos@users.noreply.github.com> * Update src-docs/src/views/notification_event/notification_event_example.js Co-authored-by: Caroline Horn <549577+cchaos@users.noreply.github.com> * Update src-docs/src/views/notification_event/notification_event_example.js Co-authored-by: Caroline Horn <549577+cchaos@users.noreply.github.com> * Update src-docs/src/views/notification_event/notification_event_example.js Co-authored-by: Caroline Horn <549577+cchaos@users.noreply.github.com> * Update src-docs/src/views/notification_event/notification_event_example.js Co-authored-by: Caroline Horn <549577+cchaos@users.noreply.github.com> * Update src-docs/src/views/notification_event/notification_event_example.js Co-authored-by: Caroline Horn <549577+cchaos@users.noreply.github.com> * Messages length and more * Fixing data test subj * Renaming tsx examples to js Co-authored-by: Chandler Prall <chandler.prall@gmail.com> Co-authored-by: Michail Yasonik <michail@yasonik.com> Co-authored-by: Caroline Horn <549577+cchaos@users.noreply.github.com> Co-authored-by: cchaos <caroline.horn@elastic.co>
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_4513/ |
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_4513/ |
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_4513/ |
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_4513/ |
cchaos
left a comment
There was a problem hiding this comment.
🎉 Great job!! Can't wait to see this in action.
| onOpenContextMenu ? () => onOpenContextMenu(id) : undefined | ||
| } | ||
| eventName={title} | ||
| onRead={() => onRead?.(id, isRead!)} |
There was a problem hiding this comment.
Probably isRead should be required then? or pass an optional flag?
There was a problem hiding this comment.
In case you don't pass isRead, the read button won't appear. So that's why we can't make it required.
We discussed if it was possible for the MVP to have a way to save the read states and because was something that we were not completely sure it was decided to live it in open.
There was a problem hiding this comment.
Actually, I deleted this line onRead={() => onRead?.(id, isRead!)}. After a refactor in #4433 the read button was left outside of the EuiNotificationEventMeta and this line was doing nothing.
Thanks, @restrry . It was a good catch!
| iconType={iconType} | ||
| iconAriaLabel={iconAriaLabel} | ||
| time={time} | ||
| onOpenContextMenu={ |
There was a problem hiding this comment.
nit: onOpenContextMenu={onOpenContextMenu}
EuiNotificationEventMeta declares it as an optional field.
| /* | ||
| * An array of strings that get individually wrapped in `<p>` tags | ||
| */ | ||
| messages: string[]; |
There was a problem hiding this comment.
Do we require messages to be already translated? Let's mention it in the comment.
PS. the same for other text props.
There was a problem hiding this comment.
In EUI we assume translating a string is a decision from the consumer app.
| /> | ||
|
|
||
| {onClickTitle ? ( | ||
| <EuiLink onClick={() => onClickTitle(id)} {...titleProps}> |
There was a problem hiding this comment.
No. You need to create a logic to redirect to a page or external link.
| <div className="euiNotificationEvent__readButton"> | ||
| <EuiNotificationEventReadButton | ||
| isRead={isRead} | ||
| onClick={() => onRead?.(id, isRead)} |
There was a problem hiding this comment.
Should we verify whether it's defined?
There was a problem hiding this comment.
It's being verified. 🎉
I checked with @chandlerprall if the onRead?. was verifying that.
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_4513/ |
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_4513/ |
|
Thanks, @restrry. I went through your comments and improved a few things. 🎉 If you have more suggestions don't hesitate to open an issue. |

Summary
This PR add a new component called EuiNotification Event and a new
euiAnimation()method on the EuiHeaderSectionItemButton ref.This work is essential to achieve a notification template similar to MVP Prototype.
Feature spec
You can find the feature spec: here.
Build Preview
You can find the preview here: here
Changelog and PR's
As part of #4433
As part of #4424
euiAnimation()method on the EuiHeaderSectionItemButton refAs part of #4531
Checklist