Skip to content

Commit

Permalink
addresses comments
Browse files Browse the repository at this point in the history
  • Loading branch information
dplumlee committed Mar 2, 2020
1 parent 5500167 commit 93f7cf0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const HostAccordion = memo(({ alertData }: { alertData: Immutable<AlertDa
title: i18n.translate('xpack.endpoint.application.endpoint.alertDetails.hostIP', {
defaultMessage: 'Host IP',
}),
description: alertData.host.ip.join(','),
description: alertData.host.ip.join(', '),
},
{
title: i18n.translate('xpack.endpoint.application.endpoint.alertDetails.status', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,6 @@ describe('when on the alerting page', () => {
it('should show the flyout', async () => {
await render().findByTestId('alertDetailFlyout');
});
it('should render resolver', async () => {
await render().findByTestId('alertResolver');
});
describe('when the user clicks the close button on the flyout', () => {
let renderResult: reactTestingLibrary.RenderResult;
beforeEach(async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,22 @@ import { Resolver } from '../../../../embeddables/resolver/view';
import { EndpointPluginServices } from '../../../../plugin';
import { LegacyEndpointEvent } from '../../../../../common/types';
import { storeFactory } from '../../../../embeddables/resolver/store';
import { useAlertListSelector } from './hooks/use_alerts_selector';
import * as selectors from '../../store/alerts/selectors';

export const AlertDetailResolver = styled(
React.memo(({ className }: { className?: string }) => {
const alertDetailsData = useAlertListSelector(selectors.selectedAlertDetailsData);
if (alertDetailsData === undefined) {
return null;
}
const context = useKibana<EndpointPluginServices>();
const { store } = storeFactory(context);
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={(alertDetailsData as unknown) as LegacyEndpointEvent} />
</Provider>
</div>
);
})
return (
<div className={className} data-test-subj="alertResolver" data-testid="alertResolver">
<Provider store={store}>
<Resolver selectedEvent={selectedEvent} />
</Provider>
</div>
);
}
)
)`
height: 100%;
width: 100%;
Expand Down

0 comments on commit 93f7cf0

Please sign in to comment.