PanelRenderer: Interpolate variables in applyFieldOverrides (#59844)

Update PanelRenderer to interpolate variables in applyFieldOverrides
This commit is contained in:
Connor Lindsey 2022-12-12 07:18:47 -07:00 committed by GitHub
parent b0f8e803a1
commit 8fe9969826
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 3 deletions

View File

@ -62,7 +62,7 @@ export function mapInternalLinkToExplore(options: LinkToExploreOptions): LinkMod
});
}
: undefined,
target: '_self',
target: link?.targetBlank ? '_blank' : '_self',
origin: field,
};
}

View File

@ -10,8 +10,9 @@ import {
compareArrayValues,
compareDataFrameStructures,
PluginContextProvider,
ScopedVars,
} from '@grafana/data';
import { PanelRendererProps } from '@grafana/runtime';
import { getTemplateSrv, PanelRendererProps } from '@grafana/runtime';
import { ErrorBoundaryAlert, useTheme2 } from '@grafana/ui';
import { appEvents } from 'app/core/core';
@ -151,7 +152,9 @@ export function useFieldOverrides(
data: series,
fieldConfig,
fieldConfigRegistry,
replaceVariables: (str: string) => str,
replaceVariables: (str: string, scopedVars?: ScopedVars) => {
return getTemplateSrv().replace(str, scopedVars);
},
theme,
timeZone,
}),