未验证 提交 ca83d3c9 编写于 作者: M Maria Khrustaleva 提交者: GitHub

Fix attaching manifest file with custom name (#5377)

<!-- Raised an issue to propose your change
(https://github.com/cvat-ai/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](https://github.com/cvat-ai/cvat/blob/develop/CONTRIBUTING.md)
guide. -->

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

### Motivation and context
<!-- Why is this change required? What problem does it solve? If it
fixes an open
issue, please link to the issue here. Describe your changes in detail,
add
screenshots. -->
Closes #5361 
### 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. -->
Updated existing cypress test
### Checklist
<!-- Go over all the following points, and put an `x` in all the boxes
that apply.
If an item isn't applicable by a reason then ~~explicitly
strikethrough~~ the whole
line. If you don't do that github will show an incorrect process 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
[CHANGELOG](https://github.com/cvat-ai/cvat/blob/develop/CHANGELOG.md)
file
~~- [ ] I have updated the [documentation](
https://github.com/cvat-ai/cvat/blob/develop/README.md#documentation)
accordingly~~
- [x] I have added tests to cover my changes
- [x] I have linked related issues ([read 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/cvat-ai/cvat/tree/develop/cvat-canvas#versioning),

[cvat-core](https://github.com/cvat-ai/cvat/tree/develop/cvat-core#versioning),
[cvat-data](https://github.com/cvat-ai/cvat/tree/develop/cvat-data#versioning)
and
[cvat-ui](https://github.com/cvat-ai/cvat/tree/develop/cvat-ui#versioning))

### License

- [x] I submit _my code changes_ under the same [MIT License](
https://github.com/cvat-ai/cvat/blob/develop/LICENSE) that covers the
project.
  Feel free to contact the maintainers if that's a concern.
Co-authored-by: NNikita Manovich <nikita@cvat.ai>
上级 2c63b6c7
......@@ -82,6 +82,7 @@ non-ascii paths while adding files from "Connected file share" (issue #4428)
- Visibility and ignored information fail to be loaded (MOT dataset format) (<https://github.com/opencv/cvat/pull/5270>)
- Added force logout on CVAT app start if token is missing (<https://github.com/opencv/cvat/pull/5331>)
- Missed token with using social account authentication (<https://github.com/opencv/cvat/pull/5344>)
- Attaching manifest with custom name (<https://github.com/opencv/cvat/pull/5377>)
### Security
- TDB
......
{
"name": "cvat-ui",
"version": "1.44.2",
"version": "1.44.3",
"description": "CVAT single-page application",
"main": "src/index.tsx",
"scripts": {
......
......@@ -244,7 +244,7 @@ class CreateTaskContent extends React.PureComponent<Props & RouteComponentProps,
let uploadFileErrorMessage = '';
if (!many && uploadedFiles.length > 1) {
uploadFileErrorMessage = uploadedFiles.every((it) => (getFileContentType(it) === 'image' || it.name === 'manifest.jsonl')) ? '' : UploadFileErrorMessages.one;
uploadFileErrorMessage = uploadedFiles.every((it) => (getFileContentType(it) === 'image' || it.name.endsWith('.jsonl'))) ? '' : UploadFileErrorMessages.one;
} else if (many) {
uploadFileErrorMessage = uploadedFiles.every((it) => getFileContentType(it) === 'video') ? '' : UploadFileErrorMessages.multi;
}
......
{"version":"1.0"}
{"type":"images"}
{"name":"image_case_65_1","extension":".png","width":800,"height":800,"checksum":"82d6b0b6e0dfb3c63ac49880c3756b1a"}
{"name":"image_case_65_2","extension":".png","width":800,"height":800,"checksum":"20ab1351cfad5bbbca009ac4c6522ede"}
......@@ -11,7 +11,13 @@ context('Create an annotation task with manifest.', () => {
const attrName = `Attr for ${labelName}`;
const textDefaultValue = 'Some default value for type Text';
const pathToFiles = `${__dirname}/assets/case_65_manifest`;
let filesToAttach = [];
// Specify paths relative to the fixtures folder to the file names
// for the plugin "cypress-file-upload" to work correctly
const filesToAttach = [
`../../${pathToFiles}/demo_manifest.jsonl`,
`../../${pathToFiles}/image_case_65_1.png`,
`../../${pathToFiles}/image_case_65_2.png`,
];
before(() => {
cy.visit('auth/login');
......@@ -25,13 +31,7 @@ context('Create an annotation task with manifest.', () => {
describe(`Testing "${labelName}"`, () => {
it('Task created successfully.', () => {
cy.task('listFiles', pathToFiles).then(($files) => {
$files.forEach(($el) => {
// Add the path relative to the fixtures folder to the file names for the plugin "cypress-file-upload" to work correctly
filesToAttach.push(`../../${pathToFiles}/${$el}`);
});
cy.createAnnotationTask(taskName, labelName, attrName, textDefaultValue, filesToAttach);
});
cy.createAnnotationTask(taskName, labelName, attrName, textDefaultValue, filesToAttach);
cy.get('.cvat-notification-create-task-fail').should('not.exist');
});
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册