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 @@ -24,7 +24,8 @@ type ResolverColorNames =
| 'resolverBackground'
| 'resolverEdge'
| 'resolverEdgeText'
| 'resolverBreadcrumbBackground';
| 'resolverBreadcrumbBackground'
| 'pillStroke';

type ColorMap = Record<ResolverColorNames, string>;
interface NodeStyleConfig {
Expand Down Expand Up @@ -438,6 +439,7 @@ export const useResolverTheme = (): {
resolverBreadcrumbBackground: theme.euiColorLightestShade,
resolverEdgeText: getThemedOption(theme.euiColorDarkShade, theme.euiColorFullShade),
triggerBackingFill: `${theme.euiColorDanger}${getThemedOption('0F', '1F')}`,
pillStroke: theme.euiColorLightShade,
};

const nodeAssets: NodeStyleMap = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const StyledActionsContainer = styled.div<StyledActionsContainer>`
position: absolute;
top: ${(props) => `${props.topPct}%`};
width: auto;
pointer-events: all;
`;

interface StyledDescriptionText {
Expand All @@ -61,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 @@ -329,6 +335,7 @@ const UnstyledProcessEventDot = React.memo(
}
role="img"
aria-labelledby={labelHTMLID}
fill="none"
style={{
display: 'block',
width: '100%',
Expand All @@ -338,9 +345,10 @@ const UnstyledProcessEventDot = React.memo(
left: '0',
outline: 'transparent',
border: 'none',
pointerEvents: 'none',
}}
>
<g>
<StyledOuterGroup>
<use
xlinkHref={`#${SymbolIds.processCubeActiveBacking}`}
fill={backingFill} // Only visible on hover
Expand Down Expand Up @@ -372,7 +380,7 @@ const UnstyledProcessEventDot = React.memo(
ref={animationTarget}
/>
</use>
</g>
</StyledOuterGroup>
</svg>
<StyledActionsContainer
color={colorMap.full}
Expand Down Expand Up @@ -464,6 +472,7 @@ export const ProcessEventDot = styled(UnstyledProcessEventDot)`
min-width: 280px;
min-height: 90px;
overflow-y: visible;
pointer-events: none;

//dasharray & dashoffset should be equal to "pull" the stroke back
//when it is transitioned.
Expand Down
Loading