mirror of
https://github.com/grafana/grafana.git
synced 2024-11-22 08:56:43 -06:00
VizTooltip: Remove use of LayoutItemContext (#83542)
This commit is contained in:
parent
0f1cefa942
commit
5c60f4d468
@ -1,19 +1,9 @@
|
||||
import { css } from '@emotion/css';
|
||||
import React, { useContext, useEffect, useRef } from 'react';
|
||||
import React, { useRef } from 'react';
|
||||
import { useAsyncFn, useClickAway } from 'react-use';
|
||||
|
||||
import { AnnotationEventUIModel, GrafanaTheme2, dateTimeFormat, systemDateFormats } from '@grafana/data';
|
||||
import {
|
||||
Button,
|
||||
Field,
|
||||
Form,
|
||||
HorizontalGroup,
|
||||
InputControl,
|
||||
LayoutItemContext,
|
||||
TextArea,
|
||||
usePanelContext,
|
||||
useStyles2,
|
||||
} from '@grafana/ui';
|
||||
import { Button, Field, Form, HorizontalGroup, InputControl, TextArea, usePanelContext, useStyles2 } from '@grafana/ui';
|
||||
import { TagFilter } from 'app/core/components/TagFilter/TagFilter';
|
||||
import { getAnnotationTags } from 'app/features/annotations/api';
|
||||
|
||||
@ -37,9 +27,6 @@ export const AnnotationEditor2 = ({ annoVals, annoIdx, dismiss, timeZone, ...oth
|
||||
|
||||
useClickAway(clickAwayRef, dismiss);
|
||||
|
||||
const layoutCtx = useContext(LayoutItemContext);
|
||||
useEffect(() => layoutCtx.boostZIndex(), [layoutCtx]);
|
||||
|
||||
const [createAnnotationState, createAnnotation] = useAsyncFn(async (event: AnnotationEventUIModel) => {
|
||||
const result = await onAnnotationCreate!(event);
|
||||
dismiss();
|
||||
|
@ -1,8 +1,8 @@
|
||||
import { css } from '@emotion/css';
|
||||
import React, { useContext, useEffect } from 'react';
|
||||
import React from 'react';
|
||||
|
||||
import { GrafanaTheme2, dateTimeFormat, systemDateFormats, textUtil } from '@grafana/data';
|
||||
import { HorizontalGroup, IconButton, LayoutItemContext, Tag, usePanelContext, useStyles2 } from '@grafana/ui';
|
||||
import { HorizontalGroup, IconButton, Tag, usePanelContext, useStyles2 } from '@grafana/ui';
|
||||
import alertDef from 'app/features/alerting/state/alertDef';
|
||||
|
||||
interface Props {
|
||||
@ -25,9 +25,6 @@ export const AnnotationTooltip2 = ({ annoVals, annoIdx, timeZone, onEdit }: Prop
|
||||
const canEdit = canEditAnnotations(dashboardUID);
|
||||
const canDelete = canDeleteAnnotations(dashboardUID) && onAnnotationDelete != null;
|
||||
|
||||
const layoutCtx = useContext(LayoutItemContext);
|
||||
useEffect(() => layoutCtx.boostZIndex(), [layoutCtx]);
|
||||
|
||||
const timeFormatter = (value: number) =>
|
||||
dateTimeFormat(value, {
|
||||
format: systemDateFormats.fullDate,
|
||||
|
Loading…
Reference in New Issue
Block a user