Skip to content

Removed unused code #3704

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 6 additions & 12 deletions cvat-ui/src/actions/annotation-actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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<Dispatch>): Promise<void> => {
const state: CombinedState = getStore().getState();
const { instance: job } = state.annotation.job;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ interface Props {
jobInstance: any;
activatedStateID: number | null;
activatedAttributeID: number | null;
selectedStatesID: number[];
annotations: any[];
frameIssues: any[] | null;
frameData: any;
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import {
groupAnnotationsAsync,
splitAnnotationsAsync,
activateObject,
selectObjects,
updateCanvasContextMenu,
addZLayer,
switchZLayer,
Expand Down Expand Up @@ -58,7 +57,6 @@ interface StateToProps {
jobInstance: any;
activatedStateID: number | null;
activatedAttributeID: number | null;
selectedStatesID: number[];
annotations: any[];
frameIssues: any[] | null;
frameData: any;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -142,7 +139,6 @@ function mapStateToProps(state: CombinedState): StateToProps {
states: annotations,
activatedStateID,
activatedAttributeID,
selectedStatesID,
zLayer: { cur: curZLayer, min: minZLayer, max: maxZLayer },
},
sidebarCollapsed,
Expand Down Expand Up @@ -187,7 +183,6 @@ function mapStateToProps(state: CombinedState): StateToProps {
frame,
activatedStateID,
activatedAttributeID,
selectedStatesID,
annotations,
opacity: opacity / 100,
colorBy,
Expand Down Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ interface StateToProps {
sidebarCollapsed: boolean;
activatedStateID: number | null;
activatedAttributeID: number | null;
selectedStatesID: number[];
frameIssues: any[] | null;
frameAngle: number;
frameFetching: boolean;
Expand Down Expand Up @@ -109,7 +108,6 @@ function mapStateToProps(state: CombinedState): StateToProps {
states: annotations,
activatedStateID,
activatedAttributeID,
selectedStatesID,
zLayer: { cur: curZLayer, min: minZLayer, max: maxZLayer },
},
sidebarCollapsed,
Expand Down Expand Up @@ -153,7 +151,6 @@ function mapStateToProps(state: CombinedState): StateToProps {
frame,
activatedStateID,
activatedAttributeID,
selectedStatesID,
opacity,
colorBy,
selectedOpacity,
Expand Down
14 changes: 0 additions & 14 deletions cvat-ui/src/reducers/annotation-reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ const defaultState: AnnotationState = {
activeObjectType: ObjectType.SHAPE,
},
annotations: {
selectedStatesID: [],
activatedStateID: null,
activatedAttributeID: null,
saving: {
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -925,7 +913,6 @@ export default (state = defaultState, action: AnyAction): AnnotationState => {
...state.annotations,
history,
states,
selectedStatesID: [],
activatedStateID: null,
collapsed: {},
},
Expand All @@ -938,7 +925,6 @@ export default (state = defaultState, action: AnyAction): AnnotationState => {
annotations: {
...state.annotations,
history,
selectedStatesID: [],
activatedStateID: null,
collapsed: {},
states: [],
Expand Down
3 changes: 1 addition & 2 deletions cvat-ui/src/reducers/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -531,7 +531,6 @@ export interface AnnotationState {
activeInitialState?: any;
};
annotations: {
selectedStatesID: number[];
activatedStateID: number | null;
activatedAttributeID: number | null;
collapsed: Record<number, boolean>;
Expand Down