-
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
[ML] Migrates Anomaly Explorer Swimlanes to React #22641
Conversation
Pinging @elastic/ml-ui |
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
|
||
// Listen for dragSelect events | ||
const that = this; | ||
this.dragSelectListener = function ({ action, elements = [] }) { |
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.
if these were converted to arrow functions you should mean the assignment of that
could be removed.
cellClick
could also be made a method and an arrow function.
probably not for this PR, but maybe a future refactor
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.
thanks, took a note in #22642
@@ -443,7 +72,6 @@ module.directive('mlExplorerSwimlane', function ($compile, Private, mlExplorerDa | |||
chartWidth: '=', | |||
appState: '=' | |||
}, | |||
link: link, | |||
template: template | |||
link: link |
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.
nit, could be just link
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 - just some comments about comments, and a suggestion for the follow-up PR.
* React component for rendering Explorer dashboard swimlanes. | ||
*/ | ||
|
||
//import PropTypes from 'prop-types'; |
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.
Can this commented out line be removed?
// Listen for dragSelect events | ||
const that = this; | ||
this.dragSelectListener = function ({ action, elements = [] }) { | ||
if (action === 'newSelection' && elements.length > 0) { |
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.
These action 'types' could be moved into constants - either at the top of the file or a separate file
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.
Thanks, took a note in the follow-up issue: #22642
class: 'lane', | ||
}); | ||
|
||
//$lane.on('mouseover', cellMouseover); |
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.
Can these commented out lines be removed?
💔 Build Failed |
💚 Build Succeeded |
- This PR migrates the Anomaly Explorer Swimlanes from angularjs to React. - The approach is similar to the one from elastic#22622: Try to refactor as little of the actual logic as possible, just make sure everything works inside the React component lifecycle. So as a guide for the review: No actual code within all the functions/methods changed, only the bits and pieces which needed to be tied into the React component lifecycle. - The remaining wrapping angular directive is now only listening for data changes and passes its scope and other necessary data on as props to the React component.
- This PR migrates the Anomaly Explorer Swimlanes from angularjs to React. - The approach is similar to the one from #22622: Try to refactor as little of the actual logic as possible, just make sure everything works inside the React component lifecycle. So as a guide for the review: No actual code within all the functions/methods changed, only the bits and pieces which needed to be tied into the React component lifecycle. - The remaining wrapping angular directive is now only listening for data changes and passes its scope and other necessary data on as props to the React component.
This PR migrates the Anomaly Explorer Swimlanes from angularjs to React.
The approach is similar to the one from #22622: Try to refactor as little of the actual logic as possible, just make sure everything works inside the React component lifecycle. So as a guide for the review: No actual code within all the functions/methods changed, only the bits and pieces which needed to be tied into the React component lifecycle.
The remaining wrapping angular directive is now only listening for data changes and passes its scope and other necessary data on as props to the React component.