未验证 提交 c30c97b6 编写于 作者: B Boris Sekachev 提交者: GitHub

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

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

* Updated changelog
上级 65a8bc1e
......@@ -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>)
- 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>)
- 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>)
- Deleted frames become restored if a user deletes frames from another job of the same task
(<https://github.com/opencv/cvat/pull/5138>)
......
......@@ -70,7 +70,7 @@ export function getProjectTasksAsync(tasksQuery: Partial<TasksQuery> = {}): Thun
getState().projects.gettingQuery,
tasksQuery,
));
const query: TasksQuery = {
const query: Partial<TasksQuery> = {
...state.projects.tasksGettingQuery,
...tasksQuery,
};
......
......@@ -31,7 +31,7 @@ export enum TasksActionTypes {
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 = {
type: TasksActionTypes.GET_TASKS,
payload: {
......@@ -65,7 +65,10 @@ function getTasksFailed(error: any): AnyAction {
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> => {
dispatch(getTasks(query, updateQuery));
......
// Copyright (C) 2020-2022 Intel Corporation
// Copyright (C) 2022 CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT
......@@ -65,16 +66,7 @@ function mapDispatchToProps(dispatch: any, own: Props): DispatchToProps {
return {
getTask: (): void => {
dispatch(
getTasksAsync({
id,
page: 1,
search: null,
owner: null,
assignee: null,
name: null,
status: null,
mode: null,
}),
getTasksAsync({ id }),
);
},
};
......
......@@ -50,7 +50,10 @@ export default (state: TasksState = defaultState, action: AnyAction): TasksState
fetching: true,
hideEmpty: true,
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: {
const combinedWithPreviews = action.payload.array.map(
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册