-
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] Cases UI Plugin for RAC #97646
Conversation
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.
limits.yml LGTM
* 2.0. | ||
*/ | ||
|
||
export * from './test_providers'; |
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.
What about match_media
and kibana_react.mock.ts
(if needed. See my comment below)
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.
there's no modules exported from match_media. it is a window mock, all you need to do is import like import '../../common/mock/match_media';
@@ -73,6 +73,7 @@ export const addDescriptionToTimeline = (description: string) => { | |||
|
|||
export const addNameToTimeline = (name: string) => { | |||
cy.get(TIMELINE_EDIT_MODAL_OPEN_BUTTON).first().click(); | |||
// cy.log('HERE:', cy.get(TIMELINE_TITLE_INPUT)); |
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.
Why is commented out?
getDefaultEuiMarkdownParsingPlugins, | ||
getDefaultEuiMarkdownProcessingPlugins, | ||
getDefaultEuiMarkdownUiPlugins, | ||
} from '@elastic/eui'; | ||
|
||
// Remove after this issue is resolved: https://github.com/elastic/eui/issues/4688 |
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.
The issue seems to be resolved.
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.
its not merged into kibana yet i dont think
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.
jk it is there now, ill remove it
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.
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.
@chandlerprall says:
we'll cut a release tomorrow with that change, and depending on Greg's availability we'll get a Kibana upgrade started this week or next
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 see. No worries!
export const { uiPlugins, parsingPlugins, processingPlugins } = { | ||
uiPlugins: getDefaultEuiMarkdownUiPlugins(), | ||
parsingPlugins: getDefaultEuiMarkdownParsingPlugins(), | ||
processingPlugins: getDefaultEuiMarkdownProcessingPlugins() as [ |
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.
Why we need to cast it?
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.
there was this but removing now elastic/eui#4688
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.
|
||
import { FunctionComponent } from 'react'; | ||
import { Plugin, PluggableList } from 'unified'; | ||
// Remove after this issue is resolved: https://github.com/elastic/eui/issues/4688 |
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.
The issue seems to be resolved.
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.
see #97646 (comment)
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.
Amazing PR! Thank you both for your hard work 🚀 . Code LTGM!
I manually tested the PR and I found the following:
- Some API calls are being done twice. This probably means that an unnecessary render is being made somewhere. Specifically:
Single case view:
Creation / Single case view (?):
All cases view:
- I attach an alert to a case but I cannot see the investigate in timeline action
- If I open the timeline the title of the case in the breadcrumb is not displayed (Mike)
- All cases modal bug when attaching a timeline to a case. This is happening if I am in the all pages view. If I am in the single case view it is not happening. (this is @stephmilovic commenting -> cant reproduce this either?!)
timeline_bug.mp4
- Attach to an existing case is not working (this is @stephmilovic commenting -> i cannot reproduce this?!)
attach_to_case.mp4
- Attach to a new case freezes Kibana as it does an infinitive loop (Mike). This is a know issue: [Security Solution][Timeline] Attach timeline to case freezes kibana #84013
attach_to_new_case.mp4
This commit fixes the below issue: b5d3932
|
This commit: f5fa7f1 fixes:
|
This commit: |
@@ -38,6 +38,18 @@ interface AddToCaseActionProps { | |||
ecsRowData: Ecs; | |||
} | |||
|
|||
interface PostCommentArg { | |||
caseId: string; | |||
data: { |
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.
Not sure if it's worth it or not (or if it causes a circular dependency) but we might be able to pull the data
type from the case common 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.
Yea, was trying to avoid a circular dependency when I tossed this together, but thinking about it more, since cases doesn't depend on Security Solution, it shouldn't be
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.
🚀
💚 Build Succeeded
Metrics [docs]Module Count
Public APIs missing comments
Async chunks
Public APIs missing exports
Page load bundle
Unknown metric groupsAPI count
async chunk count
History
To update your PR or re-run it, just comment with: |
Summary
Cases UI plugin for RAC by @michaelolo24 && @stephmilovic
Feature branch, all code has been reviewed in subsequent PRs (see label Feature:Cases-RAC-UI)
Testing
Considering the size of this PR, those who may not be intimately familiar with cases may not be able to go through and review the lines of code. With that said no new functionality has been introduced, so everything should work as it earlier versions of cases. To help with testing we ask that you pull down the code at physically test the following paths/actions
This PR adds the following UI plugin to
x-pack/cases
:Cases UI
Embed Cases UI components in any Kibana plugin
CasesUiStart
to Kibana pluginStartServices
dependencies:Cases UI Methods
useKibana
hook start servicesMethods:
getAllCases
Arguments:
CasesNavigation<CaseDetailsHrefSchema, 'configurable'>
route configuration to generate the case details url for the case details pageCasesNavigation
route configuration for configure cases pageCasesNavigation
route configuration for create cases pageboolean;
user permissions to crudUI component:
getAllCasesSelectorModal
Arguments:
Omit<CommentRequestAlertType, 'type'>;
alert data to post to caseCasesNavigation
route configuration for create cases pageCaseStatuses[];
array of disabled statuses(theCase?: Case | SubCase) => void;
callback for row click, passing case in row(theCase: Case | SubCase) => void;
callback after case has been updatedboolean;
user permissions to crudUI component:
getCaseView
Arguments:
CasesNavigation<CaseDetailsHrefSchema, 'configurable'>
route configuration to generate the case details url for the case details pagestring;
ID of the caseCasesNavigation
route configuration for configure cases pageCasesNavigation
route configuration for create cases page(commentId: string) => string;
callback to generate the case details url with a comment id reference from the case id and comment id() => void;
callback when component has initialized(data: Case) => void;
optional callback to handle case data in consuming applicationCasesNavigation<string | null | undefined, 'configurable'>
(alertId: string, index: string) => void;
callback to show alert detailsstring;
subcase idPlugin;
React.FC<TimelineProcessingPluginRendererProps & { position: EuiMarkdownAstNodePosition }>
EuiMarkdownEditorUiPlugin
(value: string, onChange: (newValue: string) => void): UseInsertTimelineReturn
(alertIds: string[]) => JSX.Element;
space to renderInvestigateInTimelineActionComponent
() => JSX.Element;
space to renderTimelineDetailsPanel
(alertIds: string[]) => [boolean, Record<string, Ecs>];
fetch alertsboolean;
user permissions to crudUI component:
getCreateCase
Arguments:
(theCase: Case) => Promise<void>;
callback passing newly created case before pushCaseToExternalService is called() => void;
callback when create case is canceled(theCase: Case) => Promise<void>;
callback passing newly created case after pushCaseToExternalService is calledPlugin;
React.FC<TimelineProcessingPluginRendererProps & { position: EuiMarkdownAstNodePosition }>
EuiMarkdownEditorUiPlugin
(value: string, onChange: (newValue: string) => void): UseInsertTimelineReturn
UI component:
getConfigureCases
Arguments:
boolean;
user permissions to crudUI component:
getRecentCases
Arguments:
CasesNavigation
route configuration for configure cases pageCasesNavigation<CaseDetailsHrefSchema, 'configurable'>
route configuration to generate the case details url for the case details pageCasesNavigation
route configuration for create case pagenumber;
number of cases to show in widgetUI component: