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

Fixed creation task problem #3454

Merged
merged 5 commits into from
Jul 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fixed issue when save filtered object in AAM (<https://github.com/openvinotoolkit/cvat/pull/3401>)
- Context image disappears after undo/redo (<https://github.com/openvinotoolkit/cvat/pull/3416>)
- Using combined data sources (directory and image) when create a task (<https://github.com/openvinotoolkit/cvat/pull/3424>)
- Creating task with labels in project (<https://github.com/openvinotoolkit/cvat/pull/3454>)

### Security

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.21.0",
"version": "1.21.1",
"description": "CVAT single-page application",
"main": "src/index.tsx",
"scripts": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,10 @@ class CreateTaskContent extends React.PureComponent<Props & RouteComponentProps,

this.fileManagerContainer.reset();

this.setState({
this.setState((state) => ({
...defaultState,
});
projectId: state.projectId,
}));
}
}

Expand All @@ -127,10 +128,11 @@ class CreateTaskContent extends React.PureComponent<Props & RouteComponentProps,
private handleProjectIdChange = (value: null | number): void => {
const { projectId, subset } = this.state;

this.setState({
this.setState((state) => ({
projectId: value,
subset: value && value === projectId ? subset : '',
});
labels: value ? [] : state.labels,
}));
};

private handleSubmitBasicConfiguration = (values: BaseConfiguration): void => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,11 @@ export default function ProjectSearchField(props: Props): JSX.Element {
const [projects, setProjects] = useState<Project[]>([]);

const handleSearch = (searchValue: string): void => {
if (searchValue) {
core.projects.searchNames(searchValue).then((result: Project[]) => {
if (result) {
setProjects(result);
}
});
} else {
setProjects([]);
}
core.projects.searchNames(searchValue).then((result: Project[]) => {
if (result) {
setProjects(result);
}
});
setSearchPhrase(searchValue);
onSelect(null);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,25 +24,11 @@ context('Create more than one task per time when create from project.', () => {
const imagesFolder = `cypress/fixtures/${imageFileName}`;
const directoryToArchive = imagesFolder;

function createTask(nameTaskToCreate, repeatCreation) {
let projectSearchField;
if (!repeatCreation) {
projectSearchField = projectName;
} else {
projectSearchField = '';
}
function createTask(nameTaskToCreate) {
cy.get('[id="name"]').clear().type(nameTaskToCreate);
cy.get('.cvat-project-search-field').within(() => {
cy.get('[type="search"]').should('have.value', projectSearchField);
cy.get('[type="search"]').should('have.value', projectName);
});
if (repeatCreation) {
cy.get('.cvat-project-search-field').click();
cy.get('.ant-select-dropdown')
.not('.ant-select-dropdown-hidden')
.within(() => {
cy.get(`.ant-select-item-option[title="${projectName}"]`).click();
});
}
cy.get('.cvat-constructor-viewer-new-item').should('not.exist');
cy.get('input[type="file"]').attachFile(archiveName, { subjectType: 'drag-n-drop' });
cy.contains('button', 'Submit').click();
Expand All @@ -59,8 +45,8 @@ context('Create more than one task per time when create from project.', () => {
describe(`Testing "Issue ${issueID}"`, () => {
it('Create more than one task per time from project.', () => {
cy.get('#cvat-create-task-button').click();
createTask(taskName.firstTask, false);
createTask(taskName.secondTask, true);
createTask(taskName.firstTask);
createTask(taskName.secondTask);
});

it('The tasks successfully created. Remove the project.', () => {
Expand Down