Skip to content

Commit

Permalink
Hide unused resolver buttons (#70112)
Browse files Browse the repository at this point in the history
Co-authored-by: Elastic Machine <[email protected]>
  • Loading branch information
michaelolo24 and elasticmachine committed Jun 28, 2020
1 parent 39102c3 commit 7dd6b54
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 40 deletions.
10 changes: 0 additions & 10 deletions x-pack/plugins/security_solution/public/resolver/store/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,15 +141,6 @@ interface UserSelectedRelatedEventCategory {
};
}

/**
* This action should dispatch to indicate that the user chose to focus
* on examining alerts related to a particular ResolverEvent
*/
interface UserSelectedRelatedAlerts {
readonly type: 'userSelectedRelatedAlerts';
readonly payload: ResolverEvent;
}

export type ResolverAction =
| CameraAction
| DataAction
Expand All @@ -160,7 +151,6 @@ export type ResolverAction =
| UserSelectedResolverNode
| UserRequestedRelatedEventData
| UserSelectedRelatedEventCategory
| UserSelectedRelatedAlerts
| AppDetectedNewIdFromQueryParams
| AppDisplayedDifferentPanel
| AppDetectedMissingEventData;
Original file line number Diff line number Diff line change
Expand Up @@ -132,15 +132,15 @@ export const Resolver = React.memo(function Resolver({
projectionMatrix={projectionMatrix}
/>
))}
{[...processNodePositions].map(([processEvent, position], index) => {
{[...processNodePositions].map(([processEvent, position]) => {
const adjacentNodeMap = processToAdjacencyMap.get(processEvent);
if (!adjacentNodeMap) {
// This should never happen
throw new Error('Issue calculating adjacency node map.');
}
return (
<ProcessEventDot
key={index}
key={processEntityId}
position={position}
projectionMatrix={projectionMatrix}
event={processEvent}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -401,13 +401,6 @@ const ProcessEventDotComponents = React.memo(
});
}, [dispatch, selfId]);

const handleRelatedAlertsRequest = useCallback(() => {
dispatch({
type: 'userSelectedRelatedAlerts',
payload: event,
});
}, [dispatch, event]);

const history = useHistory();
const urlSearch = history.location.search;

Expand Down Expand Up @@ -624,22 +617,16 @@ const ProcessEventDotComponents = React.memo(
}}
>
<EuiFlexItem grow={false} className="related-dropdown">
<NodeSubMenu
count={grandTotal}
buttonBorderColor={labelButtonFill}
buttonFill={colorMap.resolverBackground}
menuAction={handleRelatedEventRequest}
menuTitle={subMenuAssets.relatedEvents.title}
optionsWithActions={relatedEventStatusOrOptions}
/>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<NodeSubMenu
buttonBorderColor={labelButtonFill}
buttonFill={colorMap.resolverBackground}
menuTitle={subMenuAssets.relatedAlerts.title}
menuAction={handleRelatedAlertsRequest}
/>
{grandTotal > 0 && (
<NodeSubMenu
count={grandTotal}
buttonBorderColor={labelButtonFill}
buttonFill={colorMap.resolverBackground}
menuAction={handleRelatedEventRequest}
menuTitle={subMenuAssets.relatedEvents.title}
optionsWithActions={relatedEventStatusOrOptions}
/>
)}
</EuiFlexItem>
</EuiFlexGroup>
</StyledActionsContainer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@ export const subMenuAssets = {
menuError: i18n.translate('xpack.securitySolution.endpoint.resolver.relatedRetrievalError', {
defaultMessage: 'There was an error retrieving related events.',
}),
relatedAlerts: {
title: i18n.translate('xpack.securitySolution.endpoint.resolver.relatedAlerts', {
defaultMessage: 'Related Alerts',
}),
},
relatedEvents: {
title: i18n.translate('xpack.securitySolution.endpoint.resolver.relatedEvents', {
defaultMessage: 'Events',
Expand Down

0 comments on commit 7dd6b54

Please sign in to comment.