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

[Discover] Deangularize navbar in context app #86353

Merged
merged 8 commits into from
Jan 4, 2021

Conversation

majagrubic
Copy link
Contributor

@majagrubic majagrubic commented Dec 17, 2020

Summary

The remaining piece of deangularizing context app. TopNavMenu is now a React component, rendered inside ContextAppLegacy component. The angular directive is gone 🎉

Tested in Chrome and Firefox.

Checklist

Delete any items that are not applicable to this PR.

- [x] Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n support
- [x] Documentation was added for features that require explanation or tutorials

For maintainers

@majagrubic majagrubic changed the title [Discover] Deangualrize navbar in context [Discover] Deangualrize navbar in context app Dec 17, 2020
@majagrubic majagrubic changed the title [Discover] Deangualrize navbar in context app [Discover] Deangularize navbar in context app Dec 18, 2020
@majagrubic majagrubic marked this pull request as ready for review December 18, 2020 07:22
@majagrubic majagrubic requested a review from a team December 18, 2020 07:22
@majagrubic majagrubic requested a review from a team as a code owner December 18, 2020 07:22
@majagrubic majagrubic requested review from kertal and lizozom December 18, 2020 07:22
@majagrubic
Copy link
Contributor Author

@elasticmachine merge upstream

Copy link
Member

@kertal kertal left a comment

Choose a reason for hiding this comment

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

Great that we soon can remove another brick in the angular directive wall. LGTM, except there seems to be a new error in console that should be investigated:

Bildschirmfoto 2020-12-21 um 09 02 04

@majagrubic
Copy link
Contributor Author

majagrubic commented Dec 21, 2020

@kerta Fixed! (I think 😬 )

@majagrubic
Copy link
Contributor Author

@elasticmachine merge upstream

Copy link
Member

@kertal kertal left a comment

Choose a reason for hiding this comment

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

Code LGTM 👍 , tested locally in Chrome, Firefox, Safari, no warnings, works as expected


import React from 'react';

export const TopNavMenuMock = () => <div>Hello World</div>;
Copy link
Member

Choose a reason for hiding this comment

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

🌍 : hi @majagrubic

@@ -71,19 +71,27 @@ export function FilterItem(props: Props) {

useEffect(() => {
const index = props.filter.meta.index;
let isSubscribed = true;
Copy link
Member

Choose a reason for hiding this comment

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

yes, no more warning in the console! however we need to take care of rerendering of this component in a follow up PR, which is I think the reason of the former warning.

Copy link
Contributor Author

@majagrubic majagrubic Dec 22, 2020

Choose a reason for hiding this comment

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

I think the reason for the warning was that getIndexPatterns is an async task, so once it's done it tries to update the state of the component, but the component has been unmounted already. The cleanup will run once the component is unmounted, cleanup will unset the flag, which will prevent subsequent updates to the state. This code is not in any way tampering with the lifecycle of the component. The only question here is if there's a more sophisticated way to get this, beyond plain flag setting, but I'll defer this decision to component owners.

Copy link
Contributor

@lizozom lizozom left a comment

Choose a reason for hiding this comment

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

Tested on Chrome.
LGTM

@lizozom
Copy link
Contributor

lizozom commented Jan 3, 2021

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

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

id before after diff
data 270.8KB 270.9KB +105.0B
discover 502.3KB 502.3KB -56.0B
total +49.0B

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
navigation 20.0KB 20.0KB +92.0B

History

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

@majagrubic majagrubic merged commit 8d2e51d into elastic:master Jan 4, 2021
@majagrubic majagrubic deleted the deangularize-navbar branch January 4, 2021 07:41
jloleysens added a commit to jloleysens/kibana that referenced this pull request Jan 4, 2021
…meline-component

* 'master' of github.com:elastic/kibana: (955 commits)
  remove SameSite:None workaround (elastic#86994)
  URL encoding for URL drilldown (elastic#86902)
  [Security Solution] Fix few styling issues (elastic#87045)
  [APM] Custom links can still be created with a read only user. (elastic#87089)
  prevent double update (elastic#86794)
  Upgrade @hapi/hoek to revert hack introduced in hapi v20 upgrade (elastic#87113)
  [APM] Every time the new Header Icon is clicked it fetches data (elastic#87093)
  [APM] Add range query to service map trace walk (elastic#86631)
  [Discover] Deangularize navbar in context app (elastic#86353)
  skip "should schedule actions on legacy alerts" elastic#87010
  🍾 update notice text for 2021
  [logstash] remove "upgrade" functionality now that .logstash is a system index (elastic#87056)
  Enable prototype pollution protection in TSVB (elastic#85952)
  [Security Solution] add a consistent spelling of ES in Policy Response (elastic#87073)
  [SECURITY_SOLUTION][ENDPOINT] Delete Endpoint Policy List code (elastic#87063)
  Adds more URLs to the docs links service (elastic#86972)
  Add missing backticks in reporting-settings.asciidoc (elastic#77979)
  [test/functional_cors] 9000 is sometimes in use, make getPort random (elastic#87050)
  [Security Solution] Fix Timeline filter EuiSuperSelect styling (elastic#87033)
  [Lens] Fix duplicate suggestions on single-bucket charts (elastic#86996)
  ...

# Conflicts:
#	x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/index.ts
majagrubic pushed a commit that referenced this pull request Jan 4, 2021
* [Discover] Deangualrize navbar in context

* Remove directive

* Updating a unit test

* Updating a unit test

* Add cleanup in FilterItem component

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants