Removed unused code (#3704)

main
Boris Sekachev 4 years ago committed by GitHub
parent 87246c5469
commit 620ad16b6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -150,7 +150,6 @@ export enum AnnotationActionTypes {
COLLAPSE_APPEARANCE = 'COLLAPSE_APPEARANCE', COLLAPSE_APPEARANCE = 'COLLAPSE_APPEARANCE',
COLLAPSE_OBJECT_ITEMS = 'COLLAPSE_OBJECT_ITEMS', COLLAPSE_OBJECT_ITEMS = 'COLLAPSE_OBJECT_ITEMS',
ACTIVATE_OBJECT = 'ACTIVATE_OBJECT', ACTIVATE_OBJECT = 'ACTIVATE_OBJECT',
SELECT_OBJECTS = 'SELECT_OBJECTS',
REMOVE_OBJECT_SUCCESS = 'REMOVE_OBJECT_SUCCESS', REMOVE_OBJECT_SUCCESS = 'REMOVE_OBJECT_SUCCESS',
REMOVE_OBJECT_FAILED = 'REMOVE_OBJECT_FAILED', REMOVE_OBJECT_FAILED = 'REMOVE_OBJECT_FAILED',
PROPAGATE_OBJECT = 'PROPAGATE_OBJECT', 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 { export function activateObject(activatedStateID: number | null, activatedAttributeID: number | null): AnyAction {
return { return {
type: AnnotationActionTypes.ACTIVATE_OBJECT, type: AnnotationActionTypes.ACTIVATE_OBJECT,
@ -689,8 +679,12 @@ export function getPredictionsAsync(): ThunkAction {
}; };
} }
export function changeFrameAsync(toFrame: number, fillBuffer?: boolean, frameStep?: number, export function changeFrameAsync(
forceUpdate?: boolean): ThunkAction { toFrame: number,
fillBuffer?: boolean,
frameStep?: number,
forceUpdate?: boolean,
): ThunkAction {
return async (dispatch: ActionCreator<Dispatch>): Promise<void> => { return async (dispatch: ActionCreator<Dispatch>): Promise<void> => {
const state: CombinedState = getStore().getState(); const state: CombinedState = getStore().getState();
const { instance: job } = state.annotation.job; const { instance: job } = state.annotation.job;

@ -31,7 +31,6 @@ interface Props {
jobInstance: any; jobInstance: any;
activatedStateID: number | null; activatedStateID: number | null;
activatedAttributeID: number | null; activatedAttributeID: number | null;
selectedStatesID: number[];
annotations: any[]; annotations: any[];
frameIssues: any[] | null; frameIssues: any[] | null;
frameData: any; frameData: any;
@ -82,7 +81,6 @@ interface Props {
onGroupAnnotations(sessionInstance: any, frame: number, states: any[]): void; onGroupAnnotations(sessionInstance: any, frame: number, states: any[]): void;
onSplitAnnotations(sessionInstance: any, frame: number, state: any): void; onSplitAnnotations(sessionInstance: any, frame: number, state: any): void;
onActivateObject(activatedStateID: number | null): void; onActivateObject(activatedStateID: number | null): void;
onSelectObjects(selectedStatesID: number[]): void;
onUpdateContextMenu(visible: boolean, left: number, top: number, type: ContextMenuType, pointID?: number): void; onUpdateContextMenu(visible: boolean, left: number, top: number, type: ContextMenuType, pointID?: number): void;
onAddZLayer(): void; onAddZLayer(): void;
onSwitchZLayer(cur: number): void; onSwitchZLayer(cur: number): void;

@ -22,7 +22,6 @@ import {
groupAnnotationsAsync, groupAnnotationsAsync,
splitAnnotationsAsync, splitAnnotationsAsync,
activateObject, activateObject,
selectObjects,
updateCanvasContextMenu, updateCanvasContextMenu,
addZLayer, addZLayer,
switchZLayer, switchZLayer,
@ -58,7 +57,6 @@ interface StateToProps {
jobInstance: any; jobInstance: any;
activatedStateID: number | null; activatedStateID: number | null;
activatedAttributeID: number | null; activatedAttributeID: number | null;
selectedStatesID: number[];
annotations: any[]; annotations: any[];
frameIssues: any[] | null; frameIssues: any[] | null;
frameData: any; frameData: any;
@ -112,7 +110,6 @@ interface DispatchToProps {
onGroupAnnotations(sessionInstance: any, frame: number, states: any[]): void; onGroupAnnotations(sessionInstance: any, frame: number, states: any[]): void;
onSplitAnnotations(sessionInstance: any, frame: number, state: any): void; onSplitAnnotations(sessionInstance: any, frame: number, state: any): void;
onActivateObject: (activatedStateID: number | null) => void; onActivateObject: (activatedStateID: number | null) => void;
onSelectObjects: (selectedStatesID: number[]) => void;
onUpdateContextMenu(visible: boolean, left: number, top: number, type: ContextMenuType, pointID?: number): void; onUpdateContextMenu(visible: boolean, left: number, top: number, type: ContextMenuType, pointID?: number): void;
onAddZLayer(): void; onAddZLayer(): void;
onSwitchZLayer(cur: number): void; onSwitchZLayer(cur: number): void;
@ -142,7 +139,6 @@ function mapStateToProps(state: CombinedState): StateToProps {
states: annotations, states: annotations,
activatedStateID, activatedStateID,
activatedAttributeID, activatedAttributeID,
selectedStatesID,
zLayer: { cur: curZLayer, min: minZLayer, max: maxZLayer }, zLayer: { cur: curZLayer, min: minZLayer, max: maxZLayer },
}, },
sidebarCollapsed, sidebarCollapsed,
@ -187,7 +183,6 @@ function mapStateToProps(state: CombinedState): StateToProps {
frame, frame,
activatedStateID, activatedStateID,
activatedAttributeID, activatedAttributeID,
selectedStatesID,
annotations, annotations,
opacity: opacity / 100, opacity: opacity / 100,
colorBy, colorBy,
@ -275,9 +270,6 @@ function mapDispatchToProps(dispatch: any): DispatchToProps {
dispatch(activateObject(activatedStateID, null)); dispatch(activateObject(activatedStateID, null));
}, },
onSelectObjects(selectedStatesID: number[]): void {
dispatch(selectObjects(selectedStatesID));
},
onUpdateContextMenu( onUpdateContextMenu(
visible: boolean, visible: boolean,
left: number, left: number,

@ -42,7 +42,6 @@ interface StateToProps {
sidebarCollapsed: boolean; sidebarCollapsed: boolean;
activatedStateID: number | null; activatedStateID: number | null;
activatedAttributeID: number | null; activatedAttributeID: number | null;
selectedStatesID: number[];
frameIssues: any[] | null; frameIssues: any[] | null;
frameAngle: number; frameAngle: number;
frameFetching: boolean; frameFetching: boolean;
@ -109,7 +108,6 @@ function mapStateToProps(state: CombinedState): StateToProps {
states: annotations, states: annotations,
activatedStateID, activatedStateID,
activatedAttributeID, activatedAttributeID,
selectedStatesID,
zLayer: { cur: curZLayer, min: minZLayer, max: maxZLayer }, zLayer: { cur: curZLayer, min: minZLayer, max: maxZLayer },
}, },
sidebarCollapsed, sidebarCollapsed,
@ -153,7 +151,6 @@ function mapStateToProps(state: CombinedState): StateToProps {
frame, frame,
activatedStateID, activatedStateID,
activatedAttributeID, activatedAttributeID,
selectedStatesID,
opacity, opacity,
colorBy, colorBy,
selectedOpacity, selectedOpacity,

@ -76,7 +76,6 @@ const defaultState: AnnotationState = {
activeObjectType: ObjectType.SHAPE, activeObjectType: ObjectType.SHAPE,
}, },
annotations: { annotations: {
selectedStatesID: [],
activatedStateID: null, activatedStateID: null,
activatedAttributeID: null, activatedAttributeID: null,
saving: { 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: { case AnnotationActionTypes.REMOVE_OBJECT_SUCCESS: {
const { objectState, history } = action.payload; const { objectState, history } = action.payload;
const contextMenuClientID = state.canvas.contextMenu.clientID; const contextMenuClientID = state.canvas.contextMenu.clientID;
@ -925,7 +913,6 @@ export default (state = defaultState, action: AnyAction): AnnotationState => {
...state.annotations, ...state.annotations,
history, history,
states, states,
selectedStatesID: [],
activatedStateID: null, activatedStateID: null,
collapsed: {}, collapsed: {},
}, },
@ -938,7 +925,6 @@ export default (state = defaultState, action: AnyAction): AnnotationState => {
annotations: { annotations: {
...state.annotations, ...state.annotations,
history, history,
selectedStatesID: [],
activatedStateID: null, activatedStateID: null,
collapsed: {}, collapsed: {},
states: [], states: [],

@ -237,7 +237,7 @@ export interface Model {
framework: string; framework: string;
description: string; description: string;
type: string; type: string;
onChangeToolsBlockerState: (event:string) => void; onChangeToolsBlockerState: (event: string) => void;
tip: { tip: {
message: string; message: string;
gif: string; gif: string;
@ -531,7 +531,6 @@ export interface AnnotationState {
activeInitialState?: any; activeInitialState?: any;
}; };
annotations: { annotations: {
selectedStatesID: number[];
activatedStateID: number | null; activatedStateID: number | null;
activatedAttributeID: number | null; activatedAttributeID: number | null;
collapsed: Record<number, boolean>; collapsed: Record<number, boolean>;

Loading…
Cancel
Save