فهرست منبع

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

Dominik Prokop 6 سال پیش
والد
کامیت
20d0c07359
2فایلهای تغییر یافته به همراه3 افزوده شده و 3 حذف شده
  1. 1 1
      public/app/features/panel/panellinks/link_srv.ts
  2. 2 2
      public/app/features/panel/panellinks/specs/link_srv.test.ts

+ 1 - 1
public/app/features/panel/panellinks/link_srv.ts

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

+ 2 - 2
public/app/features/panel/panellinks/specs/link_srv.test.ts

@@ -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', () => {
           {},
           {},
           dataPointMock
           dataPointMock
         ).href
         ).href
-      ).toEqual('/d/1?time=1000000000');
+      ).toEqual('/d/1?time=1000000001');
     });
     });
   });
   });
 });
 });