Alerting: app specific query editors for Loki and Prometheus (#34365)

* Adding simplified version of query editor based on app flag.

* cleaned up the absolute time range.

* changing placeholder text.

* updated snapshot.

* added some tests.

* adding loki query editor tests.

* updating snapshots.
This commit is contained in:
Marcus Andersson
2021-05-19 16:24:27 +02:00
committed by GitHub
parent f48708bb9e
commit 8ddf6de6e7
23 changed files with 333 additions and 68 deletions

View File

@@ -0,0 +1,18 @@
import React, { memo } from 'react';
import { CoreApp } from '@grafana/data';
import { PromQueryEditorProps } from './types';
import { PromQueryEditor } from './PromQueryEditor';
import { PromQueryEditorForAlerting } from './PromQueryEditorForAlerting';
export function PromQueryEditorByApp(props: PromQueryEditorProps) {
const { app } = props;
switch (app) {
case CoreApp.CloudAlerting:
return <PromQueryEditorForAlerting {...props} />;
default:
return <PromQueryEditor {...props} />;
}
}
export default memo(PromQueryEditorByApp);