From b3c34be6480f093bcbc9a56980266735c040929c Mon Sep 17 00:00:00 2001 From: Erik Sundell Date: Wed, 31 Oct 2018 13:55:40 +0100 Subject: [PATCH] stackdriver: cleanup --- .../stackdriver/StackdriverMetricFindQuery.ts | 8 ++++---- .../{SimpleDropdown.tsx => SimpleSelect.tsx} | 4 ++-- .../components/TemplateQueryComponent.tsx | 20 +++++++++---------- .../datasource/stackdriver/functions.ts | 2 +- 4 files changed, 17 insertions(+), 17 deletions(-) rename public/app/plugins/datasource/stackdriver/components/{SimpleDropdown.tsx => SimpleSelect.tsx} (89%) diff --git a/public/app/plugins/datasource/stackdriver/StackdriverMetricFindQuery.ts b/public/app/plugins/datasource/stackdriver/StackdriverMetricFindQuery.ts index 745b54ccef2..5a41efd3885 100644 --- a/public/app/plugins/datasource/stackdriver/StackdriverMetricFindQuery.ts +++ b/public/app/plugins/datasource/stackdriver/StackdriverMetricFindQuery.ts @@ -1,13 +1,13 @@ +import has from 'lodash/has'; +import isString from 'lodash/isString'; +import { alignmentPeriods } from './constants'; +import { MetricFindQueryTypes } from './types'; import { extractServicesFromMetricDescriptors, getMetricTypesByService, getAlignmentOptionsByMetric, getAggregationOptionsByMetric, } from './functions'; -import { alignmentPeriods } from './constants'; -import has from 'lodash/has'; -import isString from 'lodash/isString'; -import { MetricFindQueryTypes } from './types'; export default class StackdriverMetricFindQuery { constructor(private datasource) {} diff --git a/public/app/plugins/datasource/stackdriver/components/SimpleDropdown.tsx b/public/app/plugins/datasource/stackdriver/components/SimpleSelect.tsx similarity index 89% rename from public/app/plugins/datasource/stackdriver/components/SimpleDropdown.tsx rename to public/app/plugins/datasource/stackdriver/components/SimpleSelect.tsx index b701924333f..27ae63ace6d 100644 --- a/public/app/plugins/datasource/stackdriver/components/SimpleDropdown.tsx +++ b/public/app/plugins/datasource/stackdriver/components/SimpleSelect.tsx @@ -7,7 +7,7 @@ interface Props { label: string; } -const SimpleDropdown: SFC = props => { +const SimpleSelect: SFC = props => { const { label, onValueChange, value, options } = props; return (
@@ -25,4 +25,4 @@ const SimpleDropdown: SFC = props => { ); }; -export default SimpleDropdown; +export default SimpleSelect; diff --git a/public/app/plugins/datasource/stackdriver/components/TemplateQueryComponent.tsx b/public/app/plugins/datasource/stackdriver/components/TemplateQueryComponent.tsx index d37bd0102f1..4ddf585ccce 100644 --- a/public/app/plugins/datasource/stackdriver/components/TemplateQueryComponent.tsx +++ b/public/app/plugins/datasource/stackdriver/components/TemplateQueryComponent.tsx @@ -1,8 +1,8 @@ import React, { PureComponent } from 'react'; -import SimpleDropdown from './SimpleDropdown'; import { TemplateQueryProps } from 'app/types/plugins'; -import { getMetricTypes, extractServicesFromMetricDescriptors } from '../functions'; import defaultsDeep from 'lodash/defaultsDeep'; +import SimpleSelect from './SimpleSelect'; +import { getMetricTypes, extractServicesFromMetricDescriptors } from '../functions'; import { MetricFindQueryTypes, TemplateQueryComponentData } from '../types'; export class StackdriverTemplateQueryComponent extends PureComponent { @@ -109,7 +109,7 @@ export class StackdriverTemplateQueryComponent extends PureComponent l === this.state.labelKey) ? this.state.labelKey : labels[0]; result = { labels, labelKey }; } return result; @@ -119,7 +119,7 @@ export class StackdriverTemplateQueryComponent extends PureComponent - - - ({ value: l, name: l }))} onValueChange={this.onLabelKeyChange} @@ -159,13 +159,13 @@ export class StackdriverTemplateQueryComponent extends PureComponent - - - uniqBy(metricDescriptors, 'service');