diff --git a/packages/grafana-ui/src/components/DataLinks/DataLinksEditor.tsx b/packages/grafana-ui/src/components/DataLinks/DataLinksEditor.tsx index 11cef2a8438..881fad58d4e 100644 --- a/packages/grafana-ui/src/components/DataLinks/DataLinksEditor.tsx +++ b/packages/grafana-ui/src/components/DataLinks/DataLinksEditor.tsx @@ -66,7 +66,7 @@ export const DataLinksEditor: FC = React.memo(({ value, on )} - {(!value || (value && value.length < (maxLinks || 1))) && ( + {(!value || (value && value.length < (maxLinks || Infinity))) && ( diff --git a/public/app/plugins/panel/graph/GraphContextMenu.tsx b/public/app/plugins/panel/graph/GraphContextMenu.tsx index b9758e61950..0d80986d617 100644 --- a/public/app/plugins/panel/graph/GraphContextMenu.tsx +++ b/public/app/plugins/panel/graph/GraphContextMenu.tsx @@ -8,10 +8,18 @@ type GraphContextMenuProps = ContextMenuProps & { getContextMenuSource: () => FlotDataPoint | null; }; -export const GraphContextMenu: React.FC = ({ getContextMenuSource, ...otherProps }) => { +export const GraphContextMenu: React.FC = ({ getContextMenuSource, items, ...otherProps }) => { const theme = useContext(ThemeContext); const source = getContextMenuSource(); + // Do not render items that do not have label specified + const itemsToRender = items + ? items.map(group => ({ + ...group, + items: group.items.filter(item => item.label), + })) + : []; + const renderHeader = source ? () => { if (!source) { @@ -44,5 +52,5 @@ export const GraphContextMenu: React.FC = ({ getContextMe } : null; - return ; + return ; }; diff --git a/public/app/plugins/panel/graph/module.ts b/public/app/plugins/panel/graph/module.ts index 09aec5b04c8..56c059d3c4c 100644 --- a/public/app/plugins/panel/graph/module.ts +++ b/public/app/plugins/panel/graph/module.ts @@ -162,7 +162,7 @@ class GraphCtrl extends MetricsPanelCtrl { this.addEditorTab('Axes', axesEditorComponent); this.addEditorTab('Legend', 'public/app/plugins/panel/graph/tab_legend.html'); this.addEditorTab('Thresholds & Time Regions', 'public/app/plugins/panel/graph/tab_thresholds_time_regions.html'); - this.addEditorTab('Data link', 'public/app/plugins/panel/graph/tab_drilldown_links.html'); + this.addEditorTab('Data links', 'public/app/plugins/panel/graph/tab_drilldown_links.html'); this.subTabIndex = 0; }