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] Fixes Exit full screen and Copy to clipboard styling issues #96676

Merged
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,22 +7,12 @@

import { EuiToolTip } from '@elastic/eui';
import React from 'react';
import styled from 'styled-components';

import { TooltipWithKeyboardShortcut } from '../../components/accessibility/tooltip_with_keyboard_shortcut';
import * as i18n from '../../components/drag_and_drop/translations';

import { Clipboard } from './clipboard';

const WithCopyToClipboardContainer = styled.div`
align-items: center;
display: flex;
flex-direction: row;
user-select: text;
`;

WithCopyToClipboardContainer.displayName = 'WithCopyToClipboardContainer';

/**
* Renders `children` with an adjacent icon that when clicked, copies `text` to
* the clipboard and displays a confirmation toast
Expand All @@ -31,7 +21,7 @@ export const WithCopyToClipboard = React.memo<{
keyboardShortcut?: string;
text: string;
titleSummary?: string;
}>(({ keyboardShortcut = '', text, titleSummary, children }) => (
}>(({ keyboardShortcut = '', text, titleSummary }) => (
<EuiToolTip
content={
<TooltipWithKeyboardShortcut
Expand All @@ -42,10 +32,7 @@ export const WithCopyToClipboard = React.memo<{
/>
}
>
<WithCopyToClipboardContainer>
<>{children}</>
<Clipboard content={text} titleSummary={titleSummary} toastLifeTimeMs={800} />
</WithCopyToClipboardContainer>
<Clipboard content={text} titleSummary={titleSummary} toastLifeTimeMs={800} />
</EuiToolTip>
));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,7 @@ const StyledEuiFlyoutFooter = styled(EuiFlyoutFooter)`
}
`;

const ExitFullScreenFlexItem = styled(EuiFlexItem)`
&.euiFlexItem {
${({ theme }) => `margin: ${theme.eui.euiSizeS} 0 0 ${theme.eui.euiSizeS};`}
}

const ExitFullScreenContainer = styled.div`
width: 180px;
`;

Expand Down Expand Up @@ -205,13 +201,15 @@ export const PinnedTabContentComponent: React.FC<Props> = ({
return (
<>
<FullWidthFlexGroup data-test-subj={`${TimelineTabs.pinned}-tab`}>
{timelineFullScreen && setTimelineFullScreen != null && (
<ExitFullScreenFlexItem grow={false}>
<ExitFullScreen fullScreen={timelineFullScreen} setFullScreen={setTimelineFullScreen} />
</ExitFullScreenFlexItem>
)}

<ScrollableFlexItem grow={2}>
{timelineFullScreen && setTimelineFullScreen != null && (
<ExitFullScreenContainer>
<ExitFullScreen
fullScreen={timelineFullScreen}
setFullScreen={setTimelineFullScreen}
/>
</ExitFullScreenContainer>
)}
<EventDetailsWidthProvider>
<StyledEuiFlyoutBody
data-test-subj={`${TimelineTabs.pinned}-tab-flyout-body`}
Expand Down