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

[SIEM] Fixes a CSS issue with Timeline field truncation #65789

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import { EuiLink, EuiFlexGroup, EuiFlexItem, EuiIcon, EuiToolTip } from '@elastic/eui';
import { isString, isEmpty } from 'lodash/fp';
import React from 'react';
import styled from 'styled-components';

import { DefaultDraggable } from '../../../draggables';
import { getEmptyTagValue } from '../../../empty_value';
Expand All @@ -18,6 +19,10 @@ import endPointSvg from '../../../../utils/logo_endpoint/64_color.svg';

import * as i18n from './translations';

const EventModuleFlexItem = styled(EuiFlexItem)`
width: 100%;
`;

export const renderRuleName = ({
contextId,
eventId,
Expand Down Expand Up @@ -87,7 +92,7 @@ export const renderEventModule = ({
endpointRefUrl != null && !isEmpty(endpointRefUrl) ? 'flexStart' : 'spaceBetween'
}
>
<EuiFlexItem>
<EventModuleFlexItem>
<DefaultDraggable
field={fieldName}
id={`event-details-value-default-draggable-${contextId}-${eventId}-${fieldName}-${value}-${moduleName}`}
Expand All @@ -96,7 +101,7 @@ export const renderEventModule = ({
>
{content}
</DefaultDraggable>
</EuiFlexItem>
</EventModuleFlexItem>
{endpointRefUrl != null && canYouAddEndpointLogo(moduleName, endpointRefUrl) && (
<EuiFlexItem grow={false}>
<EuiToolTip
Expand Down
13 changes: 11 additions & 2 deletions x-pack/plugins/siem/public/components/with_hover_actions/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,17 @@

import { EuiPopover } from '@elastic/eui';
import React, { useCallback, useMemo, useState } from 'react';
import styled from 'styled-components';

import { IS_DRAGGING_CLASS_NAME } from '../drag_and_drop/helpers';

// eslint-disable-next-line @typescript-eslint/no-explicit-any
const WithHoverActionsPopover = (styled(EuiPopover as any)`
rylnd marked this conversation as resolved.
Show resolved Hide resolved
.euiPopover__anchor {
width: 100%;
}
` as unknown) as typeof EuiPopover;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks @chandlerprall for the help wrapping EuiPopover in a styled-component!


interface Props {
/**
* Always show the hover menu contents (default: false)
Expand Down Expand Up @@ -59,7 +68,7 @@ export const WithHoverActions = React.memo<Props>(

const popover = useMemo(() => {
return (
<EuiPopover
<WithHoverActionsPopover
anchorPosition={'downCenter'}
button={content}
closePopover={onMouseLeave}
Expand All @@ -68,7 +77,7 @@ export const WithHoverActions = React.memo<Props>(
panelPaddingSize={!alwaysShow ? 's' : 'none'}
>
{isOpen ? hoverContent : null}
</EuiPopover>
</WithHoverActionsPopover>
);
}, [content, onMouseLeave, isOpen, alwaysShow, hoverContent]);

Expand Down