Skip to content

Commit

Permalink
[Security Solution][Resolver] Replace Selectable popover with badges (#…
Browse files Browse the repository at this point in the history
…76997) (#77257)

* replace selectable/popover with badges

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
  • Loading branch information
bkimmel and elasticmachine committed Sep 11, 2020
1 parent 0e83a7c commit c9a5082
Show file tree
Hide file tree
Showing 3 changed files with 146 additions and 128 deletions.
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`
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

0 comments on commit c9a5082

Please sign in to comment.