From 03856b4e55e36fed2f81de591a742a982ffb2530 Mon Sep 17 00:00:00 2001 From: Erik Sundell Date: Wed, 19 Dec 2018 21:44:38 +0100 Subject: [PATCH] move component to components dir. also move directive registration out from datasource --- public/app/core/angular_wrappers.ts | 11 +++++++++++ .../components/Select/MetricSelect.tsx} | 4 ++-- .../stackdriver/partials/query.aggregation.html | 12 ++++++------ .../stackdriver/partials/query.filter.html | 8 ++++---- .../app/plugins/datasource/stackdriver/query_ctrl.ts | 12 ------------ 5 files changed, 23 insertions(+), 24 deletions(-) rename public/app/{plugins/datasource/stackdriver/components/StackdriverPicker.tsx => core/components/Select/MetricSelect.tsx} (94%) diff --git a/public/app/core/angular_wrappers.ts b/public/app/core/angular_wrappers.ts index 5609c058a27..004d8eb12c5 100644 --- a/public/app/core/angular_wrappers.ts +++ b/public/app/core/angular_wrappers.ts @@ -5,6 +5,7 @@ import EmptyListCTA from './components/EmptyListCTA/EmptyListCTA'; import { SearchResult } from './components/search/SearchResult'; import { TagFilter } from './components/TagFilter/TagFilter'; import { SideMenu } from './components/sidemenu/SideMenu'; +import { MetricSelect } from './components/Select/MetricSelect'; import AppNotificationList from './components/AppNotifications/AppNotificationList'; export function registerAngularDirectives() { @@ -19,4 +20,14 @@ export function registerAngularDirectives() { ['onChange', { watchDepth: 'reference' }], ['tagOptions', { watchDepth: 'reference' }], ]); + react2AngularDirective('metricSelect', MetricSelect, [ + 'options', + 'onChange', + 'value', + 'isSearchable', + 'className', + 'placeholder', + 'groupName', + ['variables', { watchDepth: 'reference' }], + ]); } diff --git a/public/app/plugins/datasource/stackdriver/components/StackdriverPicker.tsx b/public/app/core/components/Select/MetricSelect.tsx similarity index 94% rename from public/app/plugins/datasource/stackdriver/components/StackdriverPicker.tsx rename to public/app/core/components/Select/MetricSelect.tsx index 49862bb2023..03d700f1ef4 100644 --- a/public/app/plugins/datasource/stackdriver/components/StackdriverPicker.tsx +++ b/public/app/core/components/Select/MetricSelect.tsx @@ -1,7 +1,7 @@ import React from 'react'; import _ from 'lodash'; -import Select from 'app/core/components/Select/Select'; +import Select from './Select'; import { Variable } from 'app/types/templates'; export interface Props { @@ -19,7 +19,7 @@ interface State { options: any[]; } -export class StackdriverPicker extends React.Component { +export class MetricSelect extends React.Component { static defaultProps = { variables: [], options: [], diff --git a/public/app/plugins/datasource/stackdriver/partials/query.aggregation.html b/public/app/plugins/datasource/stackdriver/partials/query.aggregation.html index 122f14a9cb6..2dc9035c7fe 100755 --- a/public/app/plugins/datasource/stackdriver/partials/query.aggregation.html +++ b/public/app/plugins/datasource/stackdriver/partials/query.aggregation.html @@ -1,7 +1,7 @@
- + >