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:
Alex Khomenko 2024-03-11 12:36:36 +01:00 committed by GitHub
parent 4fc5c0dc21
commit ffe5c97b2d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 8 deletions

View File

@ -1,10 +1,10 @@
import { css } from '@emotion/css';
import React, { useId, useState, useMemo, useEffect } from 'react';
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 { 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 {
getSupportedTransTypeDetails,
@ -138,7 +138,7 @@ export const CorrelationTransformationAddModal = ({
field variables.
</p>
<Field label="Field">
<InputControl
<Controller
control={control}
render={({ field: { onChange, ref, ...field } }) => (
<Select
@ -169,7 +169,7 @@ export const CorrelationTransformationAddModal = ({
/>
</pre>
<Field label="Type">
<InputControl
<Controller
control={control}
render={({ field: { onChange, ref, ...field } }) => (
<Select

View File

@ -1,10 +1,10 @@
import { partial } from 'lodash';
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 { 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 { contextSrv } from 'app/core/services/context_srv';
import { removeDashboardToFetchFromLocalStorage } from 'app/features/dashboard/state/initDashboard';
@ -156,7 +156,7 @@ export function AddToDashboardForm(props: Props): ReactElement {
return (
<form>
{saveTargets.length > 1 && (
<InputControl
<Controller
control={control}
render={({ field: { ref, ...field } }) => (
<Field label="Target dashboard" description="Choose where to add the panel.">
@ -171,7 +171,7 @@ export function AddToDashboardForm(props: Props): ReactElement {
(() => {
assertIsSaveToExistingDashboardError(errors);
return (
<InputControl
<Controller
render={({ field: { ref, value, onChange, ...field } }) => (
<Field
label="Dashboard"