Skip to content
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][Resolver] Replace Selectable popover with badges #76997

Merged
merged 13 commits into from
Sep 10, 2020
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ const StyledDescriptionText = styled.div<StyledDescriptionText>`
width: fit-content;
`;

const StyledOuterGroup = styled.g`
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A styled G 💯

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haha, love it 😂

fill: none;
pointer-events: visiblePainted;
`;

/**
* An artifact that represents a process node and the things associated with it in the Resolver
*/
Expand Down Expand Up @@ -343,7 +348,7 @@ const UnstyledProcessEventDot = React.memo(
pointerEvents: 'none',
}}
>
<g fill="none" style={{ pointerEvents: 'visiblePainted' }}>
<StyledOuterGroup>
<use
xlinkHref={`#${SymbolIds.processCubeActiveBacking}`}
fill={backingFill} // Only visible on hover
Expand Down Expand Up @@ -375,7 +380,7 @@ const UnstyledProcessEventDot = React.memo(
ref={animationTarget}
/>
</use>
</g>
</StyledOuterGroup>
</svg>
<StyledActionsContainer
color={colorMap.full}
Expand Down
14 changes: 11 additions & 3 deletions x-pack/plugins/security_solution/public/resolver/view/submenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,15 @@ interface ResolverSubmenuOption {

export type ResolverSubmenuOptionList = ResolverSubmenuOption[] | string;

const StyledActionButton = styled(EuiButton)`
&.euiButton--small {
height: fit-content;
line-height: 1;
padding: 0.25em;
font-size: 0.85rem;
}
`;

/**
* This will be the "host button" that displays the "total number of related events" and opens
* the sumbmenu (with counts by category) when clicked.
Expand All @@ -66,12 +75,11 @@ const SubButton = React.memo(
const hasIcon = hasMenu ?? false;
bkimmel marked this conversation as resolved.
Show resolved Hide resolved
const iconType = menuIsOpen === true ? 'arrowUp' : 'arrowDown';
return (
<EuiButton
<StyledActionButton
onClick={action}
iconType={hasIcon ? iconType : 'none'}
fill={false}
color={'primary'}
style={{ height: 'fit-content', lineHeight: 1, padding: '.25em', fontSize: '.85rem' }}
size="s"
iconSide="right"
tabIndex={-1}
Expand All @@ -80,7 +88,7 @@ const SubButton = React.memo(
id={nodeID}
>
{count ? <EuiI18nNumber value={count} /> : ''} {title}
</EuiButton>
</StyledActionButton>
);
}
);
Expand Down