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

[Graph] Deangularize graph app controller #106587

Merged
merged 45 commits into from
Aug 31, 2021

Conversation

dimaanj
Copy link
Contributor

@dimaanj dimaanj commented Jul 22, 2021

Part of #91128

Summary

Implementation notes

  • The main mutable workspace object stored in the react ref
  • After each action on worksapce, react render should be forced. It's done via updating renderCounter and providing it to components which needs update.
  • asSyncedObservable still needed, since some of the workspace internals should be provided to mounted <Settings /> overlay. It should be removed after migrating thouse worksapce stuff to redux

Testing notes

  • Field actions (select/deselect, disable, change settings)
  • Control panel actions
  • TopNavMenu options: new, save, inspect panel and settings (advanced settings, block list, drill downs)
  • Graph nodes/edges selection actions
  • Open a new/existing workspace via URL with/without query param
  • Readonly graph

@dimaanj dimaanj added Feature:Graph Graph application feature Team:Visualizations Visualization editors, elastic-charts and infrastructure v8.0.0 release_note:skip Skip the PR/issue when compiling release notes v7.15.0 labels Jul 22, 2021
@dimaanj dimaanj requested review from timroes and majagrubic July 22, 2021 18:14
@dimaanj dimaanj self-assigned this Jul 22, 2021
@dimaanj dimaanj requested a review from kertal July 26, 2021 07:58
@dimaanj
Copy link
Contributor Author

dimaanj commented Jul 26, 2021

@elasticmachine merge upstream

@dimaanj dimaanj changed the title [Graph] Deangularize control panel [Graph] Deangularize control panel & main controller Jul 26, 2021
dimaanj added 2 commits July 26, 2021 16:52
…e-angular-from-control-panel

# Conflicts:
#	x-pack/plugins/graph/public/app.js
@dimaanj
Copy link
Contributor Author

dimaanj commented Jul 30, 2021

@elasticmachine merge upstream

@dimaanj
Copy link
Contributor Author

dimaanj commented Aug 15, 2021

@elasticmachine merge upstream

@dimaanj
Copy link
Contributor Author

dimaanj commented Aug 30, 2021

@elasticmachine merge upstream

Copy link
Contributor

@dej611 dej611 left a comment

Choose a reason for hiding this comment

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

Clicking on New workspace now leads to the Graph main index page rather than creating a new workspace ❌ - blocker?

Can still reproduce this one.

There are also some design regressions:

  • when configuring the initial data source for the graph, the scroll bar appears now (only in Safari). FF and Chrome are ok. (probably blocker?)

  • The "quick selection"s button pills are more "compact" compared to the previous implementation (no blocker)

@dimaanj dimaanj requested a review from dej611 August 30, 2021 11:17
Copy link
Contributor

@dej611 dej611 left a comment

Choose a reason for hiding this comment

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

Left few minor nitpick comments, but generally ok with the content. 👍

@kertal
Copy link
Member

kertal commented Aug 31, 2021

@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
graph 157 167 +10

Async chunks

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

id before after diff
graph 1.1MB 656.8KB -500.9KB

Page load bundle

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

id before after diff
graph 11.5KB 11.1KB -367.0B
Unknown metric groups

References to deprecated APIs

id before after diff
graph 65 97 +32

History

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

cc @dmitriynj

@kertal kertal self-requested a review August 31, 2021 14:09
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.

!!!
Bildschirmfoto 2021-08-31 um 16 09 53
Did another quick check in Firefox, Chrome, Safari, everything works as expected. Great work! 👍

@@ -21,6 +21,7 @@
*/

.gphNoUserSelect {
padding-right: $euiSizeXS;
Copy link
Contributor

Choose a reason for hiding this comment

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

I see this adds a bit of padding to the

node labels, but it's not clear what problem this addresses. Out of curiosity, was there a particular situation that led to this addition?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I guess it was mistakenly leaved and can be removed in a follow up PR.

Copy link
Contributor

@ryankeairns ryankeairns left a comment

Choose a reason for hiding this comment

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

Minor CSS considerations.
We could do a larger style pass in the future.

@@ -24,6 +24,10 @@
padding: $euiSizeXS;
border-radius: $euiBorderRadius;
margin-bottom: $euiSizeXS;

& > span {
Copy link
Contributor

Choose a reason for hiding this comment

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

As a general practice, we tend to not target elements directly using a plain element selector. Instead, we prefer to target a class which in this case seems possible via .kuiIcon (class on the span).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you, let's fix it in follow up PR.

@dimaanj dimaanj merged commit 3f7c461 into elastic:master Aug 31, 2021
dimaanj added a commit to dimaanj/kibana that referenced this pull request Aug 31, 2021
* [Graph] deaungularize control panel

* [Graph] move main graph directive to react

* [Graph] refactoring

* [Graph] remove redundant memoization, update import

* [Graph] fix settings menu, clean up the code

* [Graph] fix graph settings

* [Graph] code refactoring, fixing control panel render issues

* [Graph] fix small mistake

* [Graph] rename components

* [Graph] fix imports

* [Graph] fix graph search and inspect panel

* [Graph] remove redundant types

* [Graph] fix problem with selection list

* [Graph] fix functional test which uses selection list

* [Graph] fix unit tests, update types

* [Graph] fix types

* [Discover] fix url queries

* [Graph] fix types

* [Graph] add react router, remove angular stuff

* [Graph] fix styles

* [Graph] fix i18n

* [Graph] fix navigation to a new workspace creation

* [Graph] fix issues from comments

* [Graph] add suggested changed

* Update x-pack/plugins/graph/public/components/graph_visualization/graph_visualization.tsx

Co-authored-by: Marco Liberati <[email protected]>

* [Graph] remove brace lib from imports

* [Graph] fix url navigation between workspaces, fix types

* [Graph] refactoring, fixing url issue

* [Graph] update graph dependencies

* [Graph] add comments

* [Graph] fix types

* [Graph] fix new button, fix control panel styles

* [Graph] apply suggestions

Co-authored-by: Kibana Machine <[email protected]>
Co-authored-by: Marco Liberati <[email protected]>
dimaanj added a commit that referenced this pull request Aug 31, 2021
* [Graph] deaungularize control panel

* [Graph] move main graph directive to react

* [Graph] refactoring

* [Graph] remove redundant memoization, update import

* [Graph] fix settings menu, clean up the code

* [Graph] fix graph settings

* [Graph] code refactoring, fixing control panel render issues

* [Graph] fix small mistake

* [Graph] rename components

* [Graph] fix imports

* [Graph] fix graph search and inspect panel

* [Graph] remove redundant types

* [Graph] fix problem with selection list

* [Graph] fix functional test which uses selection list

* [Graph] fix unit tests, update types

* [Graph] fix types

* [Discover] fix url queries

* [Graph] fix types

* [Graph] add react router, remove angular stuff

* [Graph] fix styles

* [Graph] fix i18n

* [Graph] fix navigation to a new workspace creation

* [Graph] fix issues from comments

* [Graph] add suggested changed

* Update x-pack/plugins/graph/public/components/graph_visualization/graph_visualization.tsx

Co-authored-by: Marco Liberati <[email protected]>

* [Graph] remove brace lib from imports

* [Graph] fix url navigation between workspaces, fix types

* [Graph] refactoring, fixing url issue

* [Graph] update graph dependencies

* [Graph] add comments

* [Graph] fix types

* [Graph] fix new button, fix control panel styles

* [Graph] apply suggestions

Co-authored-by: Kibana Machine <[email protected]>
Co-authored-by: Marco Liberati <[email protected]>

Co-authored-by: Kibana Machine <[email protected]>
Co-authored-by: Marco Liberati <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Graph Graph application feature release_note:skip Skip the PR/issue when compiling release notes Team:Visualizations Visualization editors, elastic-charts and infrastructure v7.16.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants