From ba44b5e587e0fffdf3b76abeadaa647958222dda Mon Sep 17 00:00:00 2001 From: Maya Date: Wed, 30 Nov 2022 10:10:32 +0100 Subject: [PATCH 1/5] Fix attaching manifest with custom name --- cvat-ui/src/components/create-task-page/create-task-content.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cvat-ui/src/components/create-task-page/create-task-content.tsx b/cvat-ui/src/components/create-task-page/create-task-content.tsx index 286820a29638..33bd6264e45e 100644 --- a/cvat-ui/src/components/create-task-page/create-task-content.tsx +++ b/cvat-ui/src/components/create-task-page/create-task-content.tsx @@ -244,7 +244,7 @@ class CreateTaskContent extends React.PureComponent 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; } From 0858136c68458675f689dbb403fd55c0abef9195 Mon Sep 17 00:00:00 2001 From: Maya Date: Wed, 30 Nov 2022 10:11:05 +0100 Subject: [PATCH 2/5] Update test asset --- .../case_65_manifest/{manifest.jsonl => demo_manifest.jsonl} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename tests/cypress/integration/actions_tasks/assets/case_65_manifest/{manifest.jsonl => demo_manifest.jsonl} (100%) diff --git a/tests/cypress/integration/actions_tasks/assets/case_65_manifest/manifest.jsonl b/tests/cypress/integration/actions_tasks/assets/case_65_manifest/demo_manifest.jsonl similarity index 100% rename from tests/cypress/integration/actions_tasks/assets/case_65_manifest/manifest.jsonl rename to tests/cypress/integration/actions_tasks/assets/case_65_manifest/demo_manifest.jsonl From 977eaba7a2e2e104ec8b81eb75e114f3d8baed3f Mon Sep 17 00:00:00 2001 From: Maya Date: Wed, 30 Nov 2022 10:12:09 +0100 Subject: [PATCH 3/5] v1.44.3 --- cvat-ui/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cvat-ui/package.json b/cvat-ui/package.json index e87f985c9528..3220aa1c25de 100644 --- a/cvat-ui/package.json +++ b/cvat-ui/package.json @@ -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": { From a70ff51f0822f60792775df7cd172237312bd81b Mon Sep 17 00:00:00 2001 From: Maya Date: Wed, 30 Nov 2022 10:17:06 +0100 Subject: [PATCH 4/5] [skip ci] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 54de3684ba6d..0f82e2795129 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) () - Added force logout on CVAT app start if token is missing () - Missed token with using social account authentication () +- Attaching manifest with custom name () ### Security - TDB From 3e289003ce8618b19661130af30b3829da00fff0 Mon Sep 17 00:00:00 2001 From: Maya Date: Wed, 30 Nov 2022 11:26:19 +0100 Subject: [PATCH 5/5] Add required asset && update test --- .../assets/case_65_manifest/manifest.jsonl | 4 ++++ .../case_65_create_task_with_manifest.js | 16 ++++++++-------- 2 files changed, 12 insertions(+), 8 deletions(-) create mode 100644 tests/cypress/integration/actions_tasks/assets/case_65_manifest/manifest.jsonl diff --git a/tests/cypress/integration/actions_tasks/assets/case_65_manifest/manifest.jsonl b/tests/cypress/integration/actions_tasks/assets/case_65_manifest/manifest.jsonl new file mode 100644 index 000000000000..08a7c1d6098a --- /dev/null +++ b/tests/cypress/integration/actions_tasks/assets/case_65_manifest/manifest.jsonl @@ -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"} diff --git a/tests/cypress/integration/actions_tasks/case_65_create_task_with_manifest.js b/tests/cypress/integration/actions_tasks/case_65_create_task_with_manifest.js index f3eb18f68362..a9c1168422f9 100644 --- a/tests/cypress/integration/actions_tasks/case_65_create_task_with_manifest.js +++ b/tests/cypress/integration/actions_tasks/case_65_create_task_with_manifest.js @@ -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'); });