-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Endpoint] add resolver middleware (#58288)
* Add resolver middleware * Update types to match events, use sample events in useCamera tests * add predicate to convert alertdata to legacy endpoint event * Use mock event generator in tests * Guard against events not having agent or endpoint fields Co-authored-by: Robert Austin <[email protected]>
- Loading branch information
1 parent
b5dd99c
commit a3be4e2
Showing
30 changed files
with
578 additions
and
301 deletions.
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
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
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
35 changes: 35 additions & 0 deletions
35
x-pack/plugins/endpoint/public/applications/endpoint/view/alerts/resolver.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,35 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import React from 'react'; | ||
import styled from 'styled-components'; | ||
import { Provider } from 'react-redux'; | ||
import { useKibana } from '../../../../../../../../src/plugins/kibana_react/public'; | ||
import { Resolver } from '../../../../embeddables/resolver/view'; | ||
import { EndpointPluginServices } from '../../../../plugin'; | ||
import { LegacyEndpointEvent } from '../../../../../common/types'; | ||
import { storeFactory } from '../../../../embeddables/resolver/store'; | ||
|
||
export const AlertDetailResolver = styled( | ||
React.memo( | ||
({ className, selectedEvent }: { className?: string; selectedEvent?: LegacyEndpointEvent }) => { | ||
const context = useKibana<EndpointPluginServices>(); | ||
const { store } = storeFactory(context); | ||
return ( | ||
<div className={className} data-test-subj="alertResolver" data-testid="alertResolver"> | ||
<Provider store={store}> | ||
<Resolver selectedEvent={selectedEvent} /> | ||
</Provider> | ||
</div> | ||
); | ||
} | ||
) | ||
)` | ||
height: 100%; | ||
width: 100%; | ||
display: flex; | ||
flex-grow: 1; | ||
`; |
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.