diff --git a/public/app/plugins/datasource/stackdriver/annotations_query_ctrl.ts b/public/app/plugins/datasource/stackdriver/annotations_query_ctrl.ts index 8827e9e9746..c4d6c137f35 100644 --- a/public/app/plugins/datasource/stackdriver/annotations_query_ctrl.ts +++ b/public/app/plugins/datasource/stackdriver/annotations_query_ctrl.ts @@ -1,7 +1,9 @@ +import { TemplateSrv } from 'app/features/templating/template_srv'; + export class StackdriverAnnotationsQueryCtrl { static templateUrl = 'partials/annotations.editor.html'; annotation: any; - templateSrv: any; + templateSrv: TemplateSrv; /** @ngInject */ constructor(templateSrv) { diff --git a/public/app/plugins/datasource/stackdriver/components/Aggregations.test.tsx b/public/app/plugins/datasource/stackdriver/components/Aggregations.test.tsx index 160dd4d2105..2402cc5da2c 100644 --- a/public/app/plugins/datasource/stackdriver/components/Aggregations.test.tsx +++ b/public/app/plugins/datasource/stackdriver/components/Aggregations.test.tsx @@ -3,10 +3,11 @@ import renderer from 'react-test-renderer'; import { Aggregations, Props } from './Aggregations'; import { shallow } from 'enzyme'; import { ValueTypes, MetricKind } from '../constants'; +import { TemplateSrvStub } from 'test/specs/helpers'; const props: Props = { onChange: () => {}, - templateSrv: {}, + templateSrv: new TemplateSrvStub(), metricDescriptor: { valueType: '', metricKind: '', diff --git a/public/app/plugins/datasource/stackdriver/components/Aggregations.tsx b/public/app/plugins/datasource/stackdriver/components/Aggregations.tsx index d20c70ca72d..c616d55ba7a 100644 --- a/public/app/plugins/datasource/stackdriver/components/Aggregations.tsx +++ b/public/app/plugins/datasource/stackdriver/components/Aggregations.tsx @@ -3,10 +3,11 @@ import _ from 'lodash'; import { MetricSelect } from 'app/core/components/Select/MetricSelect'; import { getAggregationOptionsByMetric } from '../functions'; +import { TemplateSrv } from 'app/features/templating/template_srv'; export interface Props { onChange: (metricDescriptor) => void; - templateSrv: any; + templateSrv: TemplateSrv; metricDescriptor: { valueType: string; metricKind: string; diff --git a/public/app/plugins/datasource/stackdriver/components/AlignmentPeriods.tsx b/public/app/plugins/datasource/stackdriver/components/AlignmentPeriods.tsx index db7d1c3ba86..0a8715714da 100644 --- a/public/app/plugins/datasource/stackdriver/components/AlignmentPeriods.tsx +++ b/public/app/plugins/datasource/stackdriver/components/AlignmentPeriods.tsx @@ -4,10 +4,11 @@ import _ from 'lodash'; import kbn from 'app/core/utils/kbn'; import { MetricSelect } from 'app/core/components/Select/MetricSelect'; import { alignmentPeriods, alignOptions } from '../constants'; +import { TemplateSrv } from 'app/features/templating/template_srv'; export interface Props { onChange: (alignmentPeriod) => void; - templateSrv: any; + templateSrv: TemplateSrv; alignmentPeriod: string; perSeriesAligner: string; usedAlignmentPeriod: string; diff --git a/public/app/plugins/datasource/stackdriver/components/Alignments.tsx b/public/app/plugins/datasource/stackdriver/components/Alignments.tsx index cb174f6fbec..b97cce9e620 100644 --- a/public/app/plugins/datasource/stackdriver/components/Alignments.tsx +++ b/public/app/plugins/datasource/stackdriver/components/Alignments.tsx @@ -2,11 +2,13 @@ import React, { SFC } from 'react'; import _ from 'lodash'; import { MetricSelect } from 'app/core/components/Select/MetricSelect'; +import { TemplateSrv } from 'app/features/templating/template_srv'; +import { SelectOptionItem } from '@grafana/ui'; export interface Props { onChange: (perSeriesAligner) => void; - templateSrv: any; - alignOptions: any[]; + templateSrv: TemplateSrv; + alignOptions: SelectOptionItem[]; perSeriesAligner: string; } diff --git a/public/app/plugins/datasource/stackdriver/components/Filter.tsx b/public/app/plugins/datasource/stackdriver/components/Filter.tsx index 7cd14235ab3..6c63f1ed891 100644 --- a/public/app/plugins/datasource/stackdriver/components/Filter.tsx +++ b/public/app/plugins/datasource/stackdriver/components/Filter.tsx @@ -4,16 +4,18 @@ import appEvents from 'app/core/app_events'; import { QueryMeta } from '../types'; import { getAngularLoader, AngularComponent } from 'app/core/services/AngularLoader'; +import { TemplateSrv } from 'app/features/templating/template_srv'; +import StackdriverDatasource from '../datasource'; import '../query_filter_ctrl'; export interface Props { filtersChanged: (filters: string[]) => void; groupBysChanged?: (groupBys: string[]) => void; metricType: string; - templateSrv: any; + templateSrv: TemplateSrv; groupBys?: string[]; filters: string[]; - datasource: any; + datasource: StackdriverDatasource; refId: string; hideGroupBys: boolean; } diff --git a/public/app/plugins/datasource/stackdriver/components/Metrics.tsx b/public/app/plugins/datasource/stackdriver/components/Metrics.tsx index fbd7ad8f735..39a0c45cca1 100644 --- a/public/app/plugins/datasource/stackdriver/components/Metrics.tsx +++ b/public/app/plugins/datasource/stackdriver/components/Metrics.tsx @@ -5,10 +5,11 @@ import StackdriverDatasource from '../datasource'; import appEvents from 'app/core/app_events'; import { MetricDescriptor } from '../types'; import { MetricSelect } from 'app/core/components/Select/MetricSelect'; +import { TemplateSrv } from 'app/features/templating/template_srv'; export interface Props { onChange: (metricDescriptor: MetricDescriptor) => void; - templateSrv: any; + templateSrv: TemplateSrv; datasource: StackdriverDatasource; defaultProject: string; metricType: string; diff --git a/public/app/plugins/datasource/stackdriver/components/QueryEditor.test.tsx b/public/app/plugins/datasource/stackdriver/components/QueryEditor.test.tsx index b4fc02fb24a..b8830d4fd11 100644 --- a/public/app/plugins/datasource/stackdriver/components/QueryEditor.test.tsx +++ b/public/app/plugins/datasource/stackdriver/components/QueryEditor.test.tsx @@ -11,7 +11,7 @@ const props: Props = { datasource: { getDefaultProject: () => Promise.resolve('project'), getMetricTypes: () => Promise.resolve([]), - }, + } as any, templateSrv: new TemplateSrv(), }; diff --git a/public/app/plugins/datasource/stackdriver/components/QueryEditor.tsx b/public/app/plugins/datasource/stackdriver/components/QueryEditor.tsx index 6af66bad579..94521041416 100644 --- a/public/app/plugins/datasource/stackdriver/components/QueryEditor.tsx +++ b/public/app/plugins/datasource/stackdriver/components/QueryEditor.tsx @@ -12,18 +12,20 @@ import { AliasBy } from './AliasBy'; import { Help } from './Help'; import { Target, MetricDescriptor } from '../types'; import { getAlignmentPickerData } from '../functions'; +import StackdriverDatasource from '../datasource'; +import { SelectOptionItem } from '@grafana/ui'; export interface Props { onQueryChange: (target: Target) => void; onExecuteQuery: () => void; target: Target; events: any; - datasource: any; + datasource: StackdriverDatasource; templateSrv: TemplateSrv; } interface State extends Target { - alignOptions: any[]; + alignOptions: SelectOptionItem[]; lastQuery: string; lastQueryError: string; [key: string]: any; diff --git a/public/app/plugins/datasource/stackdriver/components/__snapshots__/QueryEditor.test.tsx.snap b/public/app/plugins/datasource/stackdriver/components/__snapshots__/QueryEditor.test.tsx.snap index c93b062c31e..1ae6d157bf2 100644 --- a/public/app/plugins/datasource/stackdriver/components/__snapshots__/QueryEditor.test.tsx.snap +++ b/public/app/plugins/datasource/stackdriver/components/__snapshots__/QueryEditor.test.tsx.snap @@ -436,9 +436,9 @@ Array [ onClick={[Function]} >