From 114c8b64aa3ec7a42cc628e133ca6a74ae163c02 Mon Sep 17 00:00:00 2001 From: Gareth Dawson Date: Tue, 10 Jan 2023 12:35:12 +0000 Subject: [PATCH] Loki: Rename "explain" toggle to "explain query" (#61150) * feat: rename explain toggle to explain query * test: correct failing test for explain toggle * docs: update documentation on explain query toggle * fix: update capitalization --- docs/sources/datasources/loki/query-editor/index.md | 4 ++-- .../datasource/loki/components/LokiQueryEditor.test.tsx | 2 +- .../plugins/datasource/loki/components/LokiQueryEditor.tsx | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/sources/datasources/loki/query-editor/index.md b/docs/sources/datasources/loki/query-editor/index.md index 9beeea1ca21..28a9948489b 100644 --- a/docs/sources/datasources/loki/query-editor/index.md +++ b/docs/sources/datasources/loki/query-editor/index.md @@ -125,9 +125,9 @@ To re-order operations manually, drag the operation box by its name and drop it In same cases the query editor can detect which operations would be most appropriate for a selected log stream. In such cases it will show a hint next to the `+ Operations` button. Click on the hint to add the operations to your query. -### Explain mode +### Explain query -Explain mode helps with understanding the query. It shows a step by step explanation of all query parts and the operations. +This section is only shown if the `Explain query` switch from the query editor top toolbar is set to `on`. It shows a step by step explanation of all query parts and the operations. ### Raw query diff --git a/public/app/plugins/datasource/loki/components/LokiQueryEditor.test.tsx b/public/app/plugins/datasource/loki/components/LokiQueryEditor.test.tsx index 69df9eae73a..28efdb5e183 100644 --- a/public/app/plugins/datasource/loki/components/LokiQueryEditor.test.tsx +++ b/public/app/plugins/datasource/loki/components/LokiQueryEditor.test.tsx @@ -107,7 +107,7 @@ describe('LokiQueryEditorSelector', () => { it('Can enable explain', async () => { renderWithMode(QueryEditorMode.Builder); expect(screen.queryByText(EXPLAIN_LABEL_FILTER_CONTENT)).not.toBeInTheDocument(); - screen.getByLabelText('Explain').click(); + screen.getByLabelText('Explain query').click(); expect(await screen.findByText(EXPLAIN_LABEL_FILTER_CONTENT)).toBeInTheDocument(); }); diff --git a/public/app/plugins/datasource/loki/components/LokiQueryEditor.tsx b/public/app/plugins/datasource/loki/components/LokiQueryEditor.tsx index 36ac3174b7f..771103990e7 100644 --- a/public/app/plugins/datasource/loki/components/LokiQueryEditor.tsx +++ b/public/app/plugins/datasource/loki/components/LokiQueryEditor.tsx @@ -136,7 +136,7 @@ export const LokiQueryEditor = React.memo((props) => { Label browser - + {app !== CoreApp.Explore && (