Skip to content

Commit

Permalink
[Infra UI] Consistency in the popover styling (#166189)
Browse files Browse the repository at this point in the history
Closes #165960 
## Summary

This PR sets all popups inside host view padding to size s (8px)

### Testing

- Open the host view and check the popup size (should be 8px - size s):
<img width="1303" alt="image"
src="https://github.com/elastic/kibana/assets/14139027/b3242de6-5644-4a1d-9f10-7b9a76269848">

- Open metadata and processes message popups - they should have the same
padding size:
   - Metadata Tab
   
<img width="1002" alt="image"
src="https://github.com/elastic/kibana/assets/14139027/e1c157aa-ced6-4a2e-9458-a38b99328276">

   - Overview Tab
   
<img width="585" alt="image"
src="https://github.com/elastic/kibana/assets/14139027/878c1325-28af-4b16-9ec4-93a0fc620c87">

   - Processes Tab
   
<img width="1147" alt="image"
src="https://github.com/elastic/kibana/assets/14139027/70dfc49f-ef1a-4786-bab4-7a3715af7f85">
  • Loading branch information
jennypavlova authored Sep 12, 2023
1 parent d768657 commit 11d88cd
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const MetadataExplanationTooltipContent = React.memo(() => {
};

return (
<EuiText size="s" onClick={onClick} style={{ width: 200 }}>
<EuiText size="xs" onClick={onClick} style={{ width: 200 }}>
<FormattedMessage
id="xpack.infra.assetDetails.metadata.tooltip.documentationLabel"
defaultMessage="{metadata} is populated from the last event detected for this {hostName} for the selected date period."
Expand Down Expand Up @@ -91,7 +91,6 @@ export const MetadataExplanationMessage = () => {
iconSize="s"
iconColor="subdued"
icon="iInCircle"
panelPaddingSize="m"
data-test-subj="infraAssetDetailsMetadataPopoverButton"
>
<MetadataExplanationTooltipContent />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const ProcessesExplanationTooltipContent = React.memo(() => {
};

return (
<EuiText size="s" onClick={onClick} style={{ width: 300 }}>
<EuiText size="xs" onClick={onClick} style={{ width: 300 }}>
<p>
<FormattedMessage
id="xpack.infra.assetDetails.processes.tooltip.explanationLabel"
Expand Down Expand Up @@ -100,7 +100,6 @@ export const ProcessesExplanationMessage = () => {
iconSize="s"
iconColor="subdued"
icon="iInCircle"
panelPaddingSize="m"
data-test-subj="infraAssetDetailsProcessesPopoverButton"
>
<ProcessesExplanationTooltipContent />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
* 2.0.
*/

import { PanelPaddingSize } from '@elastic/eui';
import { EuiPopover, EuiIcon, type IconType, type IconColor, type IconSize } from '@elastic/eui';
import { css } from '@emotion/react';
import React from 'react';
Expand All @@ -16,20 +15,18 @@ export const Popover = ({
icon,
iconColor,
iconSize,
panelPaddingSize,
...props
}: {
children: React.ReactNode;
icon: IconType;
iconColor?: IconColor;
iconSize?: IconSize;
panelPaddingSize?: PanelPaddingSize;
'data-test-subj'?: string;
}) => {
const [isPopoverOpen, { off: closePopover, toggle: togglePopover }] = useBoolean(false);
return (
<EuiPopover
panelPaddingSize={panelPaddingSize ?? 's'}
panelPaddingSize="s"
button={
<EuiIcon
data-test-subj={props['data-test-subj']}
Expand Down

0 comments on commit 11d88cd

Please sign in to comment.