From 39b32524e2f6e08512a78d8efa98042d6b048cee Mon Sep 17 00:00:00 2001 From: Alex Khomenko Date: Sat, 16 Mar 2024 08:48:17 +0100 Subject: [PATCH] AnnotationsEditor: Remove deprecated components (#84538) * AnnotationEditorForm: Remove deprecated components * AnnotationEditor2: Remove deprecated components --- .../plugins/annotations/AnnotationEditorForm.tsx | 14 ++++++++------ .../plugins/annotations2/AnnotationEditor2.tsx | 14 ++++++++------ 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/public/app/plugins/panel/timeseries/plugins/annotations/AnnotationEditorForm.tsx b/public/app/plugins/panel/timeseries/plugins/annotations/AnnotationEditorForm.tsx index 26e041a1789..c8de3bd3934 100644 --- a/public/app/plugins/panel/timeseries/plugins/annotations/AnnotationEditorForm.tsx +++ b/public/app/plugins/panel/timeseries/plugins/annotations/AnnotationEditorForm.tsx @@ -1,10 +1,12 @@ import { css, cx } from '@emotion/css'; import React, { HTMLAttributes, useRef } from 'react'; +import { Controller } from 'react-hook-form'; import useAsyncFn from 'react-use/lib/useAsyncFn'; import useClickAway from 'react-use/lib/useClickAway'; import { AnnotationEventUIModel, GrafanaTheme2 } from '@grafana/data'; -import { Button, Field, Form, HorizontalGroup, InputControl, TextArea, usePanelContext, useStyles2 } from '@grafana/ui'; +import { Button, Field, Stack, TextArea, usePanelContext, useStyles2 } from '@grafana/ui'; +import { Form } from 'app/core/components/Form/Form'; import { TagFilter } from 'app/core/components/TagFilter/TagFilter'; import { getAnnotationTags } from 'app/features/annotations/api'; @@ -73,10 +75,10 @@ export const AnnotationEditorForm = React.forwardRef
- +
Add annotation
{ts}
-
+
@@ -94,7 +96,7 @@ export const AnnotationEditorForm = React.forwardRef - { @@ -110,14 +112,14 @@ export const AnnotationEditorForm = React.forwardRef - + - + ); }} diff --git a/public/app/plugins/panel/timeseries/plugins/annotations2/AnnotationEditor2.tsx b/public/app/plugins/panel/timeseries/plugins/annotations2/AnnotationEditor2.tsx index 702711454e4..21f998ce696 100644 --- a/public/app/plugins/panel/timeseries/plugins/annotations2/AnnotationEditor2.tsx +++ b/public/app/plugins/panel/timeseries/plugins/annotations2/AnnotationEditor2.tsx @@ -1,9 +1,11 @@ import { css } from '@emotion/css'; import React, { useRef } from 'react'; +import { Controller } from 'react-hook-form'; import { useAsyncFn, useClickAway } from 'react-use'; import { AnnotationEventUIModel, GrafanaTheme2, dateTimeFormat, systemDateFormats } from '@grafana/data'; -import { Button, Field, Form, HorizontalGroup, InputControl, TextArea, usePanelContext, useStyles2 } from '@grafana/ui'; +import { Button, Field, Stack, TextArea, usePanelContext, useStyles2 } from '@grafana/ui'; +import { Form } from 'app/core/components/Form/Form'; import { TagFilter } from 'app/core/components/TagFilter/TagFilter'; import { getAnnotationTags } from 'app/features/annotations/api'; @@ -67,10 +69,10 @@ export const AnnotationEditor2 = ({ annoVals, annoIdx, dismiss, timeZone, ...oth return (
- +
{isUpdatingAnnotation ? 'Edit annotation' : 'Add annotation'}
{time}
-
+
onSubmit={onSubmit} @@ -89,7 +91,7 @@ export const AnnotationEditor2 = ({ annoVals, annoIdx, dismiss, timeZone, ...oth /> - { @@ -107,14 +109,14 @@ export const AnnotationEditor2 = ({ annoVals, annoIdx, dismiss, timeZone, ...oth
- + - +
);