-
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
[Security Solution][Timeline] extract and cleanup timeline status component #173876
[Security Solution][Timeline] extract and cleanup timeline status component #173876
Conversation
1623521
to
04e9684
Compare
export const TimelineSaveStatus = React.memo<TimelineSaveStatusProps>(({ timelineId }) => { | ||
const getTimeline = useMemo(() => timelineSelectors.getTimelineByIdSelector(), []); | ||
const { | ||
changed = false, |
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.
I feel like we should initialize this to false in redux. I know you didn't change anything functionally here, but making a note that can be brought up as a potential redux cleanup in the future
status, | ||
updated, | ||
} = useDeepEqualSelector((state) => | ||
pick(['changed', 'status', 'updated'], getTimeline(state, timelineId) ?? timelineDefaults) |
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.
Thinking through things, we need to make better use of selectors because we shouldn't need to use pick
, but that's a whoooole separate issue
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.
yeah I'm not a fan of how it's done here, but it's consistent with the other places... I agree a nice cleanup to bring the code up to the latest redux standards would be really nice! Maybe a future refactor I'll tackle :)
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.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.
Thanks reminded me of something to test and found a bug, not related to this PR here 😅 #173968
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.
Nice work, pulled down and tested as well. Thanks for the cleanup and updating the jest tests!
04e9684
to
a9f1a18
Compare
💚 Build Succeeded
Metrics [docs]Async chunks
History
To update your PR or re-run it, just comment with: |
Notes
This PR is part of a long-running effort to clean up the timeline code. I originally had opened this one but the file count kept growing and so did the complexity for the reviewers. Of that original PR I will create probably 5-6 smaller ones.
Summary
This very PR focuses on extracting the TimelineStatusInfo component:
save_status
andTimelineSaveStatus
respectively to better represent what the component actually doesAbsolutely no visual or behavior changes introduced here!
Checklist
The following PR will extract the
FlyoutComponent
component.