mirror of
https://github.com/grafana/grafana.git
synced 2025-02-20 11:48:34 -06:00
* Add and configure eslint-plugin-import * Fix the lint:ts npm command * Autofix + prettier all the files * Manually fix remaining files * Move jquery code in jest-setup to external file to safely reorder imports * Resolve issue caused by circular dependencies within Prometheus * Update .betterer.results * Fix missing // @ts-ignore * ignore iconBundle.ts * Fix missing // @ts-ignore
33 lines
1.1 KiB
TypeScript
33 lines
1.1 KiB
TypeScript
import React, { memo } from 'react';
|
|
|
|
import { CoreApp } from '@grafana/data';
|
|
import { config } from '@grafana/runtime';
|
|
|
|
import { LokiQueryEditorSelector } from '../querybuilder/components/LokiQueryEditorSelector';
|
|
|
|
import { LokiExploreQueryEditor } from './LokiExploreQueryEditor';
|
|
import { LokiQueryEditor } from './LokiQueryEditor';
|
|
import { LokiQueryEditorForAlerting } from './LokiQueryEditorForAlerting';
|
|
import { LokiQueryEditorProps } from './types';
|
|
|
|
export function LokiQueryEditorByApp(props: LokiQueryEditorProps) {
|
|
const { app } = props;
|
|
|
|
switch (app) {
|
|
case CoreApp.CloudAlerting:
|
|
return <LokiQueryEditorForAlerting {...props} />;
|
|
case CoreApp.Explore:
|
|
if (config.featureToggles.lokiQueryBuilder) {
|
|
return <LokiQueryEditorSelector {...props} />;
|
|
}
|
|
return <LokiExploreQueryEditor {...props} />;
|
|
default:
|
|
if (config.featureToggles.lokiQueryBuilder) {
|
|
return <LokiQueryEditorSelector {...props} />;
|
|
}
|
|
return <LokiQueryEditor {...props} />;
|
|
}
|
|
}
|
|
|
|
export default memo(LokiQueryEditorByApp);
|