From 2700ef11e927a2357e4f3f045784b7b04b4f15df Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Sat, 2 Nov 2024 05:39:42 +1100 Subject: [PATCH] [8.x] [SecuritySolution] Fix styling issues for visualizations (#198410) (#198704) # Backport This will backport the following commits from `main` to `8.x`: - [[SecuritySolution] Fix styling issues for visualizations (#198410)](https://github.com/elastic/kibana/pull/198410) ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) Co-authored-by: Angela Chuang <6295984+angorayc@users.noreply.github.com> --- .../visualization_actions/lens_embeddable.tsx | 29 ++++++++----------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_embeddable.tsx b/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_embeddable.tsx index a72675d381404..0461cb8888be5 100644 --- a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_embeddable.tsx +++ b/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_embeddable.tsx @@ -34,24 +34,26 @@ import { useEmbeddableInspect } from './use_embeddable_inspect'; import { useVisualizationResponse } from './use_visualization_response'; import { useInspect } from '../inspect/use_inspect'; -const HOVER_ACTIONS_PADDING = 24; const DISABLED_ACTIONS = ['ACTION_CUSTOMIZE_PANEL']; const LensComponentWrapper = styled.div<{ $height?: number; width?: string | number; - $addHoverActionsPadding?: boolean; }>` height: ${({ $height }) => ($height ? `${$height}px` : 'auto')}; width: ${({ width }) => width ?? 'auto'}; - ${({ $addHoverActionsPadding }) => - $addHoverActionsPadding ? `.embPanel__header { top: ${HOVER_ACTIONS_PADDING * -1}px; }` : ''} + .embPanel { + outline: none; + } + + .embPanel__hoverActions.embPanel__hoverActionsRight { + border-radius: 6px !important; + border-bottom: 1px solid #d3dae6 !important; + } - .embPanel__header { - z-index: 2; - position: absolute; - right: 0; + .embPanel__hoverActionsAnchor .embPanel__hoverActionsWrapper { + top: -20px; } .expExpressionRenderer__expression { @@ -110,10 +112,7 @@ const LensEmbeddableComponent: React.FC = ({ title: '', }); const preferredSeriesType = (attributes?.state?.visualization as XYState)?.preferredSeriesType; - // Avoid hover actions button overlaps with its chart - const addHoverActionsPadding = - attributes?.visualizationType !== 'lnsLegacyMetric' && - attributes?.visualizationType !== 'lnsPie'; + const LensComponent = lens.EmbeddableComponent; const overrides: TypedLensByValueInput['overrides'] = useMemo( @@ -255,11 +254,7 @@ const LensEmbeddableComponent: React.FC = ({ return ( <> {attributes && searchSessionId && ( - +