diff --git a/frontend/src/custom.d.ts b/frontend/src/custom.d.ts index cb017b415bf..3d7f0961ba1 100644 --- a/frontend/src/custom.d.ts +++ b/frontend/src/custom.d.ts @@ -15,3 +15,10 @@ declare module '*.mp3' { const content: any export default content } + +// This fixes TS errors when importing chartjs-plugin-crosshair +declare module 'chartjs-plugin-crosshair' { + const CrosshairPlugin: any + type CrosshairOptions = any + export { CrosshairPlugin, CrosshairOptions } +} diff --git a/frontend/src/lib/components/Annotations/AnnotationMarker.tsx b/frontend/src/lib/components/Annotations/AnnotationMarker.tsx index d6db7f42258..0e51f8f9169 100644 --- a/frontend/src/lib/components/Annotations/AnnotationMarker.tsx +++ b/frontend/src/lib/components/Annotations/AnnotationMarker.tsx @@ -31,12 +31,12 @@ function coordinateContains(e: MouseEvent, element: DOMRect): boolean { } interface AnnotationMarkerProps { - elementId: string + elementId?: string label: string - annotations: AnnotationType[] + annotations?: AnnotationType[] left: number top: number - onCreate: (textInput: string, applyAll: boolean) => void + onCreate?: (textInput: string, applyAll: boolean) => void onDelete?: (annotation: AnnotationType) => void onClick?: () => void onClose?: () => void @@ -45,17 +45,17 @@ interface AnnotationMarkerProps { color: string | null accessoryColor: string | null insightId?: number - currentDateMarker: string + currentDateMarker?: string | null dynamic?: boolean graphColor: string | null - index: number + index?: number getPopupContainer?: () => HTMLElement } export function AnnotationMarker({ elementId, label, - annotations, + annotations = [], left, top, onCreate, @@ -95,8 +95,7 @@ export function AnnotationMarker({ const { user } = useValues(userLogic) const { currentTeam } = useValues(teamLogic) const { currentOrganization } = useValues(organizationLogic) - - const { diffType, groupedAnnotations } = useValues(annotationsLogic({ insightId: insightId })) + const { diffType, groupedAnnotations } = useValues(annotationsLogic({ insightId })) function closePopup(): void { setFocused(false) @@ -171,8 +170,8 @@ export function AnnotationMarker({