diff --git a/cvat-canvas/src/typescript/master.ts b/cvat-canvas/src/typescript/master.ts index 9380e041..2bdf4cf2 100644 --- a/cvat-canvas/src/typescript/master.ts +++ b/cvat-canvas/src/typescript/master.ts @@ -1,11 +1,9 @@ -// Copyright (C) 2019-2020 Intel Corporation +// Copyright (C) 2019-2021 Intel Corporation // // SPDX-License-Identifier: MIT export interface Master { subscribe(listener: Listener): void; - unsubscribe(listener: Listener): void; - unsubscribeAll(): void; notify(reason: string): void; } @@ -24,18 +22,6 @@ export class MasterImpl implements Master { this.listeners.push(listener); } - public unsubscribe(listener: Listener): void { - for (let i = 0; i < this.listeners.length; i++) { - if (this.listeners[i] === listener) { - this.listeners.splice(i, 1); - } - } - } - - public unsubscribeAll(): void { - this.listeners = []; - } - public notify(reason: string): void { for (const listener of this.listeners) { listener.notify(this, reason); diff --git a/cvat-ui/src/containers/annotation-page/review-workspace/controls-side-bar/controls-side-bar.tsx b/cvat-ui/src/containers/annotation-page/review-workspace/controls-side-bar/controls-side-bar.tsx index 44f98442..8f3c67e3 100644 --- a/cvat-ui/src/containers/annotation-page/review-workspace/controls-side-bar/controls-side-bar.tsx +++ b/cvat-ui/src/containers/annotation-page/review-workspace/controls-side-bar/controls-side-bar.tsx @@ -5,17 +5,7 @@ import { connect } from 'react-redux'; import { Canvas } from 'cvat-canvas-wrapper'; -import { - selectIssuePosition as selectIssuePositionAction, - mergeObjects, - groupObjects, - splitTrack, - redrawShapeAsync, - rotateCurrentFrame, - repeatDrawShapeAsync, - pasteShapeAsync, - resetAnnotationsGroup, -} from 'actions/annotation-actions'; +import { selectIssuePosition as selectIssuePositionAction, rotateCurrentFrame } from 'actions/annotation-actions'; import ControlsSideBarComponent from 'components/annotation-page/review-workspace/controls-side-bar/controls-side-bar'; import { ActiveControl, CombinedState, Rotation } from 'reducers/interfaces'; import { KeyMap } from 'utils/mousetrap-react'; @@ -29,15 +19,8 @@ interface StateToProps { } interface DispatchToProps { - mergeObjects(enabled: boolean): void; - groupObjects(enabled: boolean): void; - splitTrack(enabled: boolean): void; rotateFrame(angle: Rotation): void; selectIssuePosition(enabled: boolean): void; - resetGroup(): void; - repeatDrawShape(): void; - pasteShape(): void; - redrawShape(): void; } function mapStateToProps(state: CombinedState): StateToProps { @@ -53,7 +36,7 @@ function mapStateToProps(state: CombinedState): StateToProps { return { rotateAll, - canvasInstance, + canvasInstance: canvasInstance as Canvas, activeControl, normalizedKeyMap, keyMap, @@ -62,33 +45,12 @@ function mapStateToProps(state: CombinedState): StateToProps { function dispatchToProps(dispatch: any): DispatchToProps { return { - mergeObjects(enabled: boolean): void { - dispatch(mergeObjects(enabled)); - }, - groupObjects(enabled: boolean): void { - dispatch(groupObjects(enabled)); - }, - splitTrack(enabled: boolean): void { - dispatch(splitTrack(enabled)); - }, selectIssuePosition(enabled: boolean): void { dispatch(selectIssuePositionAction(enabled)); }, rotateFrame(rotation: Rotation): void { dispatch(rotateCurrentFrame(rotation)); }, - repeatDrawShape(): void { - dispatch(repeatDrawShapeAsync()); - }, - pasteShape(): void { - dispatch(pasteShapeAsync()); - }, - resetGroup(): void { - dispatch(resetAnnotationsGroup()); - }, - redrawShape(): void { - dispatch(redrawShapeAsync()); - }, }; }