Form migrations: Switch to LegacyForms namespace (#23357)

* Move Switch to Legacy namespace

* Make story internal

* Fix import
This commit is contained in:
Tobias Skarhed
2020-04-07 08:50:54 +02:00
committed by GitHub
parent d6b8aaa7b0
commit 553f50e4f5
27 changed files with 52 additions and 42 deletions

View File

@@ -1,5 +1,6 @@
import React, { ChangeEvent } from 'react';
import { Switch } from '@grafana/ui';
import { LegacyForms } from '@grafana/ui';
const { Switch } = LegacyForms;
import { PanelData } from '@grafana/data';
import { CloudWatchQuery, AnnotationQuery } from '../types';
import CloudWatchDatasource from '../datasource';

View File

@@ -1,7 +1,7 @@
import React, { PureComponent, ChangeEvent } from 'react';
import { ExploreQueryFieldProps } from '@grafana/data';
import { LegacyForms, ValidationEvents, EventsWithValidation, Switch } from '@grafana/ui';
const { Input } = LegacyForms;
import { LegacyForms, ValidationEvents, EventsWithValidation } from '@grafana/ui';
const { Input, Switch } = LegacyForms;
import isEmpty from 'lodash/isEmpty';
import { CloudWatchQuery } from '../types';
import CloudWatchDatasource from '../datasource';

View File

@@ -1,8 +1,8 @@
import React, { PureComponent, ChangeEvent } from 'react';
import { SelectableValue } from '@grafana/data';
import { AzureCredentialsForm } from './AzureCredentialsForm';
import { Switch, FormLabel, LegacyForms, Button } from '@grafana/ui';
const { Select } = LegacyForms;
import { FormLabel, LegacyForms, Button } from '@grafana/ui';
const { Select, Switch } = LegacyForms;
import { AzureDataSourceSettings } from '../types';
export interface State {

View File

@@ -1,6 +1,6 @@
import React, { PureComponent } from 'react';
import { DataSourceHttpSettings, FormLabel, LegacyForms, Switch } from '@grafana/ui';
const { Select } = LegacyForms;
import { DataSourceHttpSettings, FormLabel, LegacyForms } from '@grafana/ui';
const { Select, Switch } = LegacyForms;
import {
DataSourcePluginOptionsEditorProps,
onUpdateDatasourceJsonDataOptionSelect,

View File

@@ -1,6 +1,7 @@
import React, { useState } from 'react';
import { css } from 'emotion';
import { Button, FormField, DataLinkInput, stylesFactory, Switch } from '@grafana/ui';
import { Button, FormField, DataLinkInput, stylesFactory, LegacyForms } from '@grafana/ui';
const { Switch } = LegacyForms;
import { VariableSuggestion } from '@grafana/data';
import { DataSourceSelectItem } from '@grafana/data';

View File

@@ -2,10 +2,10 @@ import _ from 'lodash';
import React, { PureComponent } from 'react';
// Types
import { FormLabel, LegacyForms, Switch } from '@grafana/ui';
import { FormLabel, LegacyForms } from '@grafana/ui';
import { SelectableValue, QueryEditorProps } from '@grafana/data';
const { Select } = LegacyForms;
const { Select, Switch } = LegacyForms;
import { PrometheusDatasource } from '../datasource';
import { PromQuery, PromOptions } from '../types';

View File

@@ -2,7 +2,8 @@
import React, { PureComponent, ChangeEvent } from 'react';
// Components
import { PanelOptionsGroup, PanelOptionsGrid, Switch, FormField, FormLabel } from '@grafana/ui';
import { PanelOptionsGroup, PanelOptionsGrid, FormField, FormLabel, LegacyForms } from '@grafana/ui';
const { Switch } = LegacyForms;
import { PanelEditorProps, toIntegerOrUndefined, toNumberString } from '@grafana/data';

View File

@@ -7,13 +7,12 @@ import {
PanelOptionsGroup,
FormLabel,
LegacyForms,
Switch,
FieldPropertiesEditor,
ThresholdsEditor,
LegacyValueMappingsEditor,
DataLinksEditor,
} from '@grafana/ui';
const { Select } = LegacyForms;
const { Select, Switch } = LegacyForms;
import {
DataLink,
FieldConfig,

View File

@@ -3,13 +3,14 @@ import React, { PureComponent } from 'react';
import {
PanelOptionsGrid,
FieldDisplayEditor,
Switch,
LegacyForms,
PanelOptionsGroup,
FieldPropertiesEditor,
ThresholdsEditor,
LegacyValueMappingsEditor,
DataLinksEditor,
} from '@grafana/ui';
const { Switch } = LegacyForms;
import {
PanelEditorProps,
ReduceDataOptions,

View File

@@ -1,6 +1,6 @@
import React from 'react';
import { LegendOptions, PanelOptionsGroup, Switch, LegacyForms, StatsPicker } from '@grafana/ui';
const { Input } = LegacyForms;
import { LegendOptions, PanelOptionsGroup, LegacyForms, StatsPicker } from '@grafana/ui';
const { Input, Switch } = LegacyForms;
export interface GraphLegendEditorLegendOptions extends LegendOptions {
stats?: string[];

View File

@@ -5,7 +5,6 @@ import React, { PureComponent } from 'react';
// Types
import { FieldConfig, PanelEditorProps } from '@grafana/data';
import {
Switch,
LegendOptions,
GraphTooltipOptions,
PanelOptionsGrid,
@@ -13,7 +12,7 @@ import {
LegacyForms,
FieldPropertiesEditor,
} from '@grafana/ui';
const { Select } = LegacyForms;
const { Select, Switch } = LegacyForms;
import { Options, GraphOptions } from './types';
import { GraphLegendEditor } from './GraphLegendEditor';
import { NewPanelEditorContext } from 'app/features/dashboard/components/PanelEditor/PanelEditor';

View File

@@ -1,7 +1,7 @@
// Libraries
import React, { PureComponent } from 'react';
import { Switch, PanelOptionsGrid, PanelOptionsGroup, FormLabel, LegacyForms } from '@grafana/ui';
const { Select } = LegacyForms;
import { PanelOptionsGrid, PanelOptionsGroup, FormLabel, LegacyForms } from '@grafana/ui';
const { Select, Switch } = LegacyForms;
// Types
import { Options } from './types';

View File

@@ -4,7 +4,8 @@ import React, { PureComponent } from 'react';
// Types
import { PanelEditorProps } from '@grafana/data';
import { Switch } from '@grafana/ui';
import { LegacyForms } from '@grafana/ui';
const { Switch } = LegacyForms;
import { Options } from './types';
export class TablePanelEditor extends PureComponent<PanelEditorProps<Options>> {