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

This commit is contained in:
Dominik Prokop 2019-08-08 16:30:01 +02:00 committed by GitHub
parent 7520166f17
commit 20d0c07359
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -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]))
);
}

View File

@ -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');
});
});
});