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 {
if (dataPoint) {
info.href = this.templateSrv.replace(
info.href,
this.getDataPointVars(dataPoint.seriesName, dateTime(dataPoint[0]))
this.getDataPointVars(dataPoint.seriesName, dateTime(dataPoint.datapoint[0]))
);
}
......
......@@ -11,7 +11,7 @@ jest.mock('angular', () => {
const dataPointMock = {
seriesName: 'A-series',
datapoint: [1000000000, 1],
datapoint: [1000000001, 1],
};
describe('linkSrv', () => {
......@@ -119,7 +119,7 @@ describe('linkSrv', () => {
{},
dataPointMock
).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