From 620ad16b6f259bf4d67fa41c2807ceb8026c7838 Mon Sep 17 00:00:00 2001 From: Boris Sekachev Date: Wed, 22 Sep 2021 17:57:28 +0300 Subject: [PATCH] Removed unused code (#3704) --- cvat-ui/src/actions/annotation-actions.ts | 18 ++++++------------ .../annotation-page/canvas/canvas-wrapper.tsx | 2 -- .../annotation-page/canvas/canvas-wrapper.tsx | 8 -------- .../canvas/canvas-wrapper3D.tsx | 3 --- cvat-ui/src/reducers/annotation-reducer.ts | 14 -------------- cvat-ui/src/reducers/interfaces.ts | 3 +-- 6 files changed, 7 insertions(+), 41 deletions(-) diff --git a/cvat-ui/src/actions/annotation-actions.ts b/cvat-ui/src/actions/annotation-actions.ts index 96bfb8d2..af16ba2f 100644 --- a/cvat-ui/src/actions/annotation-actions.ts +++ b/cvat-ui/src/actions/annotation-actions.ts @@ -150,7 +150,6 @@ export enum AnnotationActionTypes { COLLAPSE_APPEARANCE = 'COLLAPSE_APPEARANCE', COLLAPSE_OBJECT_ITEMS = 'COLLAPSE_OBJECT_ITEMS', ACTIVATE_OBJECT = 'ACTIVATE_OBJECT', - SELECT_OBJECTS = 'SELECT_OBJECTS', REMOVE_OBJECT_SUCCESS = 'REMOVE_OBJECT_SUCCESS', REMOVE_OBJECT_FAILED = 'REMOVE_OBJECT_FAILED', PROPAGATE_OBJECT = 'PROPAGATE_OBJECT', @@ -556,15 +555,6 @@ export function copyShape(objectState: any): AnyAction { }; } -export function selectObjects(selectedStatesID: number[]): AnyAction { - return { - type: AnnotationActionTypes.SELECT_OBJECTS, - payload: { - selectedStatesID, - }, - }; -} - export function activateObject(activatedStateID: number | null, activatedAttributeID: number | null): AnyAction { return { type: AnnotationActionTypes.ACTIVATE_OBJECT, @@ -689,8 +679,12 @@ export function getPredictionsAsync(): ThunkAction { }; } -export function changeFrameAsync(toFrame: number, fillBuffer?: boolean, frameStep?: number, - forceUpdate?: boolean): ThunkAction { +export function changeFrameAsync( + toFrame: number, + fillBuffer?: boolean, + frameStep?: number, + forceUpdate?: boolean, +): ThunkAction { return async (dispatch: ActionCreator): Promise => { const state: CombinedState = getStore().getState(); const { instance: job } = state.annotation.job; diff --git a/cvat-ui/src/components/annotation-page/canvas/canvas-wrapper.tsx b/cvat-ui/src/components/annotation-page/canvas/canvas-wrapper.tsx index 1afcc0c8..0b844205 100644 --- a/cvat-ui/src/components/annotation-page/canvas/canvas-wrapper.tsx +++ b/cvat-ui/src/components/annotation-page/canvas/canvas-wrapper.tsx @@ -31,7 +31,6 @@ interface Props { jobInstance: any; activatedStateID: number | null; activatedAttributeID: number | null; - selectedStatesID: number[]; annotations: any[]; frameIssues: any[] | null; frameData: any; @@ -82,7 +81,6 @@ interface Props { onGroupAnnotations(sessionInstance: any, frame: number, states: any[]): void; onSplitAnnotations(sessionInstance: any, frame: number, state: any): void; onActivateObject(activatedStateID: number | null): void; - onSelectObjects(selectedStatesID: number[]): void; onUpdateContextMenu(visible: boolean, left: number, top: number, type: ContextMenuType, pointID?: number): void; onAddZLayer(): void; onSwitchZLayer(cur: number): void; diff --git a/cvat-ui/src/containers/annotation-page/canvas/canvas-wrapper.tsx b/cvat-ui/src/containers/annotation-page/canvas/canvas-wrapper.tsx index d7d52d9a..59b4af02 100644 --- a/cvat-ui/src/containers/annotation-page/canvas/canvas-wrapper.tsx +++ b/cvat-ui/src/containers/annotation-page/canvas/canvas-wrapper.tsx @@ -22,7 +22,6 @@ import { groupAnnotationsAsync, splitAnnotationsAsync, activateObject, - selectObjects, updateCanvasContextMenu, addZLayer, switchZLayer, @@ -58,7 +57,6 @@ interface StateToProps { jobInstance: any; activatedStateID: number | null; activatedAttributeID: number | null; - selectedStatesID: number[]; annotations: any[]; frameIssues: any[] | null; frameData: any; @@ -112,7 +110,6 @@ interface DispatchToProps { onGroupAnnotations(sessionInstance: any, frame: number, states: any[]): void; onSplitAnnotations(sessionInstance: any, frame: number, state: any): void; onActivateObject: (activatedStateID: number | null) => void; - onSelectObjects: (selectedStatesID: number[]) => void; onUpdateContextMenu(visible: boolean, left: number, top: number, type: ContextMenuType, pointID?: number): void; onAddZLayer(): void; onSwitchZLayer(cur: number): void; @@ -142,7 +139,6 @@ function mapStateToProps(state: CombinedState): StateToProps { states: annotations, activatedStateID, activatedAttributeID, - selectedStatesID, zLayer: { cur: curZLayer, min: minZLayer, max: maxZLayer }, }, sidebarCollapsed, @@ -187,7 +183,6 @@ function mapStateToProps(state: CombinedState): StateToProps { frame, activatedStateID, activatedAttributeID, - selectedStatesID, annotations, opacity: opacity / 100, colorBy, @@ -275,9 +270,6 @@ function mapDispatchToProps(dispatch: any): DispatchToProps { dispatch(activateObject(activatedStateID, null)); }, - onSelectObjects(selectedStatesID: number[]): void { - dispatch(selectObjects(selectedStatesID)); - }, onUpdateContextMenu( visible: boolean, left: number, diff --git a/cvat-ui/src/containers/annotation-page/canvas/canvas-wrapper3D.tsx b/cvat-ui/src/containers/annotation-page/canvas/canvas-wrapper3D.tsx index 8912a460..eb1847c3 100644 --- a/cvat-ui/src/containers/annotation-page/canvas/canvas-wrapper3D.tsx +++ b/cvat-ui/src/containers/annotation-page/canvas/canvas-wrapper3D.tsx @@ -42,7 +42,6 @@ interface StateToProps { sidebarCollapsed: boolean; activatedStateID: number | null; activatedAttributeID: number | null; - selectedStatesID: number[]; frameIssues: any[] | null; frameAngle: number; frameFetching: boolean; @@ -109,7 +108,6 @@ function mapStateToProps(state: CombinedState): StateToProps { states: annotations, activatedStateID, activatedAttributeID, - selectedStatesID, zLayer: { cur: curZLayer, min: minZLayer, max: maxZLayer }, }, sidebarCollapsed, @@ -153,7 +151,6 @@ function mapStateToProps(state: CombinedState): StateToProps { frame, activatedStateID, activatedAttributeID, - selectedStatesID, opacity, colorBy, selectedOpacity, diff --git a/cvat-ui/src/reducers/annotation-reducer.ts b/cvat-ui/src/reducers/annotation-reducer.ts index eb71b8fa..cb273556 100644 --- a/cvat-ui/src/reducers/annotation-reducer.ts +++ b/cvat-ui/src/reducers/annotation-reducer.ts @@ -76,7 +76,6 @@ const defaultState: AnnotationState = { activeObjectType: ObjectType.SHAPE, }, annotations: { - selectedStatesID: [], activatedStateID: null, activatedAttributeID: null, saving: { @@ -718,17 +717,6 @@ export default (state = defaultState, action: AnyAction): AnnotationState => { }, }; } - case AnnotationActionTypes.SELECT_OBJECTS: { - const { selectedStatesID } = action.payload; - - return { - ...state, - annotations: { - ...state.annotations, - selectedStatesID, - }, - }; - } case AnnotationActionTypes.REMOVE_OBJECT_SUCCESS: { const { objectState, history } = action.payload; const contextMenuClientID = state.canvas.contextMenu.clientID; @@ -925,7 +913,6 @@ export default (state = defaultState, action: AnyAction): AnnotationState => { ...state.annotations, history, states, - selectedStatesID: [], activatedStateID: null, collapsed: {}, }, @@ -938,7 +925,6 @@ export default (state = defaultState, action: AnyAction): AnnotationState => { annotations: { ...state.annotations, history, - selectedStatesID: [], activatedStateID: null, collapsed: {}, states: [], diff --git a/cvat-ui/src/reducers/interfaces.ts b/cvat-ui/src/reducers/interfaces.ts index c2ca8f4c..45a85d3a 100644 --- a/cvat-ui/src/reducers/interfaces.ts +++ b/cvat-ui/src/reducers/interfaces.ts @@ -237,7 +237,7 @@ export interface Model { framework: string; description: string; type: string; - onChangeToolsBlockerState: (event:string) => void; + onChangeToolsBlockerState: (event: string) => void; tip: { message: string; gif: string; @@ -531,7 +531,6 @@ export interface AnnotationState { activeInitialState?: any; }; annotations: { - selectedStatesID: number[]; activatedStateID: number | null; activatedAttributeID: number | null; collapsed: Record;