mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Forms migration: Input namespace (#23286)
* Update exports * Add LegacyForms namespace * Update ci grep
This commit is contained in:
@@ -3,7 +3,7 @@ import { UserDTO } from 'app/types';
|
||||
import { cx, css } from 'emotion';
|
||||
import { config } from 'app/core/config';
|
||||
import { GrafanaTheme } from '@grafana/data';
|
||||
import { ConfirmButton, ConfirmModal, InputStatus, Button, stylesFactory, Forms } from '@grafana/ui';
|
||||
import { ConfirmButton, ConfirmModal, LegacyInputStatus, Button, stylesFactory, Forms } from '@grafana/ui';
|
||||
|
||||
interface Props {
|
||||
user: UserDTO;
|
||||
@@ -217,16 +217,16 @@ export class UserProfileRow extends PureComponent<UserProfileRowProps, UserProfi
|
||||
this.setState({ editing: false, value: this.props.value || '' });
|
||||
};
|
||||
|
||||
onInputChange = (event: React.ChangeEvent<HTMLInputElement>, status?: InputStatus) => {
|
||||
if (status === InputStatus.Invalid) {
|
||||
onInputChange = (event: React.ChangeEvent<HTMLInputElement>, status?: LegacyInputStatus) => {
|
||||
if (status === LegacyInputStatus.Invalid) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.setState({ value: event.target.value });
|
||||
};
|
||||
|
||||
onInputBlur = (event: React.FocusEvent<HTMLInputElement>, status?: InputStatus) => {
|
||||
if (status === InputStatus.Invalid) {
|
||||
onInputBlur = (event: React.FocusEvent<HTMLInputElement>, status?: LegacyInputStatus) => {
|
||||
if (status === LegacyInputStatus.Invalid) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +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, Input, Switch, ValidationEvents } from '@grafana/ui';
|
||||
import { DeleteButton, EventsWithValidation, FormLabel, LegacyForms, Switch, ValidationEvents } from '@grafana/ui';
|
||||
const { Input } = LegacyForms;
|
||||
import { dateTime, isDateTime, NavModel } from '@grafana/data';
|
||||
import { FilterInput } from 'app/core/components/FilterInput/FilterInput';
|
||||
import { store } from 'app/store/store';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import React, { PureComponent } from 'react';
|
||||
import { Button, ClipboardButton, Input, LinkButton, LegacyForms } from '@grafana/ui';
|
||||
const { Select } = LegacyForms;
|
||||
import { Button, ClipboardButton, LinkButton, LegacyForms } from '@grafana/ui';
|
||||
const { Select, Input } = LegacyForms;
|
||||
import { AppEvents, SelectableValue } from '@grafana/data';
|
||||
import { getBackendSrv } from '@grafana/runtime';
|
||||
import { DashboardModel, PanelModel } from 'app/features/dashboard/state';
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import React, { FC, ChangeEvent } from 'react';
|
||||
import { FormLabel, Input } from '@grafana/ui';
|
||||
import { FormLabel, LegacyForms } from '@grafana/ui';
|
||||
const { Input } = LegacyForms;
|
||||
|
||||
interface Props {
|
||||
label: string;
|
||||
|
||||
@@ -5,8 +5,9 @@ import React, { PureComponent, ChangeEvent, FocusEvent, ReactText } from 'react'
|
||||
import { rangeUtil, DataSourceSelectItem } from '@grafana/data';
|
||||
|
||||
// Components
|
||||
import { EventsWithValidation, Input, InputStatus, Switch, ValidationEvents, FormLabel } from '@grafana/ui';
|
||||
import { EventsWithValidation, LegacyInputStatus, LegacyForms, Switch, ValidationEvents, FormLabel } from '@grafana/ui';
|
||||
import { DataSourceOption } from './DataSourceOption';
|
||||
const { Input } = LegacyForms;
|
||||
|
||||
// Types
|
||||
import { PanelModel } from '../state';
|
||||
@@ -109,21 +110,21 @@ export class QueryOptions extends PureComponent<Props, State> {
|
||||
});
|
||||
};
|
||||
|
||||
onOverrideTime = (event: FocusEvent<HTMLInputElement>, status: InputStatus) => {
|
||||
onOverrideTime = (event: FocusEvent<HTMLInputElement>, status: LegacyInputStatus) => {
|
||||
const { value } = event.target;
|
||||
const { panel } = this.props;
|
||||
const emptyToNullValue = emptyToNull(value);
|
||||
if (status === InputStatus.Valid && panel.timeFrom !== emptyToNullValue) {
|
||||
if (status === LegacyInputStatus.Valid && panel.timeFrom !== emptyToNullValue) {
|
||||
panel.timeFrom = emptyToNullValue;
|
||||
panel.refresh();
|
||||
}
|
||||
};
|
||||
|
||||
onTimeShift = (event: FocusEvent<HTMLInputElement>, status: InputStatus) => {
|
||||
onTimeShift = (event: FocusEvent<HTMLInputElement>, status: LegacyInputStatus) => {
|
||||
const { value } = event.target;
|
||||
const { panel } = this.props;
|
||||
const emptyToNullValue = emptyToNull(value);
|
||||
if (status === InputStatus.Valid && panel.timeShift !== emptyToNullValue) {
|
||||
if (status === LegacyInputStatus.Valid && panel.timeShift !== emptyToNullValue) {
|
||||
panel.timeShift = emptyToNullValue;
|
||||
panel.refresh();
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import React, { FC } from 'react';
|
||||
import { FormLabel, Input, Switch } from '@grafana/ui';
|
||||
import { FormLabel, LegacyForms, Switch } from '@grafana/ui';
|
||||
const { Input } = LegacyForms;
|
||||
import { e2e } from '@grafana/e2e';
|
||||
|
||||
export interface Props {
|
||||
|
||||
@@ -2,7 +2,8 @@ import React, { PureComponent } from 'react';
|
||||
import { hot } from 'react-hot-loader';
|
||||
import { connect } from 'react-redux';
|
||||
import { NavModel } from '@grafana/data';
|
||||
import { Input } from '@grafana/ui';
|
||||
import { LegacyForms } from '@grafana/ui';
|
||||
const { Input } = LegacyForms;
|
||||
import Page from 'app/core/components/Page/Page';
|
||||
import appEvents from 'app/core/app_events';
|
||||
import { getNavModel } from 'app/core/selectors/navModel';
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import React, { ChangeEvent, FC } from 'react';
|
||||
import { Input } from '@grafana/ui';
|
||||
import { LegacyForms } from '@grafana/ui';
|
||||
const { Input } = LegacyForms;
|
||||
|
||||
export interface Props {
|
||||
orgName: string;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import React, { PureComponent, ChangeEvent, MouseEvent } from 'react';
|
||||
import { Button, FormLabel, Input, Tooltip } from '@grafana/ui';
|
||||
import { Button, FormLabel, LegacyForms, Tooltip } from '@grafana/ui';
|
||||
const { Input } = LegacyForms;
|
||||
import { User } from 'app/types';
|
||||
import config from 'app/core/config';
|
||||
import { ProfileUpdateFields } from 'app/core/utils/UserProvider';
|
||||
|
||||
@@ -2,7 +2,8 @@ import React, { PureComponent } from 'react';
|
||||
import { connect } from 'react-redux';
|
||||
|
||||
import { SlideDown } from 'app/core/components/Animations/SlideDown';
|
||||
import { Input, Tooltip } from '@grafana/ui';
|
||||
import { LegacyForms, Tooltip } from '@grafana/ui';
|
||||
const { Input } = LegacyForms;
|
||||
|
||||
import { TeamGroup } from '../../types';
|
||||
import { addTeamGroup, loadTeamGroups, removeTeamGroup } from './state/actions';
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import React from 'react';
|
||||
import { connect } from 'react-redux';
|
||||
import { FormLabel, Input } from '@grafana/ui';
|
||||
import { FormLabel, LegacyForms } from '@grafana/ui';
|
||||
const { Input } = LegacyForms;
|
||||
|
||||
import { SharedPreferences } from 'app/core/components/SharedPreferences/SharedPreferences';
|
||||
import { updateTeam } from './state/actions';
|
||||
|
||||
Reference in New Issue
Block a user