[v11.0.x] Canvas: Fix datalinks using field variable (#87275)

Canvas: Fix datalinks using field variable (#87265)

(cherry picked from commit 6c7485129b)

Co-authored-by: Drew Slobodnjak <60050885+drew08t@users.noreply.github.com>
pull/87581/head
grafana-delivery-bot[bot] 1 year ago committed by GitHub
parent 0a2f239744
commit 11e83015bf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      public/app/plugins/panel/canvas/utils.ts

@ -119,7 +119,9 @@ const addDataLinkForField = (
): void => {
if (field?.getLinks) {
const disp = field.display ? field.display(data) : { text: `${data}`, numeric: +data! };
field.getLinks({ calculatedValue: disp }).forEach((link) => {
// TODO add more control over which row index each element uses
const valueRowIndex = field.values.length - 1;
field.getLinks({ calculatedValue: disp, valueRowIndex }).forEach((link) => {
const key = `${link.title}/${link.href}`;
if (!linkLookup.has(key)) {
links.push(link);

Loading…
Cancel
Save