Fixed error: could not fetch task in a corner case (#5163)

* Fixed error: could not fetch task in a corner case

* Updated changelog
main
Boris Sekachev 3 years ago committed by GitHub
parent 65a8bc1ea4
commit c30c97b6af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -51,6 +51,7 @@ non-ascii paths while adding files from "Connected file share" (issue #4428)
- Fixed bug of computing Job's unsolved/resolved issues numbers (<https://github.com/opencv/cvat/pull/5101>) - Fixed bug of computing Job's unsolved/resolved issues numbers (<https://github.com/opencv/cvat/pull/5101>)
- Dataset export for job (<https://github.com/opencv/cvat/pull/5052>) - Dataset export for job (<https://github.com/opencv/cvat/pull/5052>)
- Angle is not propagated when use ``propagate`` feature (<https://github.com/opencv/cvat/pull/5139>) - Angle is not propagated when use ``propagate`` feature (<https://github.com/opencv/cvat/pull/5139>)
- Could not fetch task in a corner case (<https://github.com/opencv/cvat/pull/5163>)
- Restoring CVAT in case of React-renderning fail (<https://github.com/opencv/cvat/pull/5134>) - Restoring CVAT in case of React-renderning fail (<https://github.com/opencv/cvat/pull/5134>)
- Deleted frames become restored if a user deletes frames from another job of the same task - Deleted frames become restored if a user deletes frames from another job of the same task
(<https://github.com/opencv/cvat/pull/5138>) (<https://github.com/opencv/cvat/pull/5138>)

@ -70,7 +70,7 @@ export function getProjectTasksAsync(tasksQuery: Partial<TasksQuery> = {}): Thun
getState().projects.gettingQuery, getState().projects.gettingQuery,
tasksQuery, tasksQuery,
)); ));
const query: TasksQuery = { const query: Partial<TasksQuery> = {
...state.projects.tasksGettingQuery, ...state.projects.tasksGettingQuery,
...tasksQuery, ...tasksQuery,
}; };

@ -31,7 +31,7 @@ export enum TasksActionTypes {
SWITCH_MOVE_TASK_MODAL_VISIBLE = 'SWITCH_MOVE_TASK_MODAL_VISIBLE', SWITCH_MOVE_TASK_MODAL_VISIBLE = 'SWITCH_MOVE_TASK_MODAL_VISIBLE',
} }
function getTasks(query: TasksQuery, updateQuery: boolean): AnyAction { function getTasks(query: Partial<TasksQuery>, updateQuery: boolean): AnyAction {
const action = { const action = {
type: TasksActionTypes.GET_TASKS, type: TasksActionTypes.GET_TASKS,
payload: { payload: {
@ -65,7 +65,10 @@ function getTasksFailed(error: any): AnyAction {
return action; return action;
} }
export function getTasksAsync(query: TasksQuery, updateQuery = true): ThunkAction<Promise<void>, {}, {}, AnyAction> { export function getTasksAsync(
query: Partial<TasksQuery>,
updateQuery = true,
): ThunkAction<Promise<void>, {}, {}, AnyAction> {
return async (dispatch: ActionCreator<Dispatch>): Promise<void> => { return async (dispatch: ActionCreator<Dispatch>): Promise<void> => {
dispatch(getTasks(query, updateQuery)); dispatch(getTasks(query, updateQuery));

@ -1,4 +1,5 @@
// Copyright (C) 2020-2022 Intel Corporation // Copyright (C) 2020-2022 Intel Corporation
// Copyright (C) 2022 CVAT.ai Corporation
// //
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
@ -65,16 +66,7 @@ function mapDispatchToProps(dispatch: any, own: Props): DispatchToProps {
return { return {
getTask: (): void => { getTask: (): void => {
dispatch( dispatch(
getTasksAsync({ getTasksAsync({ id }),
id,
page: 1,
search: null,
owner: null,
assignee: null,
name: null,
status: null,
mode: null,
}),
); );
}, },
}; };

@ -50,7 +50,10 @@ export default (state: TasksState = defaultState, action: AnyAction): TasksState
fetching: true, fetching: true,
hideEmpty: true, hideEmpty: true,
count: 0, count: 0,
gettingQuery: action.payload.updateQuery ? { ...action.payload.query } : state.gettingQuery, gettingQuery: action.payload.updateQuery ? {
...defaultState.gettingQuery,
...action.payload.query,
} : state.gettingQuery,
}; };
case TasksActionTypes.GET_TASKS_SUCCESS: { case TasksActionTypes.GET_TASKS_SUCCESS: {
const combinedWithPreviews = action.payload.array.map( const combinedWithPreviews = action.payload.array.map(

Loading…
Cancel
Save