diff --git a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/config_panel/layer_settings.tsx b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/config_panel/layer_settings.tsx index abbd7e0838be..bc537e5a7d68 100644 --- a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/config_panel/layer_settings.tsx +++ b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/config_panel/layer_settings.tsx @@ -26,10 +26,21 @@ export function LayerSettings({ return null; } - const a11yText = i18n.translate('xpack.lens.editLayerSettings', { - defaultMessage: 'Edit layer settings', - }); + const a11yText = (chartType?: string) => { + if (chartType) { + return i18n.translate('xpack.lens.editLayerSettingsChartType', { + defaultMessage: 'Edit layer settings, {chartType}', + values: { + chartType, + }, + }); + } + return i18n.translate('xpack.lens.editLayerSettings', { + defaultMessage: 'Edit layer settings', + }); + }; + const contextMenuIcon = activeVisualization.getLayerContextMenuIcon?.(layerConfigProps); return ( setIsOpen(!isOpen)} data-test-subj="lns_layer_settings" /> diff --git a/x-pack/plugins/lens/public/types.ts b/x-pack/plugins/lens/public/types.ts index 2f40f2145531..65c565087af7 100644 --- a/x-pack/plugins/lens/public/types.ts +++ b/x-pack/plugins/lens/public/types.ts @@ -540,7 +540,10 @@ export interface Visualization { * Visualizations can provide a custom icon which will open a layer-specific popover * If no icon is provided, gear icon is default */ - getLayerContextMenuIcon?: (opts: { state: T; layerId: string }) => IconType | undefined; + getLayerContextMenuIcon?: (opts: { + state: T; + layerId: string; + }) => { icon: IconType | 'gear'; label: string } | undefined; /** * The frame is telling the visualization to update or set a dimension based on user interaction diff --git a/x-pack/plugins/lens/public/xy_visualization/visualization.tsx b/x-pack/plugins/lens/public/xy_visualization/visualization.tsx index 5748e649c181..872eb179e6a5 100644 --- a/x-pack/plugins/lens/public/xy_visualization/visualization.tsx +++ b/x-pack/plugins/lens/public/xy_visualization/visualization.tsx @@ -300,7 +300,11 @@ export const getXyVisualization = ({ getLayerContextMenuIcon({ state, layerId }) { const layer = state.layers.find((l) => l.layerId === layerId); - return visualizationTypes.find((t) => t.id === layer?.seriesType)?.icon; + const visualizationType = visualizationTypes.find((t) => t.id === layer?.seriesType); + return { + icon: visualizationType?.icon || 'gear', + label: visualizationType?.label || '', + }; }, renderLayerContextMenu(domElement, props) {