Skip to content

Commit

Permalink
Chore: Replace deprecated Form imports (#84537)
Browse files Browse the repository at this point in the history
* SignupInvited: replace Form

* Chore: replace Form import

* Chore: replace HorizontalGroup

* Replace the component in OrgProfile
  • Loading branch information
Clarity-89 committed Mar 16, 2024
1 parent 5fa627e commit 1714d52
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 9 deletions.
3 changes: 2 additions & 1 deletion public/app/features/invites/SignupInvited.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import React, { useState } from 'react';
import { useAsync } from 'react-use';

import { getBackendSrv } from '@grafana/runtime';
import { Button, Field, Form, Input } from '@grafana/ui';
import { Button, Field, Input } from '@grafana/ui';
import { Form } from 'app/core/components/Form/Form';
import { Page } from 'app/core/components/Page/Page';
import { getConfig } from 'app/core/config';
import { contextSrv } from 'app/core/core';
Expand Down
3 changes: 2 additions & 1 deletion public/app/features/org/OrgProfile.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react';

import { Input, Field, FieldSet, Button, Form } from '@grafana/ui';
import { Input, Field, FieldSet, Button } from '@grafana/ui';
import { Form } from 'app/core/components/Form/Form';
import { contextSrv } from 'app/core/core';
import { AccessControlAction } from 'app/types';

Expand Down
3 changes: 2 additions & 1 deletion public/app/features/profile/UserProfileEditForm.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import React from 'react';

import { selectors } from '@grafana/e2e-selectors';
import { Button, Field, FieldSet, Form, Icon, Input, Tooltip } from '@grafana/ui';
import { Button, Field, FieldSet, Icon, Input, Tooltip } from '@grafana/ui';
import { Form } from 'app/core/components/Form/Form';
import config from 'app/core/config';
import { t, Trans } from 'app/core/internationalization';
import { UserDTO } from 'app/types';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import React, { useCallback, useEffect, useState } from 'react';

import { getBackendSrv, locationService } from '@grafana/runtime';
import { Form, Button, Input, Field, FieldSet } from '@grafana/ui';
import { Button, Input, Field, FieldSet } from '@grafana/ui';
import { Form } from 'app/core/components/Form/Form';
import { Page } from 'app/core/components/Page/Page';
import { UserRolePicker } from 'app/core/components/RolePicker/UserRolePicker';
import { fetchRoleOptions, updateUserRoles } from 'app/core/components/RolePicker/api';
Expand Down
3 changes: 2 additions & 1 deletion public/app/features/storage/CreateNewFolderModal.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import React from 'react';
import { SubmitHandler, Validate } from 'react-hook-form';

import { Button, Field, Form, Input, Modal } from '@grafana/ui';
import { Button, Field, Input, Modal } from '@grafana/ui';
import { Form } from 'app/core/components/Form/Form';

type FormModel = { folderName: string };

Expand Down
9 changes: 5 additions & 4 deletions public/app/features/support-bundles/SupportBundlesCreate.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import React, { useEffect } from 'react';
import { connect, ConnectedProps } from 'react-redux';

import { Form, Button, Field, Checkbox, LinkButton, HorizontalGroup, Alert } from '@grafana/ui';
import { Button, Field, Checkbox, LinkButton, Stack, Alert } from '@grafana/ui';
import { Form } from 'app/core/components/Form/Form';
import { Page } from 'app/core/components/Page/Page';
import { StoreState } from 'app/types';

Expand Down Expand Up @@ -60,7 +61,7 @@ export const SupportBundlesCreateUnconnected = ({
{createBundleError && <Alert title={createBundleError} severity="error" />}
{!!collectors.length && (
<Form defaultValues={values} onSubmit={onSubmit} validateOn="onSubmit">
{({ register, errors }) => {
{({ register }) => {
return (
<>
{[...collectors]
Expand All @@ -79,12 +80,12 @@ export const SupportBundlesCreateUnconnected = ({
</Field>
);
})}
<HorizontalGroup>
<Stack>
<Button type="submit">Create</Button>
<LinkButton href="/support-bundles" variant="secondary">
Cancel
</LinkButton>
</HorizontalGroup>
</Stack>
</>
);
}}
Expand Down

0 comments on commit 1714d52

Please sign in to comment.