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 <elasticmachine@users.noreply.github.com>
  • Loading branch information
michaelolo24 and elasticmachine committed Jun 26, 2020
1 parent 295ac7e commit 5c8df21
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 @@ -136,7 +136,7 @@ export const Resolver = React.memo(function Resolver({
projectionMatrix={projectionMatrix}
/>
))}
{[...processNodePositions].map(([processEvent, position], index) => {
{[...processNodePositions].map(([processEvent, position]) => {
const adjacentNodeMap = processToAdjacencyMap.get(processEvent);
const processEntityId = entityId(processEvent);
if (!adjacentNodeMap) {
Expand All @@ -145,7 +145,7 @@ export const Resolver = React.memo(function Resolver({
}
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 @@ -414,13 +414,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 @@ -637,22 +630,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 5c8df21

Please sign in to comment.