Skip to content
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

[CVAT-UI]: Appearance settings in AAM, keyframe navigation and other buttons in AAM #1820

Merged
merged 13 commits into from
Jul 2, 2020
Merged
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Ability to change orientation for poylgons/polylines in context menu (<https://github.com/opencv/cvat/pull/1571>)
- Ability to set the first point for polygons in points context menu (<https://github.com/opencv/cvat/pull/1571>)
- Added new tag annotation workspace (<https://github.com/opencv/cvat/pull/1570>)
- Appearance block in attribute annotation mode (<https://github.com/opencv/cvat/pull/1820>)
- Keyframe navigations and some switchers in attribute annotation mode (<https://github.com/opencv/cvat/pull/1820>)

### Changed
- Removed information about e-mail from the basic user information (<https://github.com/opencv/cvat/pull/1627>)
Expand Down
2 changes: 1 addition & 1 deletion cvat-ui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cvat-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cvat-ui",
"version": "1.5.1",
"version": "1.6.0",
"description": "CVAT single-page application",
"main": "src/index.tsx",
"scripts": {
Expand Down
58 changes: 26 additions & 32 deletions cvat-ui/src/actions/annotation-actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
ActionCreator,
Store,
} from 'redux';
import { ThunkAction } from 'redux-thunk';
import { ThunkAction } from 'utils/redux';

import {
CombinedState,
Expand Down Expand Up @@ -191,8 +191,7 @@ export enum AnnotationActionTypes {
SAVE_LOGS_FAILED = 'SAVE_LOGS_FAILED',
}

export function saveLogsAsync():
ThunkAction<Promise<void>, {}, {}, AnyAction> {
export function saveLogsAsync(): ThunkAction {
return async (dispatch: ActionCreator<Dispatch>) => {
try {
await logger.save();
Expand Down Expand Up @@ -236,7 +235,7 @@ export function switchZLayer(cur: number): AnyAction {
};
}

export function fetchAnnotationsAsync(): ThunkAction<Promise<void>, {}, {}, AnyAction> {
export function fetchAnnotationsAsync(): ThunkAction {
return async (dispatch: ActionCreator<Dispatch>): Promise<void> => {
try {
const {
Expand Down Expand Up @@ -308,8 +307,7 @@ export function updateCanvasContextMenu(
};
}

export function removeAnnotationsAsync(sessionInstance: any):
ThunkAction<Promise<void>, {}, {}, AnyAction> {
export function removeAnnotationsAsync(sessionInstance: any): ThunkAction {
return async (dispatch: ActionCreator<Dispatch>): Promise<void> => {
try {
await sessionInstance.annotations.clear();
Expand All @@ -333,8 +331,7 @@ ThunkAction<Promise<void>, {}, {}, AnyAction> {
};
}

export function uploadJobAnnotationsAsync(job: any, loader: any, file: File):
ThunkAction<Promise<void>, {}, {}, AnyAction> {
export function uploadJobAnnotationsAsync(job: any, loader: any, file: File): ThunkAction {
return async (dispatch: ActionCreator<Dispatch>): Promise<void> => {
try {
const state: CombinedState = getStore().getState();
Expand Down Expand Up @@ -404,8 +401,7 @@ ThunkAction<Promise<void>, {}, {}, AnyAction> {
};
}

export function changeJobStatusAsync(jobInstance: any, status: string):
ThunkAction<Promise<void>, {}, {}, AnyAction> {
export function changeJobStatusAsync(jobInstance: any, status: string): ThunkAction {
return async (dispatch: ActionCreator<Dispatch>): Promise<void> => {
const oldStatus = jobInstance.status;
try {
Expand Down Expand Up @@ -435,8 +431,7 @@ ThunkAction<Promise<void>, {}, {}, AnyAction> {
};
}

export function collectStatisticsAsync(sessionInstance: any):
ThunkAction<Promise<void>, {}, {}, AnyAction> {
export function collectStatisticsAsync(sessionInstance: any): ThunkAction {
return async (dispatch: ActionCreator<Dispatch>): Promise<void> => {
try {
dispatch({
Expand Down Expand Up @@ -477,7 +472,7 @@ export function propagateObjectAsync(
objectState: any,
from: number,
to: number,
): ThunkAction<Promise<void>, {}, {}, AnyAction> {
): ThunkAction {
return async (dispatch: ActionCreator<Dispatch>): Promise<void> => {
try {
const copy = {
Expand Down Expand Up @@ -542,7 +537,7 @@ export function changePropagateFrames(frames: number): AnyAction {
}

export function removeObjectAsync(sessionInstance: any, objectState: any, force: boolean):
ThunkAction<Promise<void>, {}, {}, AnyAction> {
ThunkAction {
return async (dispatch: ActionCreator<Dispatch>): Promise<void> => {
try {
await sessionInstance.logger.log(LogType.deleteObject, { count: 1 });
Expand Down Expand Up @@ -659,7 +654,7 @@ export function switchPlay(playing: boolean): AnyAction {
}

export function changeFrameAsync(toFrame: number, fillBuffer?: boolean, frameStep?: number):
ThunkAction<Promise<void>, {}, {}, AnyAction> {
ThunkAction {
return async (dispatch: ActionCreator<Dispatch>): Promise<void> => {
const state: CombinedState = getStore().getState();
const { instance: job } = state.annotation.job;
Expand Down Expand Up @@ -751,7 +746,7 @@ ThunkAction<Promise<void>, {}, {}, AnyAction> {
}

export function undoActionAsync(sessionInstance: any, frame: number):
ThunkAction<Promise<void>, {}, {}, AnyAction> {
ThunkAction {
return async (dispatch: ActionCreator<Dispatch>): Promise<void> => {
try {
const state = getStore().getState();
Expand Down Expand Up @@ -794,7 +789,7 @@ ThunkAction<Promise<void>, {}, {}, AnyAction> {
}

export function redoActionAsync(sessionInstance: any, frame: number):
ThunkAction<Promise<void>, {}, {}, AnyAction> {
ThunkAction {
return async (dispatch: ActionCreator<Dispatch>): Promise<void> => {
try {
const state = getStore().getState();
Expand Down Expand Up @@ -906,7 +901,7 @@ export function confirmCanvasReady(): AnyAction {
};
}

export function closeJob(): ThunkAction<Promise<void>, {}, {}, AnyAction> {
export function closeJob(): ThunkAction {
return async (dispatch: ActionCreator<Dispatch>): Promise<void> => {
const { jobInstance } = receiveAnnotationsParameters();
if (jobInstance) {
Expand All @@ -924,7 +919,7 @@ export function getJobAsync(
jid: number,
initialFrame: number,
initialFilters: string[],
): ThunkAction<Promise<void>, {}, {}, AnyAction> {
): ThunkAction {
return async (dispatch: ActionCreator<Dispatch>): Promise<void> => {
try {
const state: CombinedState = getStore().getState();
Expand Down Expand Up @@ -1001,7 +996,7 @@ export function getJobAsync(
}

export function saveAnnotationsAsync(sessionInstance: any):
ThunkAction<Promise<void>, {}, {}, AnyAction> {
ThunkAction {
return async (dispatch: ActionCreator<Dispatch>): Promise<void> => {
const { filters, frame, showAllInterpolationTracks } = receiveAnnotationsParameters();

Expand Down Expand Up @@ -1118,8 +1113,7 @@ export function splitTrack(enabled: boolean): AnyAction {
};
}

export function updateAnnotationsAsync(statesToUpdate: any[]):
ThunkAction<Promise<void>, {}, {}, AnyAction> {
export function updateAnnotationsAsync(statesToUpdate: any[]): ThunkAction {
return async (dispatch: ActionCreator<Dispatch>): Promise<void> => {
const {
jobInstance,
Expand Down Expand Up @@ -1164,7 +1158,7 @@ ThunkAction<Promise<void>, {}, {}, AnyAction> {
}

export function createAnnotationsAsync(sessionInstance: any, frame: number, statesToCreate: any[]):
ThunkAction<Promise<void>, {}, {}, AnyAction> {
ThunkAction {
return async (dispatch: ActionCreator<Dispatch>): Promise<void> => {
try {
const { filters, showAllInterpolationTracks } = receiveAnnotationsParameters();
Expand Down Expand Up @@ -1192,7 +1186,7 @@ ThunkAction<Promise<void>, {}, {}, AnyAction> {
}

export function mergeAnnotationsAsync(sessionInstance: any, frame: number, statesToMerge: any[]):
ThunkAction<Promise<void>, {}, {}, AnyAction> {
ThunkAction {
return async (dispatch: ActionCreator<Dispatch>): Promise<void> => {
try {
const { filters, showAllInterpolationTracks } = receiveAnnotationsParameters();
Expand Down Expand Up @@ -1230,7 +1224,7 @@ export function groupAnnotationsAsync(
sessionInstance: any,
frame: number,
statesToGroup: any[],
): ThunkAction<Promise<void>, {}, {}, AnyAction> {
): ThunkAction {
return async (dispatch: ActionCreator<Dispatch>): Promise<void> => {
try {
const { filters, showAllInterpolationTracks } = receiveAnnotationsParameters();
Expand Down Expand Up @@ -1266,7 +1260,7 @@ export function groupAnnotationsAsync(
}

export function splitAnnotationsAsync(sessionInstance: any, frame: number, stateToSplit: any):
ThunkAction<Promise<void>, {}, {}, AnyAction> {
ThunkAction {
return async (dispatch: ActionCreator<Dispatch>): Promise<void> => {
const { filters, showAllInterpolationTracks } = receiveAnnotationsParameters();
try {
Expand Down Expand Up @@ -1296,7 +1290,7 @@ ThunkAction<Promise<void>, {}, {}, AnyAction> {
export function changeLabelColorAsync(
label: any,
color: string,
): ThunkAction<Promise<void>, {}, {}, AnyAction> {
): ThunkAction {
return async (dispatch: ActionCreator<Dispatch>): Promise<void> => {
try {
const {
Expand Down Expand Up @@ -1334,7 +1328,7 @@ export function changeLabelColorAsync(
export function changeGroupColorAsync(
group: number,
color: string,
): ThunkAction<Promise<void>, {}, {}, AnyAction> {
): ThunkAction {
return async (dispatch: ActionCreator<Dispatch>): Promise<void> => {
const state: CombinedState = getStore().getState();
const groupStates = state.annotation.annotations.states
Expand All @@ -1352,7 +1346,7 @@ export function searchAnnotationsAsync(
sessionInstance: any,
frameFrom: number,
frameTo: number,
): ThunkAction<Promise<void>, {}, {}, AnyAction> {
): ThunkAction {
return async (dispatch: ActionCreator<Dispatch>): Promise<void> => {
try {
const { filters } = receiveAnnotationsParameters();
Expand All @@ -1371,7 +1365,7 @@ export function searchAnnotationsAsync(
};
}

export function pasteShapeAsync(): ThunkAction<Promise<void>, {}, {}, AnyAction> {
export function pasteShapeAsync(): ThunkAction {
return async (dispatch: ActionCreator<Dispatch>): Promise<void> => {
const {
canvas: {
Expand Down Expand Up @@ -1430,7 +1424,7 @@ export function pasteShapeAsync(): ThunkAction<Promise<void>, {}, {}, AnyAction>
};
}

export function repeatDrawShapeAsync(): ThunkAction<Promise<void>, {}, {}, AnyAction> {
export function repeatDrawShapeAsync(): ThunkAction {
return async (dispatch: ActionCreator<Dispatch>): Promise<void> => {
const {
canvas: {
Expand Down Expand Up @@ -1494,7 +1488,7 @@ export function repeatDrawShapeAsync(): ThunkAction<Promise<void>, {}, {}, AnyAc
};
}

export function redrawShapeAsync(): ThunkAction<Promise<void>, {}, {}, AnyAction> {
export function redrawShapeAsync(): ThunkAction {
return async (dispatch: ActionCreator<Dispatch>): Promise<void> => {
const {
annotations: {
Expand Down
Loading