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

Fix attaching manifest file with custom name #5377

Merged
merged 7 commits into from
Nov 30, 2022
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 @@ -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
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.44.2",
"version": "1.44.3",
"description": "CVAT single-page application",
"main": "src/index.tsx",
"scripts": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{"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"}
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -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');
});

Expand Down