-
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][Cases] Re-enable timeline functionality #96496
Merged
michaelolo24
merged 8 commits into
elastic:cases_rac_ui
from
michaelolo24:finish_timeline_integration
Apr 13, 2021
Merged
Changes from 6 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
06ce43b
add timeline functionality
michaelolo24 b83bbcc
remove redundant import
michaelolo24 2cbee21
hype type
michaelolo24 71d0652
pr updates
michaelolo24 fb6d973
reverted sort updated at
michaelolo24 94a75a1
change updatedAt to createdAt in test
michaelolo24 3339aad
Merge branch 'cases_rac_ui' into finish_timeline_integration
michaelolo24 31b7f5b
re-add accidentally removed prop
michaelolo24 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
x-pack/plugins/cases/public/components/__mock__/timeline.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
import React from 'react'; | ||
import { useTimelineContext } from '../timeline_context/use_timeline_context'; | ||
jest.mock('../timeline_context'); | ||
|
||
const mockTimelineComponent = (name: string) => <span data-test-subj={name}>{name}</span>; | ||
|
||
export const timelineIntegrationMock = { | ||
editor_plugins: { | ||
parsingPlugin: jest.fn(), | ||
processingPluginRenderer: () => mockTimelineComponent('plugin-renderer'), | ||
uiPlugin: { | ||
name: 'mock-timeline', | ||
button: { label: 'mock-timeline-button', iconType: 'mock-timeline-icon' }, | ||
editor: () => mockTimelineComponent('plugin-timeline-editor'), | ||
}, | ||
}, | ||
hooks: { | ||
useInsertTimeline: jest.fn(), | ||
}, | ||
ui: { | ||
renderInvestigateInTimelineActionComponent: () => | ||
mockTimelineComponent('investigate-in-timeline'), | ||
renderTimelineDetailsPanel: () => mockTimelineComponent('timeline-details-panel'), | ||
}, | ||
}; | ||
|
||
export const useTimelineContextMock = useTimelineContext as jest.Mock; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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'm wondering if we should only render the
CasesTimelineIntegrationProvider
iftimelineIntegration
exists? I know you have the logic further down the line, but why go further down the line if we knowtimelineIntegration
does not exist?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.
Because
InsertTimeline
always needs it? should we have a boolean where InsertTimeline is to render it or not depending on thetimelineIntegration
props? or is it simpler just to keep it as isThere 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.
No it would still work without the provider since all the
useTimelineContext()
's can be the default value of null. So I could do something like below and it would still work, but nothing would really be functionally different. The only difference would beCasesTimelineIntegrationContext
not showing up in the tree anymore. It may be simpler to just keep it as is for now?useTimelineContext
is used forInsertTimeline
, but also all the editor plugin stuff, and the renderInvestigateInTimeline and renderTimelineDetailsPanel logic. Ideally once the timeline plugin is done we can just nuke all of that stuff. You can test it out by just setting the useState here to null:https://github.com/elastic/kibana/pull/96496/files/94a75a11d4240237d5225db9ea8d1fb81591996d#diff-9610a1614eed5937c6929340eb693370c84e283a021bf51217b49bc477e1ffecR58
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 went in an passed null from create to see. im good w this