mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Loki Query Editor: Make Monaco the default editor (#62247)
* feat(loki-editor): remove slate and make Monaco the default editor * feat(loki-editor): remove unsupported usages of onBlur * feat(loki-editor): remove monaco feature flag * Chore: remove unused import
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
import { render, screen } from '@testing-library/react';
|
||||
import React from 'react';
|
||||
|
||||
import { config } from '@grafana/runtime';
|
||||
|
||||
import { createLokiDatasource } from '../../mocks';
|
||||
import { LokiQuery } from '../../types';
|
||||
|
||||
@@ -27,10 +25,6 @@ const createDefaultProps = () => {
|
||||
return props;
|
||||
};
|
||||
|
||||
beforeAll(() => {
|
||||
config.featureToggles.lokiMonacoEditor = true;
|
||||
});
|
||||
|
||||
describe('LokiQueryCodeEditor', () => {
|
||||
it('shows explain section when showExplain is true', async () => {
|
||||
const props = createDefaultProps();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { css } from '@emotion/css';
|
||||
import React from 'react';
|
||||
|
||||
import { CoreApp, GrafanaTheme2 } from '@grafana/data';
|
||||
import { GrafanaTheme2 } from '@grafana/data';
|
||||
import { useStyles2 } from '@grafana/ui';
|
||||
|
||||
import { testIds } from '../../components/LokiQueryEditor';
|
||||
@@ -27,15 +27,6 @@ export function LokiQueryCodeEditor({
|
||||
}: Props) {
|
||||
const styles = useStyles2(getStyles);
|
||||
|
||||
// the inner QueryField works like this when a blur event happens:
|
||||
// - if it has an onBlur prop, it calls it
|
||||
// - else it calls onRunQuery (some extra conditions apply)
|
||||
//
|
||||
// we want it to not do anything when a blur event happens in explore mode,
|
||||
// so we set an empty-function in such case. otherwise we set `undefined`,
|
||||
// which will cause it to run the query when blur happens.
|
||||
const onBlur = app === CoreApp.Explore ? () => undefined : undefined;
|
||||
|
||||
return (
|
||||
<div className={styles.wrapper}>
|
||||
<LokiQueryField
|
||||
@@ -44,7 +35,6 @@ export function LokiQueryCodeEditor({
|
||||
range={range}
|
||||
onRunQuery={onRunQuery}
|
||||
onChange={onChange}
|
||||
onBlur={onBlur}
|
||||
history={history}
|
||||
data={data}
|
||||
app={app}
|
||||
|
||||
Reference in New Issue
Block a user