mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Forms migration: Old Select to Legacy namespace (#23200)
* Export other components as Legacy * More Select Legacy * Add namespacing to more files * Export new elements * Move Legacy Select folder * Let's not forget the scss file * Move new Select folder * Move new Select from Forms namespace * Little oopsie * Fix errors * Fix merge issues
This commit is contained in:
@@ -2,7 +2,7 @@ import React, { FC } from 'react';
|
||||
import { debounce } from 'lodash';
|
||||
import { useAsyncFn } from 'react-use';
|
||||
import { SelectableValue } from '@grafana/data';
|
||||
import { Forms } from '@grafana/ui';
|
||||
import { AsyncSelect } from '@grafana/ui';
|
||||
import { FormInputSize } from '@grafana/ui/src/components/Forms/types';
|
||||
import { backendSrv } from 'app/core/services/backend_srv';
|
||||
import { DashboardSearchHit, DashboardDTO } from 'app/types';
|
||||
@@ -42,7 +42,7 @@ export const DashboardPicker: FC<Props> = ({
|
||||
const [state, searchDashboards] = useAsyncFn(debouncedSearch, []);
|
||||
|
||||
return (
|
||||
<Forms.AsyncSelect
|
||||
<AsyncSelect
|
||||
size={size}
|
||||
isLoading={state.loading}
|
||||
isClearable={isClearable}
|
||||
|
||||
@@ -2,8 +2,9 @@
|
||||
import React, { PureComponent } from 'react';
|
||||
|
||||
// Components
|
||||
import { Select } from '@grafana/ui';
|
||||
import { LegacyForms } from '@grafana/ui';
|
||||
import { SelectableValue, DataSourceSelectItem } from '@grafana/data';
|
||||
const { Select } = LegacyForms;
|
||||
|
||||
export interface Props {
|
||||
onChange: (ds: DataSourceSelectItem) => void;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import React, { PureComponent } from 'react';
|
||||
import { Forms } from '@grafana/ui';
|
||||
import { AsyncSelect } from '@grafana/ui';
|
||||
import { AppEvents, SelectableValue } from '@grafana/data';
|
||||
import { debounce } from 'lodash';
|
||||
import appEvents from '../../app_events';
|
||||
@@ -150,7 +150,7 @@ export class FolderPicker extends PureComponent<Props, State> {
|
||||
return (
|
||||
<>
|
||||
{useNewForms && (
|
||||
<Forms.AsyncSelect
|
||||
<AsyncSelect
|
||||
loadingMessage="Loading folders..."
|
||||
defaultOptions
|
||||
defaultValue={folder}
|
||||
@@ -167,7 +167,7 @@ export class FolderPicker extends PureComponent<Props, State> {
|
||||
<div className="gf-form-inline">
|
||||
<div className="gf-form">
|
||||
<label className="gf-form-label width-7">Folder</label>
|
||||
<Forms.AsyncSelect
|
||||
<AsyncSelect
|
||||
loadingMessage="Loading folders..."
|
||||
defaultOptions
|
||||
defaultValue={folder}
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import React from 'react';
|
||||
import _ from 'lodash';
|
||||
|
||||
import { Select } from '@grafana/ui';
|
||||
import { LegacyForms } from '@grafana/ui';
|
||||
import { SelectableValue } from '@grafana/data';
|
||||
import { Variable } from 'app/types/templates';
|
||||
const { Select } = LegacyForms;
|
||||
|
||||
export interface Props {
|
||||
onChange: (value: string) => void;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import React, { PureComponent } from 'react';
|
||||
import { Forms } from '@grafana/ui';
|
||||
import { AsyncSelect } from '@grafana/ui';
|
||||
import { getBackendSrv } from 'app/core/services/backend_srv';
|
||||
import { Organization } from 'app/types';
|
||||
import { SelectableValue } from '@grafana/data';
|
||||
@@ -54,7 +54,7 @@ export class OrgPicker extends PureComponent<Props, State> {
|
||||
const { isLoading } = this.state;
|
||||
|
||||
return (
|
||||
<Forms.AsyncSelect
|
||||
<AsyncSelect
|
||||
className={className}
|
||||
isLoading={isLoading}
|
||||
defaultOptions={true}
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import React, { Component } from 'react';
|
||||
import _ from 'lodash';
|
||||
import { AsyncSelect } from '@grafana/ui';
|
||||
import { LegacyForms } from '@grafana/ui';
|
||||
import { debounce } from 'lodash';
|
||||
import { getBackendSrv } from '@grafana/runtime';
|
||||
const { AsyncSelect } = LegacyForms;
|
||||
|
||||
export interface Team {
|
||||
id: number;
|
||||
|
||||
@@ -3,7 +3,8 @@ import React, { Component } from 'react';
|
||||
import _ from 'lodash';
|
||||
|
||||
// Components
|
||||
import { AsyncSelect } from '@grafana/ui';
|
||||
import { LegacyForms } from '@grafana/ui';
|
||||
const { AsyncSelect } = LegacyForms;
|
||||
|
||||
// Utils & Services
|
||||
import { debounce } from 'lodash';
|
||||
|
||||
Reference in New Issue
Block a user