-
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
[Stack monitoring] Convert Angular views to React #111309
Comments
Pinging @elastic/logs-metrics-ui (Team:logs-metrics-ui) |
For anyone picking up new views to migrate, here's a how-to: How to see the react appThe react app is toggled on by flipping a config flag here:
default_value for testing if that's easier, but don't check it in obviously.
Folder StructureAll the angular views/routes are nested under: https://github.com/elastic/kibana/tree/4584a8b570402aa07832cf3e5b520e5d2cfa7166/x-pack/plugins/monitoring/public/views The new react pages are nested under: https://github.com/elastic/kibana/tree/a949cc8121c37a799ed3655a8612ac6052b263a6/x-pack/plugins/monitoring/public/application/pages When picking up a new group of views to port over, you'll start by creating a new directory under Create a new PageTemplate if it doesn't existThe page template is where all the navigation for the group of pages is defined. The angular equivalent is defined in main monitoring directive. This directive is a master template for all of stack monitoring and it turns on/off tabs in the navigation based on what module the user is viewing. Angular kibana/x-pack/plugins/monitoring/public/directives/main/index.html Lines 31 to 114 in c07a512
React kibana/x-pack/plugins/monitoring/public/application/pages/elasticsearch/elasticsearch_template.tsx Lines 18 to 67 in a949cc8
Create a route for the pageAdd a Angular kibana/x-pack/plugins/monitoring/public/views/elasticsearch/overview/index.js Lines 14 to 24 in 4584a8b
React kibana/x-pack/plugins/monitoring/public/application/index.tsx Lines 88 to 93 in a63b0b9
Create a react component that is the equivalent to the angular controller you're trying to replaceIn stack monitoring, the angular controllers are responsible for fetching data and passing it into the react components. We need to replace those controllers with react components. The key function to look for in angular is Angular: kibana/x-pack/plugins/monitoring/public/views/elasticsearch/nodes/index.js Lines 40 to 147 in bc25c0f
React: kibana/x-pack/plugins/monitoring/public/application/pages/elasticsearch/nodes_page.tsx Lines 26 to 102 in 54cc2ba
|
Probably I'm not saying anything new here, but I find it easier to have this line |
I think we're all set here folks. See #109791 for next steps. |
|
Initial pre-requisite work, to be completed by Sep 10
Parallel work, stage 1 (complete by Sep 16)
Parallel work, stage 2 (complete by Oct 1)
Parallel work, stage 3 (complete by Oct 7)
Parallel work, stage 4 (completed by Oct 15)
NOTE: "Internal collection detected" warning doesn't have to be migrated #111629
Tech debt #112512
The text was updated successfully, but these errors were encountered: