Commit 43543d56 by Torkel Ödegaard Committed by GitHub

DataLinks: Fixed interpolation of series name, fixes #18250 (#18251)

parent c01bbf20
......@@ -91,22 +91,14 @@ export class LinkSrv implements LinkService {
}
getDataPointVars = (seriesName: string, valueTime: DateTime) => {
// const valueTimeQuery = toUrlParams({
// time: dateTime(valueTime).valueOf(),
// });
const seriesQuery = toUrlParams({
series: seriesName,
});
return {
[DataLinkBuiltInVars.valueTime]: {
text: valueTime.valueOf(),
value: valueTime.valueOf(),
},
[DataLinkBuiltInVars.seriesName]: {
text: seriesQuery,
value: seriesQuery,
text: seriesName,
value: seriesName,
},
};
};
......
......@@ -102,12 +102,12 @@ describe('linkSrv', () => {
linkSrv.getDataLinkUIModel(
{
title: 'Any title',
url: `/d/1?$${DataLinkBuiltInVars.seriesName}`,
url: `/d/1?var-test=$${DataLinkBuiltInVars.seriesName}`,
},
{},
dataPointMock
).href
).toEqual('/d/1?series=A-series');
).toEqual('/d/1?var-test=A-series');
});
it('should interpolate time range based on datapoint timestamp', () => {
expect(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment