-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create a new menu for observability links #54847
Conversation
Pinging @elastic/logs-metrics-ui (Team:logs-metrics-ui) |
Not sure if it's within the scope of this PR, but there were talks of potentially also showing the value of Edit: Also, in your description, this should probably close #53590, not #53282 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Visually this looks pretty awesome ✨
How about we use an API for the menu components that favors composition over configuration such that a consumer has more flexibility? It could look something like
<ActionMenuPopover
closePopover={...}
isOpen={...}
>
<ActionMenuSection>
<ActionMenuSectionTitle>
<FormatMessage ... />
</ActionMenuSectionTitle>
<ActionMenuSectionSubtitle>
<FormatMessage ... />
</ActionMenuSectionSubtitle>
<ActionMenuLinks>
<ActionMenuLink href="">
<FormatMessage ... />
</ActionMenuLink>
<ActionMenuLink href="">
<FormatMessage ... />
</ActionMenuLink>
</ActionMenuLinks>
</ActionMenuSection>
<ActionMenuSectionDivider />
<ActionMenuSection>
<ActionMenuLinks>
<ActionMenuLink href="">
<FormatMessage ... />
</ActionMenuLink>
<ActionMenuLink href="">
<FormatMessage ... />
</ActionMenuLink>
</ActionMenuLinks>
</ActionMenuSection>
</ActionMenuPopover>
The <ActionMenu*>
components would map to the correctly parameterized EUI components and take their content as children
. That way we would make sure the popovers are styled consistently while remaining open for extension and adaptation to specific needs (such as embedding a visualizations).
@weltenwort thanks for the feedback! A couple of thoughts on that approach.
Another approach could be to make some of the props either a |
One second thought, there could be some semantic benefit there. It's probably easier to think |
The example JS code on the EUI page suggests the items can also be passed as <EuiListGroup flush={flushWidth} bordered={showBorder}>
<EuiListGroupItem onClick={handleOnClick} label="First item" />
<EuiListGroupItem onClick={handleOnClick} label="Second item" />
<EuiListGroupItem
onClick={handleOnClick}
label="Third item"
isActive
/>
<EuiListGroupItem
onClick={handleOnClick}
label="Fourth item"
isDisabled
/>
</EuiListGroup> |
@phillipb that looks great 🤩. Are you also planning to do the shared component? Thank you for your great work! |
@katrin-freihofner: yep. I just need to figure out where that should be. @weltenwort any ideas on the right place to put this? |
Good question 🤔 there used to be an |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is really good 👏 I just left a few questions below.
x-pack/legacy/plugins/infra/public/components/waffle/action_menu.tsx
Outdated
Show resolved
Hide resolved
x-pack/legacy/plugins/infra/public/components/waffle/node_context_menu.tsx
Outdated
Show resolved
Hide resolved
x-pack/legacy/plugins/infra/public/components/waffle/node_context_menu.tsx
Outdated
Show resolved
Hide resolved
@katrin-freihofner with the addition of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
x-pack/legacy/plugins/infra/public/components/waffle/node_context_menu.tsx
Outdated
Show resolved
Hide resolved
Maybe a max-width on the popup + word-wrap? Or should I just truncate with an ellipsis? @katrin-freihofner any preference? |
I think to truncate and ellipsis is fine. |
@phillipb @katrin-freihofner We should also add a tooltip with the full value. |
🤔 how strange, it appears to have disappeared! @phillipb, let's set up a small plugin in the new platform space, called "observability", and then we can export this component from the public/index file of that plugin. You can model it after the infra plugin that's in x-pack/plugins right now, but it obviously doesn't need to be as fully featured. I'm happy to help. |
user doesn't have permission to update head repository |
@elasticmachine merge upstream |
user doesn't have permission to update head repository |
…vability-action-menu
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@elasticmachine merge upstream |
user doesn't have permission to update head repository |
@phillipb can you check the |
@elasticmachine merge upstream |
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
…ve-out-legacy * 'master' of github.com:elastic/kibana: (187 commits) [ML] Reseting categorization validation if category field is cleared (elastic#56029) [SIEM] Fields browser readable (elastic#56000) [docs] Remove unused callout (elastic#56032) Refactor saved object management registry usage (elastic#54155) [SIEM][Detection Engine] critical blocker, updates the pre-packaged rules, removes dead ones, adds license file (elastic#56090) Fix failing snapshot artifact tests when using env var (elastic#56063) Fix Github PR comment formatting (elastic#56078) [Maps] fix join metric field selection bugs (elastic#56044) Create a new menu for observability links (elastic#54847) [SIEM] [Detection Engine] Fixes histogram intervals (elastic#55969) make test less flaky by retrying if list is re-rendered (elastic#55949) Remove matrix build support (elastic#54202) Add animation to service map layout (elastic#56042) [Canvas] Remove Angular and unnecessary reporting config from Canvas (elastic#54050) [Uptime] Simplify snapshot max to Infinity (elastic#55931) [Uptime] Reintroduce a column for url (elastic#55451) Cleanup action task params objects after successful execution (elastic#55227) [CI] Retry flaky tests (elastic#53961) Expose NP FieldFormats service to server side (elastic#55419) [Endpoint] EMT-65: make endpoint data types common, restructure (elastic#54772) ... # Conflicts: # src/legacy/core_plugins/console/public/np_ready/application/components/split_panel/__snapshots__/split_panel.test.tsx.snap # src/legacy/core_plugins/console/public/np_ready/application/components/split_panel/containers/panel.tsx # src/legacy/core_plugins/console/public/np_ready/application/components/split_panel/context.tsx # src/legacy/core_plugins/console/public/np_ready/application/components/split_panel/index.ts # src/legacy/core_plugins/console/public/np_ready/application/components/split_panel/split_panel.test.tsx # src/legacy/ui/public/vis/editors/default/default_editor.tsx # src/plugins/console/public/application/components/split_panel/__snapshots__/split_panel.test.tsx.snap # src/plugins/console/public/application/components/split_panel/components/resizer.tsx # src/plugins/console/public/application/components/split_panel/containers/panel.tsx # src/plugins/console/public/application/components/split_panel/containers/panel_container.tsx # src/plugins/console/public/application/components/split_panel/context.tsx # src/plugins/console/public/application/components/split_panel/index.ts # src/plugins/console/public/application/components/split_panel/registry.ts # src/plugins/console/public/application/components/split_panel/split_panel.test.tsx # src/plugins/kibana_react/public/split_panel/__snapshots__/split_panel.test.tsx.snap # src/plugins/kibana_react/public/split_panel/containers/panel.tsx # src/plugins/kibana_react/public/split_panel/context.tsx # src/plugins/kibana_react/public/split_panel/index.ts # src/plugins/kibana_react/public/split_panel/split_panel.test.tsx
* master: (77 commits) [ML] Reseting categorization validation if category field is cleared (elastic#56029) [SIEM] Fields browser readable (elastic#56000) [docs] Remove unused callout (elastic#56032) Refactor saved object management registry usage (elastic#54155) [SIEM][Detection Engine] critical blocker, updates the pre-packaged rules, removes dead ones, adds license file (elastic#56090) Fix failing snapshot artifact tests when using env var (elastic#56063) Fix Github PR comment formatting (elastic#56078) [Maps] fix join metric field selection bugs (elastic#56044) Create a new menu for observability links (elastic#54847) [SIEM] [Detection Engine] Fixes histogram intervals (elastic#55969) make test less flaky by retrying if list is re-rendered (elastic#55949) Remove matrix build support (elastic#54202) Add animation to service map layout (elastic#56042) [Canvas] Remove Angular and unnecessary reporting config from Canvas (elastic#54050) [Uptime] Simplify snapshot max to Infinity (elastic#55931) [Uptime] Reintroduce a column for url (elastic#55451) Cleanup action task params objects after successful execution (elastic#55227) [CI] Retry flaky tests (elastic#53961) Expose NP FieldFormats service to server side (elastic#55419) [Endpoint] EMT-65: make endpoint data types common, restructure (elastic#54772) ...
* Create a new menu for observability links. Use it on inentory page. * Change the order of props for clarity * Fix default message * Composition over configuration * Show ids and ips. PR feedback. * Don't wrap subtitle. Use fields in inventory model for name * Tooltip was becoming hacky. Keep it simple and wrap the id. * Create observability plugin. Add action menu to it. * Fix path * Satisfy linter and fix test * Please the linter * Update translastions * Update test for disabled links * Update more tests Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* Create a new menu for observability links. Use it on inentory page. * Change the order of props for clarity * Fix default message * Composition over configuration * Show ids and ips. PR feedback. * Don't wrap subtitle. Use fields in inventory model for name * Tooltip was becoming hacky. Keep it simple and wrap the id. * Create observability plugin. Add action menu to it. * Fix path * Satisfy linter and fix test * Please the linter * Update translastions * Update test for disabled links * Update more tests Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Summary
Created a new component for the observability action menu, and started using it on the metrics inventory screen. Fixes #53282.
TODO: Move the component to a central area, so that it can be used by all observability teams.
Checklist
Use
strikethroughsto remove checklist items you don't feel are applicable to this PR.This was checked for cross-browser compatibility, including a check against IE11Documentation was added for features that require explanation or tutorialsUnit or functional tests were updated or added to match the most common scenariosThis was checked for keyboard-only and screenreader accessibility