Skip to content
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

[Logs UI][Metrics UI] Move actions to the kibana header #84648

Merged
merged 6 commits into from
Dec 9, 2020

Conversation

afgomez
Copy link
Contributor

@afgomez afgomez commented Dec 1, 2020

Summary

Closes #82823

This PR moves the right-side actions from the tab bar to the kibana header, to align with other plugins.

Before:
Screenshot 2020-12-01 at 15 22 54

After:
Screenshot 2020-12-01 at 15 17 34

Implementation details

The implementation is inspired by #82292 and reuses some of the plugins present there.

We had to expose the appMountParameters.setHeaderActionMenu to the UI. We did this through a new context.

Moving forward, it can be interesting to create an InfraContext to aggregate all these dependencies (similiar to what APM does) instead of nesting contexts within each other.

@afgomez afgomez added Feature:Metrics UI Metrics UI feature v8.0.0 Feature:Logs UI Logs UI feature Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services release_note:skip Skip the PR/issue when compiling release notes v7.11.0 labels Dec 1, 2020
@afgomez afgomez added this to the Logs UI 7.11 milestone Dec 1, 2020
@afgomez afgomez requested a review from a team as a code owner December 1, 2020 14:22
@elasticmachine
Copy link
Contributor

Pinging @elastic/logs-metrics-ui (Team:logs-metrics-ui)

@katrin-freihofner
Copy link
Contributor

Thank you for adding this!

In the logs UI I only found a small issue when it comes to small screens:
Screenshot 2020-12-02 at 12 47 08

In the metrics UI, I feel that the buttons are appearing/disappearing depending on the tab underneath is not great.
metrics-ui

I think we could leave the buttons always there, independent of the tab. Do you think we should handle this separately?

@afgomez
Copy link
Contributor Author

afgomez commented Dec 2, 2020

Thanks for the review @katrin-freihofner

In the logs UI I only found a small issue when it comes to small screens:

I'll take a look 👍

In the metrics UI, I feel that the buttons are appearing/disappearing depending on the tab underneath is not great.

I think this is intentional (it was like that before). Can someone from @elastic/metrics-ui comment on that?

@phillipb
Copy link
Contributor

phillipb commented Dec 2, 2020

@afgomez, @katrin-freihofner yes, it is intentional. Anomaly detection only detects anomalies for inventory. Also, on the settings page if we were to show the "Alerts" button, which alerts flyout would appear -- the one for metrics explorer or the one for inventory?

@katrin-freihofner
Copy link
Contributor

Ok, it is probably fine to move forward with this to finish the PR. But we should definitely look into this again soon, I will talk to @katefarrar about it.

@afgomez
Copy link
Contributor Author

afgomez commented Dec 2, 2020

In the logs UI I only found a small issue when it comes to small screens

@katrin-freihofner this is fixed now. Do you mind taking another look?
Screenshot 2020-12-02 at 17 05 01

Copy link
Contributor

@katrin-freihofner katrin-freihofner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thank you.

Copy link
Contributor

@phillipb phillipb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Metrics stuff looks good. Thanks!

@weltenwort
Copy link
Member

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
infra 1084 1085 +1

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
infra 2.7MB 2.7MB +2.2KB

Distributable file count

id before after diff
default 46960 47720 +760

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

Copy link
Member

@weltenwort weltenwort left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simple and clean, LGTM

Comment on lines +16 to +25
export const HeaderActionMenuProvider: React.FC<Required<ContextProps>> = ({
setHeaderActionMenu,
children,
}) => {
return (
<HeaderActionMenuContext.Provider value={{ setHeaderActionMenu }}>
{children}
</HeaderActionMenuContext.Provider>
);
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the purpose of wrapping the provider in another component? Could <HeaderActionMenuContext.Provider just be used directly?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a way to abstract the value away into a meaningful name.

I think moving forward it would be interesting to add an InfraContext that holds all of these little things instead of having 3-4 wrappers, but that's a story for another PR.

@afgomez afgomez merged commit f31e7c8 into elastic:master Dec 9, 2020
@afgomez afgomez deleted the 82823-infra-header-actions branch December 9, 2020 12:43
jloleysens added a commit to jloleysens/kibana that referenced this pull request Dec 9, 2020
…k-field-to-hot-phase

* 'master' of github.com:elastic/kibana: (429 commits)
  simplify popover open state logic (elastic#85379)
  [Logs UI][Metrics UI] Move actions to the kibana header (elastic#84648)
  [Search Source] Do not pick scripted fields if * provided (elastic#85133)
  [Search] Session SO polling (elastic#84225)
  [Transform] Replace legacy elasticsearch client (elastic#84932)
  [Uptime]Refactor header and action menu (elastic#83779)
  Fix agg select external link (elastic#85380)
  [ILM] Show forcemerge in hot when rollover is searchable snapshot is enabled (elastic#85292)
  clear using keyboard (elastic#85042)
  [GS] add tag and dashboard suggestion results (elastic#85144)
  [ML] API integration tests - skip GetAnomaliesTableData
  Add ECS field for event.code. (elastic#85109)
  [Functional][TSVB] Wait for markdown textarea to be cleaned (elastic#85128)
  skip flaky suite (elastic#62060)
  skip flaky suite (elastic#85098)
  Bump highlight.js to v9.18.5 (elastic#84296)
  Add `server.publicBaseUrl` config (elastic#85075)
  [Alerting & Actions ] More debug logging (elastic#85149)
  [Security Solution][Case] Manual attach alert to a case (elastic#82996)
  Loosen UUID regex to accept uuidv1 or uuidv4 (elastic#85338)
  ...

# Conflicts:
#	x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/edit_policy.helpers.tsx
#	x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/hot_phase/hot_phase.tsx
#	x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/shared_fields/index.ts
#	x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/warm_phase/warm_phase.tsx
#	x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/edit_policy.tsx
#	x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/i18n_texts.ts
#	x-pack/plugins/index_lifecycle_management/server/routes/api/policies/register_create_route.ts
afgomez pushed a commit that referenced this pull request Dec 9, 2020
#85416)

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Logs UI Logs UI feature Feature:Metrics UI Metrics UI feature release_note:skip Skip the PR/issue when compiling release notes Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services v7.11.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Logs & Metrics UI] Consistent menu options utilizing the new header in Kibana
6 participants