PanelData: Adds timeRange prop to PanelData (#19361)

* Refactor: Adds newTimeRange property to PanelData

* Refactor: Handles timeRange prop after requests

* Refactor: Makes timeRange mandatory

* Refactor: Adds DefaultTimeRange
This commit is contained in:
Hugo Häggmark
2019-09-25 02:19:17 -07:00
committed by Torkel Ödegaard
parent e35de167f9
commit 889f8e3131
16 changed files with 111 additions and 51 deletions

View File

@@ -41,3 +41,9 @@ export interface TimeOptions {
export type TimeFragment = string | DateTime;
export const TIME_FORMAT = 'YYYY-MM-DD HH:mm:ss';
export const DefaultTimeRange: TimeRange = {
from: {} as DateTime,
to: {} as DateTime,
raw: { from: '6h', to: 'now' },
};

View File

@@ -16,6 +16,8 @@ export interface PanelData {
series: DataFrame[];
request?: DataQueryRequest;
error?: DataQueryError;
// Contains the range from the request or a shifted time range if a request uses relative time
timeRange: TimeRange;
}
export interface PanelProps<T = any> {