From ef78f03a6fdf47b20dbf7f12424092b391ecd918 Mon Sep 17 00:00:00 2001
From: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
Date: Thu, 20 Oct 2022 14:49:55 +0200
Subject: [PATCH] Loki: Fix the name of exported component from
LokiQueryEditor.tsx (#57340)
* Loki: Fix editor
* Fix names
---
.../loki/components/LokiQueryEditor.test.tsx | 10 +++++-----
.../datasource/loki/components/LokiQueryEditor.tsx | 4 ++--
.../loki/components/LokiQueryEditorByApp.tsx | 4 ++--
3 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/public/app/plugins/datasource/loki/components/LokiQueryEditor.test.tsx b/public/app/plugins/datasource/loki/components/LokiQueryEditor.test.tsx
index 7e51ca468e8..6ffe2241290 100644
--- a/public/app/plugins/datasource/loki/components/LokiQueryEditor.test.tsx
+++ b/public/app/plugins/datasource/loki/components/LokiQueryEditor.test.tsx
@@ -10,7 +10,7 @@ import { LokiDatasource } from '../datasource';
import { EXPLAIN_LABEL_FILTER_CONTENT } from '../querybuilder/components/LokiQueryBuilderExplained';
import { LokiQuery, LokiQueryType } from '../types';
-import { LokiQueryEditorSelector } from './LokiQueryEditor';
+import { LokiQueryEditor } from './LokiQueryEditor';
jest.mock('@grafana/runtime', () => {
return {
@@ -65,13 +65,13 @@ const defaultProps = {
describe('LokiQueryEditorSelector', () => {
it('shows code editor if expr and nothing else', async () => {
// We opt for showing code editor for queries created before this feature was added
- render();
+ render();
expectCodeEditor();
});
it('shows builder if new query', async () => {
render(
- {
});
await switchToMode(QueryEditorMode.Builder);
rerender(
- ) {
const query = defaultsDeep(overrides ?? {}, cloneDeep(defaultQuery));
const onChange = jest.fn();
- const stuff = render();
+ const stuff = render();
return { onChange, ...stuff };
}
diff --git a/public/app/plugins/datasource/loki/components/LokiQueryEditor.tsx b/public/app/plugins/datasource/loki/components/LokiQueryEditor.tsx
index 96db3e59b08..b60a412d391 100644
--- a/public/app/plugins/datasource/loki/components/LokiQueryEditor.tsx
+++ b/public/app/plugins/datasource/loki/components/LokiQueryEditor.tsx
@@ -27,7 +27,7 @@ export const testIds = {
editor: 'loki-editor',
};
-export const LokiQueryEditorSelector = React.memo((props) => {
+export const LokiQueryEditor = React.memo((props) => {
const { onChange, onRunQuery, onAddQuery, data, app, queries } = props;
const [parseModalOpen, setParseModalOpen] = useState(false);
const [queryPatternsModalOpen, setQueryPatternsModalOpen] = useState(false);
@@ -162,4 +162,4 @@ export const LokiQueryEditorSelector = React.memo((props)
);
});
-LokiQueryEditorSelector.displayName = 'LokiQueryEditorSelector';
+LokiQueryEditor.displayName = 'LokiQueryEditor';
diff --git a/public/app/plugins/datasource/loki/components/LokiQueryEditorByApp.tsx b/public/app/plugins/datasource/loki/components/LokiQueryEditorByApp.tsx
index 4b987938d6c..0306583a312 100644
--- a/public/app/plugins/datasource/loki/components/LokiQueryEditorByApp.tsx
+++ b/public/app/plugins/datasource/loki/components/LokiQueryEditorByApp.tsx
@@ -2,7 +2,7 @@ import React, { memo } from 'react';
import { CoreApp } from '@grafana/data';
-import { LokiQueryEditorSelector } from './LokiQueryEditor';
+import { LokiQueryEditor } from './LokiQueryEditor';
import { LokiQueryEditorForAlerting } from './LokiQueryEditorForAlerting';
import { LokiQueryEditorProps } from './types';
@@ -13,7 +13,7 @@ export function LokiQueryEditorByApp(props: LokiQueryEditorProps) {
case CoreApp.CloudAlerting:
return ;
default:
- return ;
+ return ;
}
}