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] Visualization actions button should not be overlap by the chart #132539

Merged
merged 3 commits into from
May 23, 2022
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 @@ -19,7 +19,7 @@ import {

import { getOr, get, isNull, isNumber } from 'lodash/fp';

import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui';
import { EuiFlexItem } from '@elastic/eui';
import { useThrottledResizeObserver } from '../utils';
import { ChartPlaceHolder } from './chart_place_holder';
import { useTimeZone } from '../../lib/kibana';
Expand All @@ -32,6 +32,7 @@ import {
WrappedByAutoSizer,
useTheme,
Wrapper,
ChartWrapper,
} from './common';
import { VisualizationActions, HISTOGRAM_ACTIONS_BUTTON_CLASS } from '../visualization_actions';
import { VisualizationActionsProps } from '../visualization_actions/types';
Expand Down Expand Up @@ -165,7 +166,7 @@ export const AreaChartComponent: React.FC<AreaChartComponentProps> = ({
<Wrapper>
<HoverVisibilityContainer targetClassNames={[HISTOGRAM_ACTIONS_BUTTON_CLASS]}>
{isValidSeriesExist && areaChart && (
<EuiFlexGroup gutterSize="none">
<ChartWrapper gutterSize="none">
<EuiFlexItem grow={true}>
<WrappedByAutoSizer ref={measureRef} height={chartHeight}>
<AreaChartBase
Expand All @@ -176,7 +177,7 @@ export const AreaChartComponent: React.FC<AreaChartComponentProps> = ({
/>
</WrappedByAutoSizer>
</EuiFlexItem>
</EuiFlexGroup>
</ChartWrapper>
)}
{!isValidSeriesExist && (
<ChartPlaceHolder height={chartHeight} width={chartWidth} data={areaChart} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui';
import { EuiFlexItem } from '@elastic/eui';
import React, { useMemo } from 'react';
import { Chart, BarSeries, Axis, Position, ScaleType, Settings } from '@elastic/charts';
import { getOr, get, isNumber } from 'lodash/fp';
Expand All @@ -32,6 +32,7 @@ import {
WrappedByAutoSizer,
useTheme,
Wrapper,
ChartWrapper,
} from './common';
import { DraggableLegend } from './draggable_legend';
import { LegendItem } from './draggable_legend_item';
Expand Down Expand Up @@ -210,7 +211,7 @@ export const BarChartComponent: React.FC<BarChartComponentProps> = ({
<Wrapper>
<HoverVisibilityContainer targetClassNames={[HISTOGRAM_ACTIONS_BUTTON_CLASS]}>
{isValidSeriesExist && barChart && (
<EuiFlexGroup gutterSize="none">
<ChartWrapper gutterSize="none">
<EuiFlexItem grow={true}>
<WrappedByAutoSizer ref={measureRef} height={chartHeight}>
<BarChartBase
Expand All @@ -227,7 +228,7 @@ export const BarChartComponent: React.FC<BarChartComponentProps> = ({
<LegendFlexItem grow={false}>
<DraggableLegend legendItems={legendItems} height={height} />
</LegendFlexItem>
</EuiFlexGroup>
</ChartWrapper>
)}
{!isValidSeriesExist && (
<ChartPlaceHolder height={chartHeight} width={chartWidth} data={barChart} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
AxisStyle,
BarSeriesStyle,
} from '@elastic/charts';
import { EuiFlexGroup } from '@elastic/eui';
import React, { useMemo } from 'react';
import styled from 'styled-components';

Expand Down Expand Up @@ -152,3 +153,7 @@ export const checkIfAllValuesAreZero = (data: ChartSeriesData[] | null | undefin
export const Wrapper = styled.div`
position: relative;
`;

export const ChartWrapper = styled(EuiFlexGroup)`
z-index: 0;
`;
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const Wrapper = styled.div`
position: absolute;
top: 0;
right: 0;
z-index: 1;
}
&.histogram-viz-actions {
padding: ${({ theme }) => theme.eui.paddingSizes.s};
Expand Down