diff --git a/packages/grafana-data/src/vector/SortedVector.ts b/packages/grafana-data/src/vector/SortedVector.ts index b6837bbe14f..0d66dff6ded 100644 --- a/packages/grafana-data/src/vector/SortedVector.ts +++ b/packages/grafana-data/src/vector/SortedVector.ts @@ -16,10 +16,6 @@ export class SortedVector implements Vector { return this.source.get(this.order[index]); } - getOrderIndex(index: number): number { - return this.order[index]; - } - toArray(): T[] { return vectorToArray(this); } diff --git a/public/app/plugins/panel/timeseries/plugins/ContextMenuPlugin.tsx b/public/app/plugins/panel/timeseries/plugins/ContextMenuPlugin.tsx index d8976238285..4e19f11ce24 100644 --- a/public/app/plugins/panel/timeseries/plugins/ContextMenuPlugin.tsx +++ b/public/app/plugins/panel/timeseries/plugins/ContextMenuPlugin.tsx @@ -2,15 +2,7 @@ import { css as cssCore, Global } from '@emotion/react'; import React, { useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react'; import { useClickAway } from 'react-use'; -import { - CartesianCoords2D, - DataFrame, - getFieldDisplayName, - InterpolateFunction, - SortedVector, - TimeZone, - ValueLinkConfig, -} from '@grafana/data'; +import { CartesianCoords2D, DataFrame, getFieldDisplayName, InterpolateFunction, TimeZone } from '@grafana/data'; import { ContextMenu, GraphContextMenuHeader, @@ -257,27 +249,23 @@ export const ContextMenuView: React.FC = ({ const hasLinks = field.config.links && field.config.links.length > 0; - const valueLinkConfig: ValueLinkConfig = {}; - - if (field.values instanceof SortedVector) { - valueLinkConfig.valueRowIndex = field.values.getOrderIndex(dataIdx); - } else { - valueLinkConfig.valueRowIndex = dataIdx; - } - if (hasLinks) { if (field.getLinks) { items.push({ - items: field.getLinks(valueLinkConfig).map((link) => { - return { - label: link.title, - ariaLabel: link.title, - url: link.href, - target: link.target, - icon: link.target === '_self' ? 'link' : 'external-link-alt', - onClick: link.onClick, - }; - }), + items: field + .getLinks({ + valueRowIndex: dataIdx, + }) + .map((link) => { + return { + label: link.title, + ariaLabel: link.title, + url: link.href, + target: link.target, + icon: link.target === '_self' ? 'link' : 'external-link-alt', + onClick: link.onClick, + }; + }), }); } }