mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Chore: Remove InputControl usage from explore (#83742)
* Explore: Remove deprecated Form components from CorrelationTransformationAddModal.tsx * Explore: Remove deprecated Form components from AddToDashboardForm.tsx
This commit is contained in:
@@ -1,10 +1,10 @@
|
|||||||
import { css } from '@emotion/css';
|
import { css } from '@emotion/css';
|
||||||
import React, { useId, useState, useMemo, useEffect } from 'react';
|
import React, { useId, useState, useMemo, useEffect } from 'react';
|
||||||
import Highlighter from 'react-highlight-words';
|
import Highlighter from 'react-highlight-words';
|
||||||
import { useForm } from 'react-hook-form';
|
import { useForm, Controller } from 'react-hook-form';
|
||||||
|
|
||||||
import { DataLinkTransformationConfig, ScopedVars } from '@grafana/data';
|
import { DataLinkTransformationConfig, ScopedVars } from '@grafana/data';
|
||||||
import { Button, Field, Icon, Input, InputControl, Label, Modal, Select, Tooltip, Stack } from '@grafana/ui';
|
import { Button, Field, Icon, Input, Label, Modal, Select, Tooltip, Stack } from '@grafana/ui';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
getSupportedTransTypeDetails,
|
getSupportedTransTypeDetails,
|
||||||
@@ -138,7 +138,7 @@ export const CorrelationTransformationAddModal = ({
|
|||||||
field variables.
|
field variables.
|
||||||
</p>
|
</p>
|
||||||
<Field label="Field">
|
<Field label="Field">
|
||||||
<InputControl
|
<Controller
|
||||||
control={control}
|
control={control}
|
||||||
render={({ field: { onChange, ref, ...field } }) => (
|
render={({ field: { onChange, ref, ...field } }) => (
|
||||||
<Select
|
<Select
|
||||||
@@ -169,7 +169,7 @@ export const CorrelationTransformationAddModal = ({
|
|||||||
/>
|
/>
|
||||||
</pre>
|
</pre>
|
||||||
<Field label="Type">
|
<Field label="Type">
|
||||||
<InputControl
|
<Controller
|
||||||
control={control}
|
control={control}
|
||||||
render={({ field: { onChange, ref, ...field } }) => (
|
render={({ field: { onChange, ref, ...field } }) => (
|
||||||
<Select
|
<Select
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import { partial } from 'lodash';
|
import { partial } from 'lodash';
|
||||||
import React, { type ReactElement, useEffect, useState } from 'react';
|
import React, { type ReactElement, useEffect, useState } from 'react';
|
||||||
import { DeepMap, FieldError, FieldErrors, useForm } from 'react-hook-form';
|
import { DeepMap, FieldError, FieldErrors, useForm, Controller } from 'react-hook-form';
|
||||||
|
|
||||||
import { locationUtil, SelectableValue } from '@grafana/data';
|
import { locationUtil, SelectableValue } from '@grafana/data';
|
||||||
import { config, locationService, reportInteraction } from '@grafana/runtime';
|
import { config, locationService, reportInteraction } from '@grafana/runtime';
|
||||||
import { Alert, Button, Field, InputControl, Modal, RadioButtonGroup } from '@grafana/ui';
|
import { Alert, Button, Field, Modal, RadioButtonGroup } from '@grafana/ui';
|
||||||
import { DashboardPicker } from 'app/core/components/Select/DashboardPicker';
|
import { DashboardPicker } from 'app/core/components/Select/DashboardPicker';
|
||||||
import { contextSrv } from 'app/core/services/context_srv';
|
import { contextSrv } from 'app/core/services/context_srv';
|
||||||
import { removeDashboardToFetchFromLocalStorage } from 'app/features/dashboard/state/initDashboard';
|
import { removeDashboardToFetchFromLocalStorage } from 'app/features/dashboard/state/initDashboard';
|
||||||
@@ -156,7 +156,7 @@ export function AddToDashboardForm(props: Props): ReactElement {
|
|||||||
return (
|
return (
|
||||||
<form>
|
<form>
|
||||||
{saveTargets.length > 1 && (
|
{saveTargets.length > 1 && (
|
||||||
<InputControl
|
<Controller
|
||||||
control={control}
|
control={control}
|
||||||
render={({ field: { ref, ...field } }) => (
|
render={({ field: { ref, ...field } }) => (
|
||||||
<Field label="Target dashboard" description="Choose where to add the panel.">
|
<Field label="Target dashboard" description="Choose where to add the panel.">
|
||||||
@@ -171,7 +171,7 @@ export function AddToDashboardForm(props: Props): ReactElement {
|
|||||||
(() => {
|
(() => {
|
||||||
assertIsSaveToExistingDashboardError(errors);
|
assertIsSaveToExistingDashboardError(errors);
|
||||||
return (
|
return (
|
||||||
<InputControl
|
<Controller
|
||||||
render={({ field: { ref, value, onChange, ...field } }) => (
|
render={({ field: { ref, value, onChange, ...field } }) => (
|
||||||
<Field
|
<Field
|
||||||
label="Dashboard"
|
label="Dashboard"
|
||||||
|
|||||||
Reference in New Issue
Block a user