Skip to content

Commit

Permalink
Merge pull request #6896 from opencv/release-2.7.2
Browse files Browse the repository at this point in the history
Release v2.7.2
  • Loading branch information
SpecLad authored Sep 26, 2023
2 parents 10e71d6 + 2bd22b8 commit 4c29752
Show file tree
Hide file tree
Showing 88 changed files with 1,776 additions and 739 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ jobs:

- uses: actions/setup-node@v3
with:
node-version: '16.x'
node-version: '18.x'

- name: Download CVAT server image
uses: actions/download-artifact@v3
Expand Down
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,28 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## \[2.7.2\] - 2023-09-25

### Changed

- Do not reload annotation view when renew the job or update job state (<https://github.com/opencv/cvat/pull/6851>)
- Now images from cloud buckets are loaded in parallel when preparing a chunk (<https://github.com/opencv/cvat/pull/6881>)

### Fixed

- Downloading additional data from cloud storage if use_cache=true and job_file_mapping are specified
(<https://github.com/opencv/cvat/pull/6879>)
- Leaving an organization (<https://github.com/opencv/cvat/pull/6422>)

## \[2.7.1\] - 2023-09-15

### Fixed

- Include cloud storage manifest file to selected files if manifest was used as data source (<https://github.com/opencv/cvat/pull/6850>)
- Keep sequence of files when directories were specified in server_files (<https://github.com/opencv/cvat/pull/6850>)

## \[2.7.0\] - 2023-09-10

### Added

- Admin actions for easy activation/deactivation of users (<https://github.com/opencv/cvat/pull/6314>)
Expand Down
2 changes: 1 addition & 1 deletion cvat-cli/requirements/base.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
cvat-sdk~=2.7.1
cvat-sdk~=2.7.2
Pillow>=6.2.0
setuptools>=65.5.1 # not directly required, pinned by Snyk to avoid a vulnerability
2 changes: 1 addition & 1 deletion cvat-cli/src/cvat_cli/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VERSION = "2.7.1"
VERSION = "2.7.2"
2 changes: 1 addition & 1 deletion cvat-core/src/organization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ Object.defineProperties(Organization.prototype.leave, {
const result = await serverProxy.organizations.members(this.slug, 1, 10, {
filter: JSON.stringify({
and: [{
'==': [{ var: 'user' }, user.id],
'==': [{ var: 'user' }, user.username],
}],
}),
});
Expand Down
18 changes: 15 additions & 3 deletions cvat-core/src/session-implementation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,21 @@ export function implementJob(Job) {
jobData.assignee = jobData.assignee.id;
}

const data = await serverProxy.jobs.save(this.id, jobData);
this._updateTrigger.reset();
return new Job(data);
let updatedJob = null;
try {
const data = await serverProxy.jobs.save(this.id, jobData);
updatedJob = new Job(data);
this._updateTrigger.reset();
} catch (error) {
updatedJob = new Job(this._initialData);
throw error;
} finally {
this.stage = updatedJob.stage;
this.state = updatedJob.state;
this.assignee = updatedJob.assignee;
}

return this;
}

const jobSpec = {
Expand Down
5 changes: 4 additions & 1 deletion cvat-core/src/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ export class Job extends Session {
log: CallableFunction;
};

constructor(initialData: SerializedJob) {
constructor(initialData: Readonly<SerializedJob>) {
super();
const data = {
id: undefined,
Expand Down Expand Up @@ -536,6 +536,9 @@ export class Job extends Session {
_updateTrigger: {
get: () => updateTrigger,
},
_initialData: {
get: () => initialData,
},
}),
);

Expand Down
2 changes: 1 addition & 1 deletion cvat-sdk/gen/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ set -e

GENERATOR_VERSION="v6.0.1"

VERSION="2.7.1"
VERSION="2.7.2"
LIB_NAME="cvat_sdk"
LAYER1_LIB_NAME="${LIB_NAME}/api_client"
DST_DIR="$(cd "$(dirname -- "$0")/.." && pwd)"
Expand Down
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.56.1",
"version": "1.56.2",
"description": "CVAT single-page application",
"main": "src/index.tsx",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion cvat-ui/src/actions/annotation-actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import {
ShapeType,
Workspace,
} from 'reducers';
import { updateJobAsync } from './tasks-actions';
import { updateJobAsync } from './jobs-actions';
import { switchToolsBlockerState } from './settings-actions';

interface AnnotationsParameters {
Expand Down
27 changes: 27 additions & 0 deletions cvat-ui/src/actions/jobs-actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ export enum JobsActionTypes {
GET_JOB_PREVIEW_SUCCESS = 'GET_JOB_PREVIEW_SUCCESS',
GET_JOB_PREVIEW_FAILED = 'GET_JOB_PREVIEW_FAILED',
CREATE_JOB_FAILED = 'CREATE_JOB_FAILED',
UPDATE_JOB = 'UPDATE_JOB',
UPDATE_JOB_SUCCESS = 'UPDATE_JOB_SUCCESS',
UPDATE_JOB_FAILED = 'UPDATE_JOB_FAILED',
DELETE_JOB = 'DELETE_JOB',
DELETE_JOB_SUCCESS = 'DELETE_JOB_SUCCESS',
DELETE_JOB_FAILED = 'DELETE_JOB_FAILED',
Expand Down Expand Up @@ -46,6 +49,15 @@ const jobsActions = {
createJobFailed: (error: any) => (
createAction(JobsActionTypes.CREATE_JOB_FAILED, { error })
),
updateJob: () => (
createAction(JobsActionTypes.UPDATE_JOB)
),
updateJobSuccess: (job: Job) => (
createAction(JobsActionTypes.UPDATE_JOB_SUCCESS, { job })
),
updateJobFailed: (jobID: number, error: any) => (
createAction(JobsActionTypes.UPDATE_JOB_FAILED, { jobID, error })
),
deleteJob: (jobID: number) => (
createAction(JobsActionTypes.DELETE_JOB, { jobID })
),
Expand Down Expand Up @@ -93,6 +105,21 @@ export const createJobAsync = (data: JobData): ThunkAction => async (dispatch) =
}
};

export function updateJobAsync(jobInstance: Job): ThunkAction<Promise<boolean>> {
return async (dispatch): Promise<boolean> => {
try {
dispatch(jobsActions.updateJob());
const updated = await jobInstance.save();
dispatch(jobsActions.updateJobSuccess(updated));
} catch (error) {
dispatch(jobsActions.updateJobFailed(jobInstance.id, error));
return false;
}

return true;
};
}

export const deleteJobAsync = (job: Job): ThunkAction => async (dispatch) => {
dispatch(jobsActions.deleteJob(job.id));
try {
Expand Down
7 changes: 5 additions & 2 deletions cvat-ui/src/actions/organization-actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,14 +212,17 @@ export function inviteOrganizationMembersAsync(
};
}

export function leaveOrganizationAsync(organization: any): ThunkAction {
export function leaveOrganizationAsync(
organization: any,
onLeaveSuccess?: () => void,
): ThunkAction {
return async function (dispatch, getState) {
const { user } = getState().auth;
dispatch(organizationActions.leaveOrganization());
try {
await organization.leave(user);
dispatch(organizationActions.leaveOrganizationSuccess());
localStorage.removeItem('currentOrganization');
if (onLeaveSuccess) onLeaveSuccess();
} catch (error) {
dispatch(organizationActions.leaveOrganizationFailed(error));
}
Expand Down
20 changes: 0 additions & 20 deletions cvat-ui/src/actions/tasks-actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ export enum TasksActionTypes {
DELETE_TASK_SUCCESS = 'DELETE_TASK_SUCCESS',
DELETE_TASK_FAILED = 'DELETE_TASK_FAILED',
CREATE_TASK_FAILED = 'CREATE_TASK_FAILED',
UPDATE_JOB_FAILED = 'UPDATE_JOB_FAILED',
SWITCH_MOVE_TASK_MODAL_VISIBLE = 'SWITCH_MOVE_TASK_MODAL_VISIBLE',
GET_TASK_PREVIEW = 'GET_TASK_PREVIEW',
GET_TASK_PREVIEW_SUCCESS = 'GET_TASK_PREVIEW_SUCCESS',
Expand Down Expand Up @@ -294,25 +293,6 @@ ThunkAction<Promise<void>, {}, {}, AnyAction> {
};
}

function updateJobFailed(jobID: number, error: any): AnyAction {
const action = {
type: TasksActionTypes.UPDATE_JOB_FAILED,
payload: { jobID, error },
};

return action;
}

export function updateJobAsync(jobInstance: any): ThunkAction<Promise<void>, {}, {}, AnyAction> {
return async (dispatch: ActionCreator<Dispatch>): Promise<void> => {
try {
await jobInstance.save();
} catch (error) {
dispatch(updateJobFailed(jobInstance.id, error));
}
};
}

export function switchMoveTaskModalVisible(visible: boolean, taskId: number | null = null): AnyAction {
const action = {
type: TasksActionTypes.SWITCH_MOVE_TASK_MODAL_VISIBLE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ import Collapse from 'antd/lib/collapse';
// eslint-disable-next-line import/no-extraneous-dependencies
import { MenuInfo } from 'rc-menu/lib/interface';
import CVATTooltip from 'components/common/cvat-tooltip';
import { getCore } from 'cvat-core-wrapper';
import { JobStage } from 'reducers';
import { getCore, JobStage } from 'cvat-core-wrapper';

const core = getCore();

Expand Down Expand Up @@ -213,7 +212,7 @@ function AnnotationMenuComponent(props: Props & RouteComponentProps): JSX.Elemen
<Text className={computeClassName(JobState.COMPLETED)}>{JobState.COMPLETED}</Text>
</Menu.Item>
</Menu.SubMenu>
{[JobStage.ANNOTATION, JobStage.REVIEW].includes(jobStage) ?
{[JobStage.ANNOTATION, JobStage.VALIDATION].includes(jobStage) ?
<Menu.Item key={Actions.FINISH_JOB}>Finish the job</Menu.Item> : null}
{jobStage === JobStage.ACCEPTANCE ?
<Menu.Item key={Actions.RENEW_JOB}>Renew the job</Menu.Item> : null}
Expand Down
16 changes: 4 additions & 12 deletions cvat-ui/src/components/job-item/job-actions-menu.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (C) 2023 CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT

import React, { useCallback } from 'react';
import { useDispatch } from 'react-redux';
import { useHistory } from 'react-router';
Expand All @@ -15,13 +16,12 @@ import {
} from 'cvat-core-wrapper';
import { deleteJobAsync } from 'actions/jobs-actions';
import { importActions } from 'actions/import-actions';
import { updateJobAsync } from 'actions/tasks-actions';

const core = getCore();

interface Props {
job: Job;
onJobUpdate?: (job: Job) => void;
onJobUpdate: (job: Job) => void;
}

function JobActionsMenu(props: Props): JSX.Element {
Expand Down Expand Up @@ -62,19 +62,11 @@ function JobActionsMenu(props: Props): JSX.Element {
} else if (action.key === 'renew_job') {
job.state = core.enums.JobState.NEW;
job.stage = JobStage.ANNOTATION;
if (onJobUpdate) {
onJobUpdate(job);
} else {
dispatch(updateJobAsync(job));
}
onJobUpdate(job);
} else if (action.key === 'finish_job') {
job.stage = JobStage.ACCEPTANCE;
job.state = core.enums.JobState.COMPLETED;
if (onJobUpdate) {
onJobUpdate(job);
} else {
dispatch(updateJobAsync(job));
}
onJobUpdate(job);
}
}}
>
Expand Down
4 changes: 2 additions & 2 deletions cvat-ui/src/components/job-item/job-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ import CVATTooltip from 'components/common/cvat-tooltip';
import JobActionsMenu from './job-actions-menu';

interface Props {
job: Job,
task: Task,
job: Job;
task: Task;
onJobUpdate: (job: Job) => void;
}

Expand Down
11 changes: 7 additions & 4 deletions cvat-ui/src/components/jobs-page/job-card.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (C) 2022 Intel Corporation
// Copyright (C) 2022 CVAT.ai Corporation
// Copyright (C) 2022-2023 CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT

Expand All @@ -9,6 +9,8 @@ import Card from 'antd/lib/card';
import Descriptions from 'antd/lib/descriptions';
import { MoreOutlined } from '@ant-design/icons';
import Dropdown from 'antd/lib/dropdown';

import { Job } from 'cvat-core-wrapper';
import { useCardHeightHOC } from 'utils/hooks';
import Preview from 'components/common/preview';
import JobActionsMenu from 'components/job-item/job-actions-menu';
Expand All @@ -22,11 +24,12 @@ const useCardHeight = useCardHeightHOC({
});

interface Props {
job: any;
job: Job;
onJobUpdate: (job: Job) => void;
}

function JobCardComponent(props: Props): JSX.Element {
const { job } = props;
const { job, onJobUpdate } = props;
const [expanded, setExpanded] = useState<boolean>(false);
const history = useHistory();
const height = useCardHeight();
Expand Down Expand Up @@ -73,7 +76,7 @@ function JobCardComponent(props: Props): JSX.Element {
<Descriptions.Item label='Assignee'>{job.assignee.username}</Descriptions.Item>
) : null}
</Descriptions>
<Dropdown overlay={<JobActionsMenu job={job} />}>
<Dropdown overlay={<JobActionsMenu onJobUpdate={onJobUpdate} job={job} />}>
<MoreOutlined className='cvat-job-card-more-button' />
</Dropdown>
</Card>
Expand Down
10 changes: 8 additions & 2 deletions cvat-ui/src/components/jobs-page/jobs-content.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright (C) 2022 Intel Corporation
// Copyright (C) 2023 CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT

Expand All @@ -9,7 +10,12 @@ import { CombinedState } from 'reducers';
import { Job, JobType } from 'cvat-core-wrapper';
import JobCard from './job-card';

function JobsContentComponent(): JSX.Element {
interface Props {
onJobUpdate(job: Job): void;
}

function JobsContentComponent(props: Props): JSX.Element {
const { onJobUpdate } = props;
const jobs = useSelector((state: CombinedState) => state.jobs.current);
const dimensions = {
md: 22,
Expand All @@ -22,7 +28,7 @@ function JobsContentComponent(): JSX.Element {
<Row justify='center' align='middle'>
<Col className='cvat-jobs-page-list' {...dimensions}>
{jobs.filter((job: Job) => job.type === JobType.ANNOTATION).map((job: Job): JSX.Element => (
<JobCard job={job} key={job.id} />
<JobCard onJobUpdate={onJobUpdate} job={job} key={job.id} />
))}
</Col>
</Row>
Expand Down
Loading

0 comments on commit 4c29752

Please sign in to comment.