From a0f94866b4f5de98da536058c96ccae5fb097fcf Mon Sep 17 00:00:00 2001 From: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com> Date: Wed, 4 Aug 2021 10:23:16 -0400 Subject: [PATCH] Update dashboard loki query editor (#37541) --- .../datasource/loki/components/LokiQueryEditor.tsx | 3 ++- .../__snapshots__/LokiQueryEditor.test.tsx.snap | 12 ++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/public/app/plugins/datasource/loki/components/LokiQueryEditor.tsx b/public/app/plugins/datasource/loki/components/LokiQueryEditor.tsx index a6f719369a7..fbacad4abd7 100644 --- a/public/app/plugins/datasource/loki/components/LokiQueryEditor.tsx +++ b/public/app/plugins/datasource/loki/components/LokiQueryEditor.tsx @@ -8,7 +8,7 @@ import { LokiOptionFields } from './LokiOptionFields'; import { LokiQueryEditorProps } from './types'; export function LokiQueryEditor(props: LokiQueryEditorProps) { - const { query, data, datasource, onChange, onRunQuery } = props; + const { query, data, datasource, onChange, onRunQuery, range } = props; const onLegendChange = (e: React.SyntheticEvent) => { const nextQuery = { ...query, legendFormat: e.currentTarget.value }; @@ -47,6 +47,7 @@ export function LokiQueryEditor(props: LokiQueryEditorProps) { history={[]} data={data} data-testid={testIds.editor} + range={range} ExtraFieldElement={ <> `; @@ -115,5 +121,11 @@ exports[`Render LokiQueryEditor with legend should update timerange 1`] = ` "refId": "A", } } + range={ + Object { + "from": "2019-01-01T00:00:00.000Z", + "to": "2020-01-02T00:00:00.000Z", + } + } /> `;