Commit 20d0c073 by Dominik Prokop Committed by GitHub

DataLinks: Use datapoint timestamp correctly when interpolating variables (#18459)

parent 7520166f
...@@ -132,7 +132,7 @@ export class LinkSrv implements LinkService { ...@@ -132,7 +132,7 @@ export class LinkSrv implements LinkService {
if (dataPoint) { if (dataPoint) {
info.href = this.templateSrv.replace( info.href = this.templateSrv.replace(
info.href, info.href,
this.getDataPointVars(dataPoint.seriesName, dateTime(dataPoint[0])) this.getDataPointVars(dataPoint.seriesName, dateTime(dataPoint.datapoint[0]))
); );
} }
......
...@@ -11,7 +11,7 @@ jest.mock('angular', () => { ...@@ -11,7 +11,7 @@ jest.mock('angular', () => {
const dataPointMock = { const dataPointMock = {
seriesName: 'A-series', seriesName: 'A-series',
datapoint: [1000000000, 1], datapoint: [1000000001, 1],
}; };
describe('linkSrv', () => { describe('linkSrv', () => {
...@@ -119,7 +119,7 @@ describe('linkSrv', () => { ...@@ -119,7 +119,7 @@ describe('linkSrv', () => {
{}, {},
dataPointMock dataPointMock
).href ).href
).toEqual('/d/1?time=1000000000'); ).toEqual('/d/1?time=1000000001');
}); });
}); });
}); });
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