Skip to content

Commit e165a7b

Browse files
rmyzCAWilson94
authored andcommitted
[Infra] Fix Actions on Charts (elastic#202443)
## Summary Closes elastic#201535 This PR fixes the actions not displayed on Infra charts while hovering with the mouse, while also modifying the actions that should be displayed. Right now, the following actions are displayed: - Explore in Discover - Inspect - Open in Lens (as a custom action, clicking the 3 dots) ### How to test 1. Start Kibana and fill it with data, `node scripts/synthtrace infra_hosts_with_apm_hosts` can be used if you don't have data. 2. Navigate to Host list, check if hovering a chart displays the actions 3. Navigate to Host details, check if hovering a chart displays the actions ### Screenshots Before|After -|- ![image](https://github.com/user-attachments/assets/489b00e0-9702-4ac2-a55e-cc1e1e733783)|![image](https://github.com/user-attachments/assets/fa37a6ba-9074-403f-ad10-1b6b58e3f64a)
1 parent 6663044 commit e165a7b

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

x-pack/plugins/observability_solution/infra/public/components/lens/lens_chart.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ import { ChartLoadError } from './chart_load_error';
2525
import { HOST_MISSING_FIELDS } from '../../common/visualizations/constants';
2626

2727
const MIN_HEIGHT = 300;
28+
const DEFAULT_DISABLED_ACTIONS = [
29+
'ACTION_CUSTOMIZE_PANEL',
30+
'ACTION_EXPORT_CSV',
31+
'embeddable_addToExistingCase',
32+
'create-ml-ad-job-action',
33+
];
2834

2935
export type LensChartProps = BaseChartProps &
3036
Pick<EuiPanelProps, 'borderRadius'> & {
@@ -33,6 +39,8 @@ export type LensChartProps = BaseChartProps &
3339
description?: string;
3440
} & {
3541
lensAttributes: UseLensAttributesParams;
42+
withDefaultActions?: boolean;
43+
disabledActions?: string[];
3644
};
3745

3846
export const LensChart = React.memo(
@@ -52,6 +60,8 @@ export const LensChart = React.memo(
5260
height = MIN_HEIGHT,
5361
loading = false,
5462
lensAttributes,
63+
withDefaultActions = true,
64+
disabledActions = DEFAULT_DISABLED_ACTIONS,
5565
}: LensChartProps) => {
5666
const { formula, attributes, getExtraActions, error } = useLensAttributes(lensAttributes);
5767

@@ -122,6 +132,8 @@ export const LensChart = React.memo(
122132
dateRange={dateRange}
123133
disableTriggers={disableTriggers}
124134
extraActions={extraActions}
135+
withDefaultActions={withDefaultActions}
136+
disabledActions={disabledActions}
125137
filters={filters}
126138
hidePanelTitles={hidePanelTitles}
127139
loading={isLoading}

x-pack/plugins/observability_solution/infra/public/components/lens/lens_wrapper.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ export const LensWrapper = ({
9393
<div
9494
css={css`
9595
position: relative;
96-
overflow: hidden;
9796
height: 100%;
9897
.echMetric {
9998
border-radius: ${euiTheme.border.radius.medium};

0 commit comments

Comments
 (0)