From c126d2afeb30f1a255261b1b8be5ebd01b4455a9 Mon Sep 17 00:00:00 2001 From: Dmitry Kruchinin <33020454+dvkruchinin@users.noreply.github.com> Date: Fri, 25 Dec 2020 15:31:21 +0300 Subject: [PATCH 1/7] =?UTF-8?q?Cypress=20test.=20Button=20=E2=80=9CContinu?= =?UTF-8?q?e=E2=80=9D=20in=20label=20editor.=20(#2570)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Kruchinin --- .../case_33_button_continue_label_editor.js | 34 +++++++++++++++++++ tests/cypress/support/commands.js | 26 ++++++++++++-- 2 files changed, 58 insertions(+), 2 deletions(-) create mode 100644 tests/cypress/integration/actions_tasks_objects/case_33_button_continue_label_editor.js diff --git a/tests/cypress/integration/actions_tasks_objects/case_33_button_continue_label_editor.js b/tests/cypress/integration/actions_tasks_objects/case_33_button_continue_label_editor.js new file mode 100644 index 000000000000..4c38376e4c5c --- /dev/null +++ b/tests/cypress/integration/actions_tasks_objects/case_33_button_continue_label_editor.js @@ -0,0 +1,34 @@ +// Copyright (C) 2020 Intel Corporation +// +// SPDX-License-Identifier: MIT + +/// + +import { taskName } from '../../support/const'; + +context('Button "Continue" in label editor.', () => { + const caseId = '33'; + const additionalLabels = [ + `First label for case ${caseId}`, + `Second label for case ${caseId}`, + `Third label for case ${caseId}`, + ]; + + before(() => { + cy.openTask(taskName); + }); + + describe(`Testing case "${caseId}"`, () => { + it('Adding multiple labels via the Continue button', () => { + cy.addNewLabelViaContinueButton(additionalLabels); + }); + + it('All labels cuccessfully added.', () => { + cy.collectLabelsName().then((labelNames) => { + expect(labelNames).to.include(additionalLabels[0]); + expect(labelNames).to.include(additionalLabels[1]); + expect(labelNames).to.include(additionalLabels[2]); + }); + }); + }); +}); diff --git a/tests/cypress/support/commands.js b/tests/cypress/support/commands.js index 231064657011..c067c1358d7d 100644 --- a/tests/cypress/support/commands.js +++ b/tests/cypress/support/commands.js @@ -438,7 +438,7 @@ Cypress.Commands.add('changeColorViaBadge', (labelColor) => { }); }); -Cypress.Commands.add('addNewLabel', (newLabelName, additionalAttrs, labelColor) => { +Cypress.Commands.add('collectLabelsName', () => { let listCvatConstructorViewerItemText = []; cy.get('.cvat-constructor-viewer').should('exist'); cy.document().then((doc) => { @@ -446,7 +446,13 @@ Cypress.Commands.add('addNewLabel', (newLabelName, additionalAttrs, labelColor) for (let i = 0; i < labels.length; i++) { listCvatConstructorViewerItemText.push(labels[i].textContent); } - if (listCvatConstructorViewerItemText.indexOf(newLabelName) === -1) { + return listCvatConstructorViewerItemText; + }); +}); + +Cypress.Commands.add('addNewLabel', (newLabelName, additionalAttrs, labelColor) => { + cy.collectLabelsName().then((labelsNames) => { + if (labelsNames.indexOf(newLabelName) === -1) { cy.contains('button', 'Add label').click(); cy.get('[placeholder="Label name"]').type(newLabelName); if (labelColor) { @@ -463,6 +469,22 @@ Cypress.Commands.add('addNewLabel', (newLabelName, additionalAttrs, labelColor) }); }); +Cypress.Commands.add('addNewLabelViaContinueButton', (additionalLabels) => { + cy.collectLabelsName().then((labelsNames) => { + if (additionalLabels.some((el) => labelsNames.indexOf(el) === -1)) { + cy.contains('button', 'Add label').click(); + for (let j = 0; j < additionalLabels.length; j++) { + cy.get('[placeholder="Label name"]').type(additionalLabels[j]); + if (j !== additionalLabels.length - 1) { + cy.contains('button', 'Continue').click(); + } else { + cy.contains('button', 'Done').click(); + } + } + } + }); +}); + Cypress.Commands.add('createTag', (labelName) => { cy.get('.cvat-setup-tag-control').click(); cy.switchLabel(labelName, 'tag'); From 2c74394f5120eb8b1b9056a9a72f2c56f17412c4 Mon Sep 17 00:00:00 2001 From: Snyk bot Date: Mon, 28 Dec 2020 09:18:50 +0200 Subject: [PATCH 2/7] fix: cvat-core/package.json & cvat-core/package-lock.json to reduce vulnerabilities (#2616) The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-JS-AXIOS-1038255 --- cvat-core/package-lock.json | 12 ++++++------ cvat-core/package.json | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cvat-core/package-lock.json b/cvat-core/package-lock.json index 49fd1e2ddd20..663df2da7fa4 100644 --- a/cvat-core/package-lock.json +++ b/cvat-core/package-lock.json @@ -3274,9 +3274,9 @@ "integrity": "sha512-3YDiu347mtVtjpyV3u5kVqQLP242c06zwDOgpeRnybmXlYYsLbtTrUBUm8i8srONt+FWobl5aibnU1030PeeuA==" }, "axios": { - "version": "0.21.0", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.0.tgz", - "integrity": "sha512-fmkJBknJKoZwem3/IKSSLpkdNXZeBu5Q7GA/aRsr2btgrptmSCxi2oFjZHqGdK9DoTil9PIHlPIZw2EcRJXRvw==", + "version": "0.21.1", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz", + "integrity": "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==", "requires": { "follow-redirects": "^1.10.0" } @@ -12973,9 +12973,9 @@ } }, "follow-redirects": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.0.tgz", - "integrity": "sha512-aq6gF1BEKje4a9i9+5jimNFIpq4Q1WiwBToeRK5NvZBd/TRsmW8BsJfOEGkr76TbOyPVD3OVDN910EcUNtRYEA==" + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.1.tgz", + "integrity": "sha512-SSG5xmZh1mkPGyKzjZP8zLjltIfpW32Y5QpdNJyjcfGxK3qo3NDDkZOZSFiGn1A6SclQxY9GzEwAHQ3dmYRWpg==" }, "for-in": { "version": "1.0.2", diff --git a/cvat-core/package.json b/cvat-core/package.json index eef263d21f46..3ab719d84001 100644 --- a/cvat-core/package.json +++ b/cvat-core/package.json @@ -33,7 +33,7 @@ "webpack-cli": "^3.3.2" }, "dependencies": { - "axios": "^0.21.0", + "axios": "^0.21.1", "browser-or-node": "^1.2.1", "cvat-data": "../cvat-data", "detect-browser": "^5.2.0", From 33b9f8bc55eaa5ad876b727c3c91dd00732cb8e2 Mon Sep 17 00:00:00 2001 From: Boris Sekachev Date: Mon, 28 Dec 2020 17:49:16 +0300 Subject: [PATCH 3/7] Fixed project removing (#2626) * Fixed project removing * Updated changelog --- CHANGELOG.md | 1 + cvat-ui/package-lock.json | 2 +- cvat-ui/package.json | 2 +- cvat-ui/src/components/project-page/top-bar.tsx | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d9a6c5f10cb7..aa5927b2eab2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Memory consumption for the task creation process () - Frame preloading () +- Project cannot be removed from the project page () ### Security diff --git a/cvat-ui/package-lock.json b/cvat-ui/package-lock.json index 028b0476e2d8..c0668d70b5b0 100644 --- a/cvat-ui/package-lock.json +++ b/cvat-ui/package-lock.json @@ -1,6 +1,6 @@ { "name": "cvat-ui", - "version": "1.13.2", + "version": "1.13.3", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/cvat-ui/package.json b/cvat-ui/package.json index 49420f74871a..450fbc4e3569 100644 --- a/cvat-ui/package.json +++ b/cvat-ui/package.json @@ -1,6 +1,6 @@ { "name": "cvat-ui", - "version": "1.13.2", + "version": "1.13.3", "description": "CVAT single-page application", "main": "src/index.tsx", "scripts": { diff --git a/cvat-ui/src/components/project-page/top-bar.tsx b/cvat-ui/src/components/project-page/top-bar.tsx index b90d7be32609..dde03ecb9288 100644 --- a/cvat-ui/src/components/project-page/top-bar.tsx +++ b/cvat-ui/src/components/project-page/top-bar.tsx @@ -32,7 +32,7 @@ export default function ProjectTopBar(props: DetailsComponentProps): JSX.Element - }> + }>