From 553f50e4f5b9408122eb9a587aae4973dc5c9af4 Mon Sep 17 00:00:00 2001 From: Tobias Skarhed <1438972+tskarhed@users.noreply.github.com> Date: Tue, 7 Apr 2020 08:50:54 +0200 Subject: [PATCH] Form migrations: Switch to LegacyForms namespace (#23357) * Move Switch to Legacy namespace * Make story internal * Fix import --- .../src/components/DataLinks/DataLinkEditor.tsx | 3 ++- .../{Switch.story.tsx => Switch.story.internal.tsx} | 0 packages/grafana-ui/src/components/index.ts | 8 ++++---- public/app/features/api-keys/ApiKeysPage.tsx | 4 ++-- .../dashboard/components/ShareModal/ShareEmbed.tsx | 4 ++-- .../dashboard/components/ShareModal/ShareExport.tsx | 3 ++- .../dashboard/components/ShareModal/ShareLink.tsx | 4 ++-- .../features/dashboard/components/SubMenu/Annotations.tsx | 3 ++- .../app/features/dashboard/panel_editor/QueryOptions.tsx | 4 ++-- .../app/features/datasources/settings/BasicSettings.tsx | 4 ++-- public/app/features/explore/Logs.tsx | 3 ++- .../features/variables/editor/SelectionOptionsEditor.tsx | 3 ++- .../variables/interval/IntervalVariableEditor.tsx | 3 ++- .../app/features/variables/query/QueryVariableEditor.tsx | 3 ++- .../cloudwatch/components/AnnotationQueryEditor.tsx | 3 ++- .../datasource/cloudwatch/components/QueryEditor.tsx | 4 ++-- .../components/AnalyticsConfig.tsx | 4 ++-- .../datasource/graphite/configuration/ConfigEditor.tsx | 4 ++-- .../datasource/loki/configuration/DerivedField.tsx | 3 ++- .../datasource/prometheus/components/PromQueryEditor.tsx | 4 ++-- public/app/plugins/panel/annolist/AnnoListEditor.tsx | 3 ++- public/app/plugins/panel/bargauge/BarGaugePanelEditor.tsx | 3 +-- public/app/plugins/panel/gauge/GaugePanelEditor.tsx | 3 ++- public/app/plugins/panel/graph2/GraphLegendEditor.tsx | 4 ++-- public/app/plugins/panel/graph2/GraphPanelEditor.tsx | 3 +-- public/app/plugins/panel/logs/LogsPanelEditor.tsx | 4 ++-- public/app/plugins/panel/table2/TablePanelEditor.tsx | 3 ++- 27 files changed, 52 insertions(+), 42 deletions(-) rename packages/grafana-ui/src/components/Switch/{Switch.story.tsx => Switch.story.internal.tsx} (100%) diff --git a/packages/grafana-ui/src/components/DataLinks/DataLinkEditor.tsx b/packages/grafana-ui/src/components/DataLinks/DataLinkEditor.tsx index ac1d57190d5..d95ce24a526 100644 --- a/packages/grafana-ui/src/components/DataLinks/DataLinkEditor.tsx +++ b/packages/grafana-ui/src/components/DataLinks/DataLinkEditor.tsx @@ -1,6 +1,7 @@ import React, { ChangeEvent, useContext } from 'react'; import { DataLink, VariableSuggestion, GrafanaTheme } from '@grafana/data'; -import { FormField, Switch } from '../index'; +import { FormField } from '../index'; +import { Switch } from '../Switch/Switch'; import { css } from 'emotion'; import { ThemeContext, stylesFactory } from '../../themes/index'; import { DataLinkInput } from './DataLinkInput'; diff --git a/packages/grafana-ui/src/components/Switch/Switch.story.tsx b/packages/grafana-ui/src/components/Switch/Switch.story.internal.tsx similarity index 100% rename from packages/grafana-ui/src/components/Switch/Switch.story.tsx rename to packages/grafana-ui/src/components/Switch/Switch.story.internal.tsx diff --git a/packages/grafana-ui/src/components/index.ts b/packages/grafana-ui/src/components/index.ts index 9a57c90fde4..1dfa95fb442 100644 --- a/packages/grafana-ui/src/components/index.ts +++ b/packages/grafana-ui/src/components/index.ts @@ -21,7 +21,6 @@ export { SeriesColorPickerPopover, SeriesColorPickerPopoverWithTheme } from './C export { PanelOptionsGroup } from './PanelOptionsGroup/PanelOptionsGroup'; export { PanelOptionsGrid } from './PanelOptionsGrid/PanelOptionsGrid'; export { LegacyValueMappingsEditor } from './ValueMappingsEditor/LegacyValueMappingsEditor'; -export { Switch } from './Switch/Switch'; export { EmptySearchResult } from './EmptySearchResult/EmptySearchResult'; export { PieChart, PieChartType } from './PieChart/PieChart'; export { UnitPicker } from './UnitPicker/UnitPicker'; @@ -149,8 +148,8 @@ import { ButtonSelect } from './Forms/Legacy/Select/ButtonSelect'; //Input import { Input, LegacyInputStatus } from './Forms/Legacy/Input/Input'; -// Export these until Enterprise migrations have been merged -// export { Input, InputStatus} + +import { Switch } from './Switch/Switch'; const LegacyForms = { Select, @@ -159,6 +158,7 @@ const LegacyForms = { NoOptionsMessage, ButtonSelect, Input, + Switch, }; - +export { Switch }; export { LegacyForms, LegacyInputStatus }; diff --git a/public/app/features/api-keys/ApiKeysPage.tsx b/public/app/features/api-keys/ApiKeysPage.tsx index 7fd6fbd417f..b42730e3fd9 100644 --- a/public/app/features/api-keys/ApiKeysPage.tsx +++ b/public/app/features/api-keys/ApiKeysPage.tsx @@ -13,8 +13,8 @@ import ApiKeysAddedModal from './ApiKeysAddedModal'; import config from 'app/core/config'; import appEvents from 'app/core/app_events'; import EmptyListCTA from 'app/core/components/EmptyListCTA/EmptyListCTA'; -import { DeleteButton, EventsWithValidation, FormLabel, LegacyForms, Switch, ValidationEvents } from '@grafana/ui'; -const { Input } = LegacyForms; +import { DeleteButton, EventsWithValidation, FormLabel, LegacyForms, ValidationEvents } from '@grafana/ui'; +const { Input, Switch } = LegacyForms; import { dateTime, isDateTime, NavModel } from '@grafana/data'; import { FilterInput } from 'app/core/components/FilterInput/FilterInput'; import { store } from 'app/store/store'; diff --git a/public/app/features/dashboard/components/ShareModal/ShareEmbed.tsx b/public/app/features/dashboard/components/ShareModal/ShareEmbed.tsx index 2d0928b7f70..6a8e1f16234 100644 --- a/public/app/features/dashboard/components/ShareModal/ShareEmbed.tsx +++ b/public/app/features/dashboard/components/ShareModal/ShareEmbed.tsx @@ -1,6 +1,6 @@ import React, { PureComponent } from 'react'; -import { Switch, LegacyForms } from '@grafana/ui'; -const { Select } = LegacyForms; +import { LegacyForms } from '@grafana/ui'; +const { Select, Switch } = LegacyForms; import { SelectableValue } from '@grafana/data'; import { DashboardModel, PanelModel } from 'app/features/dashboard/state'; import { buildIframeHtml } from './utils'; diff --git a/public/app/features/dashboard/components/ShareModal/ShareExport.tsx b/public/app/features/dashboard/components/ShareModal/ShareExport.tsx index 1d5557627a6..d3a6c9f15e9 100644 --- a/public/app/features/dashboard/components/ShareModal/ShareExport.tsx +++ b/public/app/features/dashboard/components/ShareModal/ShareExport.tsx @@ -1,6 +1,7 @@ import React, { PureComponent } from 'react'; import { saveAs } from 'file-saver'; -import { Button, Switch } from '@grafana/ui'; +import { Button, LegacyForms } from '@grafana/ui'; +const { Switch } = LegacyForms; import { DashboardModel, PanelModel } from 'app/features/dashboard/state'; import { DashboardExporter } from 'app/features/dashboard/components/DashExportModal'; import { appEvents } from 'app/core/core'; diff --git a/public/app/features/dashboard/components/ShareModal/ShareLink.tsx b/public/app/features/dashboard/components/ShareModal/ShareLink.tsx index cb5f2c143f7..da42a6bc7b2 100644 --- a/public/app/features/dashboard/components/ShareModal/ShareLink.tsx +++ b/public/app/features/dashboard/components/ShareModal/ShareLink.tsx @@ -1,7 +1,7 @@ import React, { PureComponent } from 'react'; import { e2e } from '@grafana/e2e'; -import { Switch, LegacyForms, ClipboardButton } from '@grafana/ui'; -const { Select } = LegacyForms; +import { LegacyForms, ClipboardButton } from '@grafana/ui'; +const { Select, Switch } = LegacyForms; import { SelectableValue, PanelModel, AppEvents } from '@grafana/data'; import { DashboardModel } from 'app/features/dashboard/state'; import { buildImageUrl, buildShareUrl } from './utils'; diff --git a/public/app/features/dashboard/components/SubMenu/Annotations.tsx b/public/app/features/dashboard/components/SubMenu/Annotations.tsx index c182a2c9574..1125c1ebecc 100644 --- a/public/app/features/dashboard/components/SubMenu/Annotations.tsx +++ b/public/app/features/dashboard/components/SubMenu/Annotations.tsx @@ -1,5 +1,6 @@ import React, { FunctionComponent, useEffect, useState } from 'react'; -import { Switch } from '@grafana/ui'; +import { LegacyForms } from '@grafana/ui'; +const { Switch } = LegacyForms; interface Props { annotations: any[]; diff --git a/public/app/features/dashboard/panel_editor/QueryOptions.tsx b/public/app/features/dashboard/panel_editor/QueryOptions.tsx index 17dc0a7ccc5..8b0cff7fe9d 100644 --- a/public/app/features/dashboard/panel_editor/QueryOptions.tsx +++ b/public/app/features/dashboard/panel_editor/QueryOptions.tsx @@ -5,9 +5,9 @@ import React, { PureComponent, ChangeEvent, FocusEvent, ReactText } from 'react' import { rangeUtil, DataSourceSelectItem } from '@grafana/data'; // Components -import { EventsWithValidation, LegacyInputStatus, LegacyForms, Switch, ValidationEvents, FormLabel } from '@grafana/ui'; +import { EventsWithValidation, LegacyInputStatus, LegacyForms, ValidationEvents, FormLabel } from '@grafana/ui'; import { DataSourceOption } from './DataSourceOption'; -const { Input } = LegacyForms; +const { Input, Switch } = LegacyForms; // Types import { PanelModel } from '../state'; diff --git a/public/app/features/datasources/settings/BasicSettings.tsx b/public/app/features/datasources/settings/BasicSettings.tsx index 3619800f60f..e0ec59f9e6e 100644 --- a/public/app/features/datasources/settings/BasicSettings.tsx +++ b/public/app/features/datasources/settings/BasicSettings.tsx @@ -1,6 +1,6 @@ import React, { FC } from 'react'; -import { FormLabel, LegacyForms, Switch } from '@grafana/ui'; -const { Input } = LegacyForms; +import { FormLabel, LegacyForms } from '@grafana/ui'; +const { Input, Switch } = LegacyForms; import { e2e } from '@grafana/e2e'; export interface Props { diff --git a/public/app/features/explore/Logs.tsx b/public/app/features/explore/Logs.tsx index f4e5f146532..9a07635c089 100644 --- a/public/app/features/explore/Logs.tsx +++ b/public/app/features/explore/Logs.tsx @@ -15,7 +15,8 @@ import { LinkModel, Field, } from '@grafana/data'; -import { Switch, LogLabels, ToggleButtonGroup, ToggleButton, LogRows } from '@grafana/ui'; +import { LegacyForms, LogLabels, ToggleButtonGroup, ToggleButton, LogRows } from '@grafana/ui'; +const { Switch } = LegacyForms; import store from 'app/core/store'; import { ExploreGraphPanel } from './ExploreGraphPanel'; diff --git a/public/app/features/variables/editor/SelectionOptionsEditor.tsx b/public/app/features/variables/editor/SelectionOptionsEditor.tsx index adfe5cb2afc..103b5e3be4c 100644 --- a/public/app/features/variables/editor/SelectionOptionsEditor.tsx +++ b/public/app/features/variables/editor/SelectionOptionsEditor.tsx @@ -1,5 +1,6 @@ import React, { FunctionComponent, useCallback } from 'react'; -import { Switch } from '@grafana/ui'; +import { LegacyForms } from '@grafana/ui'; +const { Switch } = LegacyForms; import { e2e } from '@grafana/e2e'; import { VariableWithMultiSupport } from '../../templating/types'; diff --git a/public/app/features/variables/interval/IntervalVariableEditor.tsx b/public/app/features/variables/interval/IntervalVariableEditor.tsx index 05504e27af5..d203ec65b56 100644 --- a/public/app/features/variables/interval/IntervalVariableEditor.tsx +++ b/public/app/features/variables/interval/IntervalVariableEditor.tsx @@ -2,7 +2,8 @@ import React, { ChangeEvent, FocusEvent, PureComponent } from 'react'; import { IntervalVariableModel } from '../../templating/types'; import { VariableEditorProps } from '../editor/types'; -import { FormLabel, Switch } from '@grafana/ui'; +import { FormLabel, LegacyForms } from '@grafana/ui'; +const { Switch } = LegacyForms; export interface Props extends VariableEditorProps {} diff --git a/public/app/features/variables/query/QueryVariableEditor.tsx b/public/app/features/variables/query/QueryVariableEditor.tsx index cc6261ead30..434004dbade 100644 --- a/public/app/features/variables/query/QueryVariableEditor.tsx +++ b/public/app/features/variables/query/QueryVariableEditor.tsx @@ -1,6 +1,7 @@ import React, { ChangeEvent, PureComponent } from 'react'; import { e2e } from '@grafana/e2e'; -import { FormLabel, Switch } from '@grafana/ui'; +import { FormLabel, LegacyForms } from '@grafana/ui'; +const { Switch } = LegacyForms; import templateSrv from '../../templating/template_srv'; import { SelectionOptionsEditor } from '../editor/SelectionOptionsEditor'; diff --git a/public/app/plugins/datasource/cloudwatch/components/AnnotationQueryEditor.tsx b/public/app/plugins/datasource/cloudwatch/components/AnnotationQueryEditor.tsx index a5fdc14c967..0acf0a5a8d4 100644 --- a/public/app/plugins/datasource/cloudwatch/components/AnnotationQueryEditor.tsx +++ b/public/app/plugins/datasource/cloudwatch/components/AnnotationQueryEditor.tsx @@ -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'; diff --git a/public/app/plugins/datasource/cloudwatch/components/QueryEditor.tsx b/public/app/plugins/datasource/cloudwatch/components/QueryEditor.tsx index 1d866b8c2fc..f3b64de2c30 100644 --- a/public/app/plugins/datasource/cloudwatch/components/QueryEditor.tsx +++ b/public/app/plugins/datasource/cloudwatch/components/QueryEditor.tsx @@ -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'; diff --git a/public/app/plugins/datasource/grafana-azure-monitor-datasource/components/AnalyticsConfig.tsx b/public/app/plugins/datasource/grafana-azure-monitor-datasource/components/AnalyticsConfig.tsx index efc612af5fd..dfb776ae761 100644 --- a/public/app/plugins/datasource/grafana-azure-monitor-datasource/components/AnalyticsConfig.tsx +++ b/public/app/plugins/datasource/grafana-azure-monitor-datasource/components/AnalyticsConfig.tsx @@ -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 { diff --git a/public/app/plugins/datasource/graphite/configuration/ConfigEditor.tsx b/public/app/plugins/datasource/graphite/configuration/ConfigEditor.tsx index b3903bc70ba..0ea91c9667d 100644 --- a/public/app/plugins/datasource/graphite/configuration/ConfigEditor.tsx +++ b/public/app/plugins/datasource/graphite/configuration/ConfigEditor.tsx @@ -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, diff --git a/public/app/plugins/datasource/loki/configuration/DerivedField.tsx b/public/app/plugins/datasource/loki/configuration/DerivedField.tsx index a090963c98c..32cd90e2a1f 100644 --- a/public/app/plugins/datasource/loki/configuration/DerivedField.tsx +++ b/public/app/plugins/datasource/loki/configuration/DerivedField.tsx @@ -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'; diff --git a/public/app/plugins/datasource/prometheus/components/PromQueryEditor.tsx b/public/app/plugins/datasource/prometheus/components/PromQueryEditor.tsx index c7a5b26097f..9dc9d911076 100644 --- a/public/app/plugins/datasource/prometheus/components/PromQueryEditor.tsx +++ b/public/app/plugins/datasource/prometheus/components/PromQueryEditor.tsx @@ -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'; diff --git a/public/app/plugins/panel/annolist/AnnoListEditor.tsx b/public/app/plugins/panel/annolist/AnnoListEditor.tsx index 78f5eb336df..b6ea26425b3 100644 --- a/public/app/plugins/panel/annolist/AnnoListEditor.tsx +++ b/public/app/plugins/panel/annolist/AnnoListEditor.tsx @@ -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'; diff --git a/public/app/plugins/panel/bargauge/BarGaugePanelEditor.tsx b/public/app/plugins/panel/bargauge/BarGaugePanelEditor.tsx index 8a9daea9d1f..841d4874a98 100644 --- a/public/app/plugins/panel/bargauge/BarGaugePanelEditor.tsx +++ b/public/app/plugins/panel/bargauge/BarGaugePanelEditor.tsx @@ -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, diff --git a/public/app/plugins/panel/gauge/GaugePanelEditor.tsx b/public/app/plugins/panel/gauge/GaugePanelEditor.tsx index 4c00b7eb6e7..9ef96b68d93 100644 --- a/public/app/plugins/panel/gauge/GaugePanelEditor.tsx +++ b/public/app/plugins/panel/gauge/GaugePanelEditor.tsx @@ -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, diff --git a/public/app/plugins/panel/graph2/GraphLegendEditor.tsx b/public/app/plugins/panel/graph2/GraphLegendEditor.tsx index 158022d72ba..284bb09529b 100644 --- a/public/app/plugins/panel/graph2/GraphLegendEditor.tsx +++ b/public/app/plugins/panel/graph2/GraphLegendEditor.tsx @@ -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[]; diff --git a/public/app/plugins/panel/graph2/GraphPanelEditor.tsx b/public/app/plugins/panel/graph2/GraphPanelEditor.tsx index 370ac06154d..c34b55e6bda 100644 --- a/public/app/plugins/panel/graph2/GraphPanelEditor.tsx +++ b/public/app/plugins/panel/graph2/GraphPanelEditor.tsx @@ -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'; diff --git a/public/app/plugins/panel/logs/LogsPanelEditor.tsx b/public/app/plugins/panel/logs/LogsPanelEditor.tsx index 8118a887cdd..4126dd2d733 100644 --- a/public/app/plugins/panel/logs/LogsPanelEditor.tsx +++ b/public/app/plugins/panel/logs/LogsPanelEditor.tsx @@ -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'; diff --git a/public/app/plugins/panel/table2/TablePanelEditor.tsx b/public/app/plugins/panel/table2/TablePanelEditor.tsx index 80d9811c0b7..3da3585ae7d 100644 --- a/public/app/plugins/panel/table2/TablePanelEditor.tsx +++ b/public/app/plugins/panel/table2/TablePanelEditor.tsx @@ -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> {