From 31daebd36da404b00ffa9cc4c45ab954d7789b45 Mon Sep 17 00:00:00 2001 From: Takhyun Kim Date: Thu, 20 Apr 2023 15:29:12 +0900 Subject: [PATCH] fix(viewer): delete unused lineHeadMode prop and type --- libs/insight-viewer/src/Annotation/types.ts | 3 --- .../src/Viewer/AnnotationDrawer/AnnotationDrawer.types.ts | 4 +--- libs/insight-viewer/src/Viewer/AnnotationDrawer/index.tsx | 3 --- .../Viewer/AnnotationOverlay/AnnotationOverlay.types.ts | 8 +------- .../insight-viewer/src/Viewer/AnnotationOverlay/index.tsx | 2 -- .../src/Viewer/PolylineDrawer/PolylineDrawer.types.ts | 3 --- libs/insight-viewer/src/Viewer/PolylineDrawer/index.tsx | 3 +-- .../src/hooks/useAnnotationPointsHandler/index.ts | 1 - .../src/hooks/useAnnotationPointsHandler/types.ts | 4 +--- .../utils/getInitialAnnotation.ts | 2 +- libs/insight-viewer/src/index.ts | 1 - libs/insight-viewer/src/types/index.ts | 2 -- 12 files changed, 5 insertions(+), 31 deletions(-) diff --git a/libs/insight-viewer/src/Annotation/types.ts b/libs/insight-viewer/src/Annotation/types.ts index a89e5ffd5..f645588c1 100644 --- a/libs/insight-viewer/src/Annotation/types.ts +++ b/libs/insight-viewer/src/Annotation/types.ts @@ -21,9 +21,6 @@ export type ViewerStyle = { [styleType in ViewerStyleType]?: CSSProperties } -/** @deprecated use arrow line instead */ -export type LineHeadMode = 'normal' | 'arrow' - export type AnnotationMode = 'line' | 'freeLine' | 'polygon' | 'text' | 'arrowLine' | 'ruler' | 'area' export interface AnnotationBase { diff --git a/libs/insight-viewer/src/Viewer/AnnotationDrawer/AnnotationDrawer.types.ts b/libs/insight-viewer/src/Viewer/AnnotationDrawer/AnnotationDrawer.types.ts index 203ef3905..3868fc141 100644 --- a/libs/insight-viewer/src/Viewer/AnnotationDrawer/AnnotationDrawer.types.ts +++ b/libs/insight-viewer/src/Viewer/AnnotationDrawer/AnnotationDrawer.types.ts @@ -1,5 +1,5 @@ import { SVGProps } from 'react' -import { Annotation, AnnotationMode, LineHeadMode } from '../../types' +import { Annotation, AnnotationMode } from '../../types' export interface AnnotationDrawerProps extends SVGProps { selectedAnnotation: Annotation | null @@ -19,6 +19,4 @@ export interface AnnotationDrawerProps extends SVGProps { onSelectAnnotation: (annotation: Annotation | null) => void mode?: AnnotationMode - /** @deprecated use arrow line instead */ - lineHead?: LineHeadMode } diff --git a/libs/insight-viewer/src/Viewer/AnnotationDrawer/index.tsx b/libs/insight-viewer/src/Viewer/AnnotationDrawer/index.tsx index c3e79f230..27c7b440e 100644 --- a/libs/insight-viewer/src/Viewer/AnnotationDrawer/index.tsx +++ b/libs/insight-viewer/src/Viewer/AnnotationDrawer/index.tsx @@ -22,7 +22,6 @@ export function AnnotationDrawer({ hoveredAnnotation, onSelectAnnotation, className, - lineHead = 'normal', mode = 'polygon', onAdd, }: AnnotationDrawerProps): JSX.Element { @@ -39,7 +38,6 @@ export function AnnotationDrawer({ isDrawing, isEditing, mode, - lineHead, annotations, selectedAnnotation, onSelectAnnotation, @@ -90,7 +88,6 @@ export function AnnotationDrawer({ isSelectedMode={isSelectedAnnotation} showAnnotationLabel={showAnnotationLabel} isPolygonSelected={selectedAnnotation?.type === 'polygon'} - lineHead={lineHead} selectedAnnotationLabel={selectedAnnotation ? selectedAnnotation.label ?? selectedAnnotation.id : null} setAnnotationEditMode={setAnnotationEditMode} cursorStatus={cursorStatus} diff --git a/libs/insight-viewer/src/Viewer/AnnotationOverlay/AnnotationOverlay.types.ts b/libs/insight-viewer/src/Viewer/AnnotationOverlay/AnnotationOverlay.types.ts index 37fc5f2c6..ec1af4367 100644 --- a/libs/insight-viewer/src/Viewer/AnnotationOverlay/AnnotationOverlay.types.ts +++ b/libs/insight-viewer/src/Viewer/AnnotationOverlay/AnnotationOverlay.types.ts @@ -1,16 +1,10 @@ -import { Annotation, AnnotationMode, LineHeadMode } from '../../types' +import { Annotation, AnnotationMode } from '../../types' import { AnnotationViewerProps } from '../AnnotationViewer/AnnotationViewer.types' export interface AnnotationOverlayProps extends AnnotationViewerProps { isDrawing?: boolean mode?: AnnotationMode selectedAnnotation: Annotation | null - /** - * normal has no head - * For arrow, an arrow head is added. - * @deprecated use arrow line instead - */ - lineHead?: LineHeadMode onFocus?: (annotation: Annotation | null) => void onAdd?: (annotation: Annotation) => void onRemove?: (annotation: Annotation) => void diff --git a/libs/insight-viewer/src/Viewer/AnnotationOverlay/index.tsx b/libs/insight-viewer/src/Viewer/AnnotationOverlay/index.tsx index 19854a603..3ff7d7b40 100644 --- a/libs/insight-viewer/src/Viewer/AnnotationOverlay/index.tsx +++ b/libs/insight-viewer/src/Viewer/AnnotationOverlay/index.tsx @@ -15,7 +15,6 @@ export function AnnotationOverlay({ showOutline, showAnnotationLabel, mode, - lineHead, isDrawing = false, isEditing, annotationAttrs, @@ -57,7 +56,6 @@ export function AnnotationOverlay({ isDrawing={isDrawing} isEditing={isEditing} mode={mode} - lineHead={lineHead} onAdd={onAdd} onSelectAnnotation={onSelect} /> diff --git a/libs/insight-viewer/src/Viewer/PolylineDrawer/PolylineDrawer.types.ts b/libs/insight-viewer/src/Viewer/PolylineDrawer/PolylineDrawer.types.ts index 4b457875b..d240979ff 100644 --- a/libs/insight-viewer/src/Viewer/PolylineDrawer/PolylineDrawer.types.ts +++ b/libs/insight-viewer/src/Viewer/PolylineDrawer/PolylineDrawer.types.ts @@ -1,5 +1,4 @@ import type { - LineHeadMode, EditMode, PolygonAnnotation, FreeLineAnnotation, @@ -11,8 +10,6 @@ import type { export interface PolylineDrawerProps { annotation: PolygonAnnotation | FreeLineAnnotation | LineAnnotation | ArrowLineAnnotation isSelectedMode: boolean - /** @deprecated use arrow line instead */ - lineHead: LineHeadMode showAnnotationLabel: boolean selectedAnnotationLabel: string | number | null setAnnotationEditMode: (mode: EditMode) => void diff --git a/libs/insight-viewer/src/Viewer/PolylineDrawer/index.tsx b/libs/insight-viewer/src/Viewer/PolylineDrawer/index.tsx index 63d9cf951..0c6e0134b 100644 --- a/libs/insight-viewer/src/Viewer/PolylineDrawer/index.tsx +++ b/libs/insight-viewer/src/Viewer/PolylineDrawer/index.tsx @@ -15,7 +15,6 @@ const PolylineElement = ({ export function PolylineDrawer({ annotation, - lineHead, isSelectedMode, selectedAnnotationLabel, showAnnotationLabel, @@ -56,7 +55,7 @@ export function PolylineDrawer({ {points && points.length > 0 && ( <> - {(lineHead === 'arrow' || type === 'arrowLine') && ( + {type === 'arrowLine' && ( <>