Loki, Prometheus: Fix passing of query with defaults to code mode (#53646) (#53662)

(cherry picked from commit fde5147d71)

Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
This commit is contained in:
Grot (@grafanabot)
2022-08-12 16:56:05 +02:00
committed by GitHub
co-authored by Ivana Huckova
parent 82a1095f9e
commit e3a54dd3c6
2 changed files with 2 additions and 2 deletions
@@ -130,7 +130,7 @@ export const LokiQueryEditorSelector = React.memo<LokiQueryEditorProps>((props)
<Space v={0.5} />
<EditorRows>
{editorMode === QueryEditorMode.Code && (
<LokiQueryCodeEditor {...props} onChange={onChangeInternal} showExplain={explain} />
<LokiQueryCodeEditor {...props} query={query} onChange={onChangeInternal} showExplain={explain} />
)}
{editorMode === QueryEditorMode.Builder && (
<LokiQueryBuilderContainer
@@ -127,7 +127,7 @@ export const PromQueryEditorSelector = React.memo<Props>((props) => {
</EditorHeader>
<Space v={0.5} />
<EditorRows>
{editorMode === QueryEditorMode.Code && <PromQueryCodeEditor {...props} showExplain={explain} />}
{editorMode === QueryEditorMode.Code && <PromQueryCodeEditor {...props} query={query} showExplain={explain} />}
{editorMode === QueryEditorMode.Builder && (
<PromQueryBuilderContainer
query={query}