未验证 提交 e3616df0 编写于 作者: D Dmitry Kalinin 提交者: GitHub

Fixed creation task problem (#3454)

* Fixed existng labels issue

* Added CHANGELOG, increased package versions

* Fixed project search field

* Fixed cypress test
上级 056b7d8b
......@@ -54,6 +54,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
......
{
"name": "cvat-ui",
"version": "1.21.0",
"version": "1.21.1",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
{
"name": "cvat-ui",
"version": "1.21.0",
"version": "1.21.1",
"description": "CVAT single-page application",
"main": "src/index.tsx",
"scripts": {
......
......@@ -103,9 +103,10 @@ class CreateTaskContent extends React.PureComponent<Props & RouteComponentProps,
this.fileManagerContainer.reset();
this.setState({
this.setState((state) => ({
...defaultState,
});
projectId: state.projectId,
}));
}
}
......@@ -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 => {
......
......@@ -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);
};
......
......@@ -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();
......@@ -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.', () => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册