mirror of
https://github.com/grafana/grafana.git
synced 2025-09-24 21:14:07 +08:00

* 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.
19 lines
562 B
TypeScript
19 lines
562 B
TypeScript
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);
|