Skip to content
This repository has been archived by the owner on Nov 14, 2023. It is now read-only.

Commit

Permalink
Stricted moving a task from a project (cvat-ai#5901)
Browse files Browse the repository at this point in the history
<!-- Raise an issue to propose your change
(https://github.com/opencv/cvat/issues).
It helps to avoid duplication of efforts from multiple independent
contributors.
Discuss your ideas with maintainers to be sure that changes will be
approved and merged.
Read the [Contribution
guide](https://opencv.github.io/cvat/docs/contributing/). -->

<!-- Provide a general summary of your changes in the Title above -->

### Motivation and context
Related cvat-ai#5769 

### How has this been tested?
<!-- Please describe in detail how you tested your changes.
Include details of your testing environment, and the tests you ran to
see how your change affects other areas of the code, etc. -->

### Checklist
<!-- Go over all the following points, and put an `x` in all the boxes
that apply.
If an item isn't applicable for some reason, then ~~explicitly
strikethrough~~ the whole
line. If you don't do that, GitHub will show incorrect progress for the
pull request.
If you're unsure about any of these, don't hesitate to ask. We're here
to help! -->
- [x] I submit my changes into the `develop` branch
- [x] I have added a description of my changes into the
[CHANGELOG](https://github.com/opencv/cvat/blob/develop/CHANGELOG.md)
file
- [ ] I have updated the documentation accordingly
- [ ] I have added tests to cover my changes
- [ ] I have linked related issues (see [GitHub docs](

https://help.github.com/en/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword))
- [x] I have increased versions of npm packages if it is necessary

([cvat-canvas](https://github.com/opencv/cvat/tree/develop/cvat-canvas#versioning),

[cvat-core](https://github.com/opencv/cvat/tree/develop/cvat-core#versioning),

[cvat-data](https://github.com/opencv/cvat/tree/develop/cvat-data#versioning)
and

[cvat-ui](https://github.com/opencv/cvat/tree/develop/cvat-ui#versioning))

### License

- [x] I submit _my code changes_ under the same [MIT License](
https://github.com/opencv/cvat/blob/develop/LICENSE) that covers the
project.
  Feel free to contact the maintainers if that's a concern.
  • Loading branch information
bsekachev authored and mikhail-treskin committed Jul 1, 2023
1 parent 29c2a58 commit bba3d8e
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 9 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Add support for Azure Blob Storage connection string authentication(<https://github.com/openvinotoolkit/cvat/pull/4649>)

### Changed
- TDB
- Moving a task from a project to another project is disabled (<https://github.com/opencv/cvat/pull/5901>)

### Deprecated
- TDB
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.50.0",
"version": "1.50.1",
"description": "CVAT single-page application",
"main": "src/index.tsx",
"scripts": {
Expand Down
6 changes: 5 additions & 1 deletion cvat-ui/src/components/actions-menu/actions-menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { DimensionType } from 'cvat-core-wrapper';

interface Props {
taskID: number;
projectID: number | null;
taskMode: string;
bugTracker: string;
loaders: any[];
Expand All @@ -37,6 +38,7 @@ export enum Actions {
function ActionsMenuComponent(props: Props): JSX.Element {
const {
taskID,
projectID,
bugTracker,
inferenceIsActive,
backupIsActive,
Expand Down Expand Up @@ -86,7 +88,9 @@ function ActionsMenuComponent(props: Props): JSX.Element {
Backup Task
</Menu.Item>
<Menu.Divider />
<Menu.Item key={Actions.MOVE_TASK_TO_PROJECT}>Move to project</Menu.Item>
{ projectID === null && (
<Menu.Item key={Actions.MOVE_TASK_TO_PROJECT}>Move to project</Menu.Item>
)}
<Menu.Item key={Actions.DELETE_TASK}>Delete</Menu.Item>
</Menu>
);
Expand Down
1 change: 1 addition & 0 deletions cvat-ui/src/containers/actions-menu/actions-menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ function ActionsMenuContainer(props: OwnProps & StateToProps & DispatchToProps):
return (
<ActionsMenuComponent
taskID={taskInstance.id}
projectID={taskInstance.projectId}
taskMode={taskInstance.mode}
bugTracker={taskInstance.bugTracker}
loaders={loaders}
Expand Down
5 changes: 2 additions & 3 deletions site/content/en/docs/manual/basics/tasks-page.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@ Each button is responsible for a in menu `Actions` specific function:
Presence depends on how you build the CVAT instance.
- `Backup task` — make a backup of this task into a zip archive.
Read more in the [backup](/docs/manual/advanced/backup/) section.
- `Move to project` — Moving a task to a project (can be used to move a task from one project to another).
Note that attributes reset during the moving process. In case of label mismatch,
you can create or delete necessary labels in the project/task.
- `Move to project` — Moving a task to a project (you can move only a task which does not belong to any project).
In case of label mismatch, you can create or delete necessary labels in the project/task.
Some task labels can be matched with the target project labels.
- `Delete` — delete task.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,22 +104,33 @@ context('Move a task between projects.', () => {
});

describe(`Testing "Case ${caseID}"`, () => {
it('Move a task between projects from a project.', () => {
it('Check not able to move a task from one project to another.', () => {
checkTask(secondProject.name, 'not.exist');
checkTask(firtsProject.name, 'exist');
cy.contains('.cvat-item-open-task-actions', 'Actions').click();
cy.get('.cvat-actions-menu')
.should('be.visible')
.find('[role="menuitem"]')
.filter(':contains("Move to project")')
.should('not.exist');
});

it.skip('Move a task between projects from a project.', () => {
checkTask(secondProject.name, 'not.exist');
checkTask(firtsProject.name, 'exist');
cy.movingTask(taskName, secondProject.name, firtsProject.label, secondProject.label);
checkTask(firtsProject.name, 'not.exist');
checkTask(secondProject.name, 'exist');
});

it('Move a task between projects from task list.', () => {
it.skip('Move a task between projects from task list.', () => {
cy.goToTaskList();
cy.movingTask(taskName, secondProject.name, firtsProject.label, secondProject.label);
checkTask(firtsProject.name, 'not.exist');
checkTask(secondProject.name, 'exist');
});

it('Move a task between projects from a task.', () => {
it.skip('Move a task between projects from a task.', () => {
cy.goToTaskList();
cy.openTask(taskName);
cy.movingTask(taskName, secondProject.name, firtsProject.label, secondProject.label, true);
Expand Down

0 comments on commit bba3d8e

Please sign in to comment.