diff --git a/x-pack/plugins/security_solution/public/resolver/view/assets.tsx b/x-pack/plugins/security_solution/public/resolver/view/assets.tsx index 29843a43a9b852..1317c0ee94b601 100644 --- a/x-pack/plugins/security_solution/public/resolver/view/assets.tsx +++ b/x-pack/plugins/security_solution/public/resolver/view/assets.tsx @@ -441,7 +441,7 @@ export const useResolverTheme = (): { triggerBackingFill: `${theme.euiColorDanger}${getThemedOption('0F', '1F')}`, pillStroke: theme.euiColorLightShade, }; - + const nodeAssets: NodeStyleMap = { runningProcessCube: { backingFill: colorMap.processBackingFill, diff --git a/x-pack/plugins/security_solution/public/resolver/view/process_event_dot.tsx b/x-pack/plugins/security_solution/public/resolver/view/process_event_dot.tsx index b4acf52951f292..98e400b79760c6 100644 --- a/x-pack/plugins/security_solution/public/resolver/view/process_event_dot.tsx +++ b/x-pack/plugins/security_solution/public/resolver/view/process_event_dot.tsx @@ -343,7 +343,7 @@ const UnstyledProcessEventDot = React.memo( pointerEvents: 'none', }} > - + )=>void, count?: number, title: string, buttonBorderColor: ButtonColor, nodeID: string})=>{ - const hasIcon = hasMenu ?? false; - const iconType = menuIsOpen === true ? 'arrowUp' : 'arrowDown'; - return ( - - {count ? : ''} {title} - - ) -}) +const DetailHostButton = React.memo( + ({ + hasMenu, + menuIsOpen, + action, + count, + title, + buttonBorderColor, + nodeID, + }: { + hasMenu: boolean; + menuIsOpen?: boolean; + action: (evt: React.MouseEvent) => void; + count?: number; + title: string; + buttonBorderColor: ButtonColor; + nodeID: string; + }) => { + const hasIcon = hasMenu ?? false; + const iconType = menuIsOpen === true ? 'arrowUp' : 'arrowDown'; + return ( + + {count ? : ''} {title} + + ); + } +); /** * A Submenu to be displayed in one of two forms: @@ -152,13 +163,15 @@ const NodeSubMenuComponents = React.memo( projectionMatrixAtLastRender.current = projectionMatrix; }, [projectionMatrixAtLastRender, projectionMatrix]); - const { colorMap: {pillStroke: pillBorderStroke, resolverBackground: pillFill} } = useResolverTheme(); - const listStylesFromTheme = useMemo(()=>{ + const { + colorMap: { pillStroke: pillBorderStroke, resolverBackground: pillFill }, + } = useResolverTheme(); + const listStylesFromTheme = useMemo(() => { return { border: `1.5px solid ${pillBorderStroke}`, backgroundColor: pillFill, - } - },[pillBorderStroke, pillFill]); + }; + }, [pillBorderStroke, pillFill]); if (!optionsWithActions) { /** @@ -178,27 +191,48 @@ const NodeSubMenuComponents = React.memo( ); } - - if(typeof optionsWithActions === 'string') { - return (<>) + + if (typeof optionsWithActions === 'string') { + return <>; } return ( <> - {menuIsOpen ? (
    - { optionsWithActions.sort((opta, optb)=>{ return opta.optionTitle < optb.optionTitle ? -1 : 1 }).map((opt)=>{ - return (
  • ) - })} -
) : null} + {menuIsOpen ? ( +
    + {optionsWithActions + .sort((opta, optb) => { + return opta.optionTitle < optb.optionTitle ? -1 : 1; + }) + .map((opt) => { + return ( +
  • + +
  • + ); + })} +
+ ) : null} ); } @@ -212,7 +246,7 @@ export const NodeSubMenu = styled(NodeSubMenuComponents)` flex-flow: column; &.options { - font-size: .8rem; + font-size: 0.8rem; display: flex; flex-flow: row wrap; background: transparent; @@ -224,19 +258,19 @@ export const NodeSubMenu = styled(NodeSubMenuComponents)` } &.options .item { - margin: .25ch .35ch .35ch 0; - padding: .35em .5em; + margin: 0.25ch 0.35ch 0.35ch 0; + padding: 0.35em 0.5em; height: fit-content; width: fit-content; border-radius: 2px; - line-height: .8; + line-height: 0.8; } &.options .item button { appearance: none; height: fit-content; width: fit-content; - line-height: .8; + line-height: 0.8; outline-style: none; border-color: transparent; box-shadow: none; @@ -250,7 +284,7 @@ export const NodeSubMenu = styled(NodeSubMenuComponents)` } &.options .item button:active { - transform: scale(.95); + transform: scale(0.95); } & .euiButton {