mirror of
https://github.com/grafana/grafana.git
synced 2025-02-11 16:15:42 -06:00
DataLinks: Fixes an issue __series.name is not working in data link (#34932)
This commit is contained in:
parent
ef13f7ece1
commit
c7076c9e19
@ -10,16 +10,8 @@ import {
|
||||
MenuItem,
|
||||
UPlotConfigBuilder,
|
||||
} from '@grafana/ui';
|
||||
import {
|
||||
CartesianCoords2D,
|
||||
DataFrame,
|
||||
DataFrameView,
|
||||
getFieldDisplayName,
|
||||
InterpolateFunction,
|
||||
TimeZone,
|
||||
} from '@grafana/data';
|
||||
import { CartesianCoords2D, DataFrame, getFieldDisplayName, InterpolateFunction, TimeZone } from '@grafana/data';
|
||||
import { useClickAway } from 'react-use';
|
||||
import { getFieldLinksSupplier } from '../../../../features/panel/panellinks/linkSuppliers';
|
||||
import { pluginLog } from '@grafana/ui/src/components/uPlot/utils';
|
||||
|
||||
interface ContextMenuPluginProps {
|
||||
@ -207,19 +199,13 @@ export const ContextMenuView: React.FC<ContextMenuProps> = ({
|
||||
const hasLinks = field.config.links && field.config.links.length > 0;
|
||||
|
||||
if (hasLinks) {
|
||||
const linksSupplier = getFieldLinksSupplier({
|
||||
display: displayValue,
|
||||
name: field.name,
|
||||
view: new DataFrameView(data),
|
||||
rowIndex: dataIdx,
|
||||
colIndex: seriesIdx,
|
||||
field: field.config,
|
||||
hasLinks,
|
||||
});
|
||||
|
||||
if (linksSupplier) {
|
||||
if (field.getLinks) {
|
||||
items.push({
|
||||
items: linksSupplier.getLinks(replaceVariables).map<MenuItemProps>((link) => {
|
||||
items: field
|
||||
.getLinks({
|
||||
valueRowIndex: dataIdx,
|
||||
})
|
||||
.map<MenuItemProps>((link) => {
|
||||
return {
|
||||
label: link.title,
|
||||
ariaLabel: link.title,
|
||||
|
Loading…
Reference in New Issue
Block a user