mirror of https://github.com/grafana/grafana.git
use typings for ds and template srv
This commit is contained in:
parent
3871ef29f9
commit
b596550210
|
|
@ -1,6 +1,9 @@
|
|||
import React from 'react';
|
||||
import _ from 'lodash';
|
||||
|
||||
import { TemplateSrv } from 'app/features/templating/template_srv';
|
||||
|
||||
import StackdriverDatasource from '../datasource';
|
||||
import { Metrics } from './Metrics';
|
||||
import { Filter } from './Filter';
|
||||
import { AnnotationTarget } from '../types';
|
||||
|
|
@ -9,8 +12,8 @@ import { AnnotationsHelp } from './AnnotationsHelp';
|
|||
export interface Props {
|
||||
onQueryChange: (target: AnnotationTarget) => void;
|
||||
target: AnnotationTarget;
|
||||
datasource: any;
|
||||
templateSrv: any;
|
||||
datasource: StackdriverDatasource;
|
||||
templateSrv: TemplateSrv;
|
||||
}
|
||||
|
||||
interface State extends AnnotationTarget {
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
import React from 'react';
|
||||
import { Project } from './Project';
|
||||
import StackdriverDatasource from '../datasource';
|
||||
|
||||
export interface Props {
|
||||
datasource: any;
|
||||
datasource: StackdriverDatasource;
|
||||
rawQuery: string;
|
||||
lastQueryError: string;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import React from 'react';
|
||||
import _ from 'lodash';
|
||||
|
||||
import StackdriverDatasource from '../datasource';
|
||||
import appEvents from 'app/core/app_events';
|
||||
import { MetricDescriptor } from '../types';
|
||||
import { MetricSelect } from 'app/core/components/Select/MetricSelect';
|
||||
|
|
@ -8,7 +9,7 @@ import { MetricSelect } from 'app/core/components/Select/MetricSelect';
|
|||
export interface Props {
|
||||
onChange: (metricDescriptor: MetricDescriptor) => void;
|
||||
templateSrv: any;
|
||||
datasource: any;
|
||||
datasource: StackdriverDatasource;
|
||||
defaultProject: string;
|
||||
metricType: string;
|
||||
children?: (renderProps: any) => JSX.Element;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
import React from 'react';
|
||||
import StackdriverDatasource from '../datasource';
|
||||
|
||||
export interface Props {
|
||||
datasource: any;
|
||||
datasource: StackdriverDatasource;
|
||||
}
|
||||
|
||||
interface State {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import React from 'react';
|
||||
import renderer from 'react-test-renderer';
|
||||
import { QueryEditor, Props, DefaultTarget } from './QueryEditor';
|
||||
import { TemplateSrv } from 'app/features/templating/template_srv';
|
||||
|
||||
const props: Props = {
|
||||
onQueryChange: target => {},
|
||||
|
|
@ -8,10 +9,10 @@ const props: Props = {
|
|||
target: DefaultTarget,
|
||||
events: { on: () => {} },
|
||||
datasource: {
|
||||
getDefaultProject: () => 'project',
|
||||
getMetricTypes: () => [],
|
||||
getDefaultProject: () => Promise.resolve('project'),
|
||||
getMetricTypes: () => Promise.resolve([]),
|
||||
},
|
||||
templateSrv: { variables: [] },
|
||||
templateSrv: new TemplateSrv(),
|
||||
};
|
||||
|
||||
describe('QueryEditor', () => {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
import React from 'react';
|
||||
import _ from 'lodash';
|
||||
|
||||
import { TemplateSrv } from 'app/features/templating/template_srv';
|
||||
|
||||
import { Metrics } from './Metrics';
|
||||
import { Filter } from './Filter';
|
||||
import { Aggregations } from './Aggregations';
|
||||
|
|
@ -17,7 +19,7 @@ export interface Props {
|
|||
target: Target;
|
||||
events: any;
|
||||
datasource: any;
|
||||
templateSrv: any;
|
||||
templateSrv: TemplateSrv;
|
||||
}
|
||||
|
||||
interface State extends Target {
|
||||
|
|
|
|||
Loading…
Reference in New Issue