[Flyout System] require title for session flyouts, support custom actions in top menu#8997
Conversation
f42823f to
103540a
Compare
| > | ||
| {!isPushed && screenReaderDescription} | ||
| {!hideCloseButton && onClose && ( | ||
| {!flyoutMenuProps && !hideCloseButton && onClose && ( |
There was a problem hiding this comment.
Previously, a flyout menu would have to be a child of EuiFlyout, which would cause two close buttons to appear in the DOM. Now, we use the existence of flyoutMenuProps to render the flyout menu within EuiFlyout.
| { config: { mainTitle: 'Third item' } }, | ||
| ]; | ||
|
|
||
| // TODO: history popover should be internalized in EuiFlyoutMenu when historyItems are passed |
There was a problem hiding this comment.
These TODOs will be my next PR
965cf1b to
93ad1bf
Compare
288bed2 to
861da92
Compare
| const { flyoutId, level, size } = action; | ||
| const { flyoutId, title, level, size } = action; | ||
|
|
||
| // Ignore duplicate registrations |
There was a problem hiding this comment.
A note for future self: We should probably have a way to debug these in dev mode.
There was a problem hiding this comment.
Just tested this. If you try to register two sessions with the same ID, we get a console warning, and a dynamic replacement for the duplicate:
warn_once.ts:14 Flyout with ID literalId already registered; using new ID flyout-:re:
tkajtoch
left a comment
There was a problem hiding this comment.
Code changes look good to me. I really like the switch to flyoutMenuProps or just aria-label!
I tested updated stories in the PR environment and confirm the changes work as expected.
💚 Build SucceededHistory
|
💚 Build Succeeded
History
|
…ions in top menu (elastic#8997) Co-authored-by: Tomasz Kajtoch <tomasz.kajtoch@elastic.co>
Summary
Part of #8873
Supports rending the top menu bar in EuiFlyout using
flyoutMenuProps.Before
After
Example 1, using title and custom actions from
flyoutMenuProps:Example 2, using title from
aria-labelprop:Why are we making this change?
Part of the Epic for Flyout System.
Part of #8873
This PR works on two requirements from the Epic:
EuiFlyoutMenu. This PR enforces that using validation of EuiFlyout props. The EuiFlyout in a session must haveflyoutMenuPropswith a title field, oraria-labelcan be used as the title for the top menu bar.flyoutMenuPropsprop.Screenshots
Impact to users
Provides consistent flyout menu bar for session-based flyouts.
QA
Remove or strikethrough items that do not apply to your PR.
General checklist
@defaultif default values are missing) and playground toggles