-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[SIEM] Start of deprecated lifecycle refactor #46293
[SIEM] Start of deprecated lifecycle refactor #46293
Conversation
Pinging @elastic/siem |
Hi @stephmilovic, we have found your signature in our records, but it seems like you have signed with a different e-mail than the one used in your Git commit. Can you please add both of these e-mails into your Github profile (they can be hidden), so we can match your e-mails to your Github profile? |
💔 Build Failed |
x-pack/legacy/plugins/siem/public/components/auto_sizer/index.tsx
Outdated
Show resolved
Hide resolved
x-pack/legacy/plugins/siem/public/components/auto_sizer/index.tsx
Outdated
Show resolved
Hide resolved
x-pack/legacy/plugins/siem/public/components/auto_sizer/index.tsx
Outdated
Show resolved
Hide resolved
x-pack/legacy/plugins/siem/public/components/auto_sizer/index.tsx
Outdated
Show resolved
Hide resolved
x-pack/legacy/plugins/siem/public/components/auto_sizer/index.tsx
Outdated
Show resolved
Hide resolved
jenkins, test it |
💔 Build Failed |
💔 Build Failed |
💚 Build Succeeded |
x-pack/legacy/plugins/siem/public/components/auto_sizer/index.tsx
Outdated
Show resolved
Hide resolved
x-pack/legacy/plugins/siem/public/components/edit_data_provider/index.tsx
Outdated
Show resolved
Hide resolved
x-pack/legacy/plugins/siem/public/components/edit_data_provider/index.tsx
Outdated
Show resolved
Hide resolved
x-pack/legacy/plugins/siem/public/components/event_details/stateful_event_details.tsx
Outdated
Show resolved
Hide resolved
x-pack/legacy/plugins/siem/public/components/event_details/stateful_event_details.tsx
Outdated
Show resolved
Hide resolved
@@ -20,8 +20,17 @@ jest.mock('../../lib/settings/use_kibana_ui_setting'); | |||
|
|||
const from = 1566943856794; | |||
const to = 1566857456791; | |||
|
|||
// Suppress warnings about "act" until async/await syntax is supported: https://github.com/facebook/react/issues/14769 |
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.
we might need to do something global instead of doing it for every single test files
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.
Agreed, I created a new issue for this #46469
x-pack/legacy/plugins/siem/public/components/fields_browser/field_browser.tsx
Show resolved
Hide resolved
x-pack/legacy/plugins/siem/public/components/fields_browser/index.tsx
Outdated
Show resolved
Hide resolved
💚 Build Succeeded |
💚 Build Succeeded |
💚 Build Succeeded |
💚 Build Succeeded |
} | ||
} | ||
export const HelpMenuComponent = React.memo(() => { | ||
return ( |
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 - you do not even need the return
💚 Build Succeeded |
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, I tested locally and I reviewed the code. With this PR we will be in better shape when we moved to a more hooks way app. @stephmilovic I Appreciate all the work and fix that you/we encounter during the review process.
- stephs edit, more bugs :(
💚 Build Succeeded |
We found more bugs, @steph and I agree to more testing to make sure that we won't break anything with this PR
💔 Build Failed |
💔 Build Failed |
💚 Build Succeeded |
💚 Build Succeeded |
💔 Build Failed |
retest |
After much pain, |
💚 Build Succeeded |
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
I re-tested locally, I did not see any errors
💔 Build Failed |
💚 Build Succeeded |
Summary
Resolves https://github.com/elastic/siem-team/issues/456
This PR refactors many many components from
PureComponent
tomemo
. We have been having unintentional side effects in some of our render phase lifecycle methods. This PR removes a few effects that we caught including:componentWillMount in navigation/index.tsx
componentWillReceiveProps in navigation/index.tsx
componentWillReceiveProps in tab_navigation/index.tsx
It also begins a refactor to remove any lifecycle methods and replace with hooks. I had to cut myself off, and will continue in a new PR as some of the components I have my eye to refactor are a bit complicated and this PR is already quite large. The PR also removes
LoadMoreTable
as it is no longer in use.Please thoroughly test, manually and with Cypress. This doesn't change functionality, just updated syntax and reduced renders. Refactored components include:
AddToKqlComponent
AutoSizer
DataDrivenColumns
DeleteTimelineModalButton
DragDropContextWrapperComponent
DraggableWrapperComponent
FieldsBrowser
FlyoutPaneComponent
Footer
(timeline)Header
(timeline column)HelpMenuComponent
HostsFilterComponent
HostsTableComponent
KueryAutocompletion
LastUpdatedAt
LazyAccordion
NetworkFilterComponent
NetworkTopNFlowTableComponent
NoteCards
Notes
OpenTimelineModalButton
PagingControl
Properties
ProviderItemBadge
Resizeable
SiemNavigationComponent
StatefulBodyComponent
StatefulEditDataProvider
StatefulEvent
StatefulEventDetails
StatefulFieldsBrowserComponent
StatefulSearchOrFilterComponent
StatefulTimelineComponent
SuperDatePickerComponent
TabNavigation
WithHoverActions
Remaining refactors will take place in the following issues:
Checklist
Use
strikethroughsto remove checklist items you don't feel are applicable to this PR.For maintainers