diff --git a/CHANGELOG.md b/CHANGELOG.md index 183136d71c9..b5e8e7b7764 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,6 +38,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Points missing when exporting tracked skeleton () - Escaping in the `filter` parameter in generated URLs () +- Rotation property lost during saving a mutable attribute () - Incorrect calculation of working time in analytics () ### Security diff --git a/cvat-core/src/annotations-objects.ts b/cvat-core/src/annotations-objects.ts index e41073cec19..38df9bd9360 100644 --- a/cvat-core/src/annotations-objects.ts +++ b/cvat-core/src/annotations-objects.ts @@ -1102,7 +1102,7 @@ export class Track extends Drawn { this.shapes[frame].attributes[attrID] !== attributes[attrID]; } } - let redoShape; + let redoShape: TrackedShape | undefined; if (mutableAttributesUpdated) { if (wasKeyframe) { redoShape = { @@ -1112,14 +1112,7 @@ export class Track extends Drawn { }, }; } else { - redoShape = { - frame, - zOrder: current.zOrder, - points: current.points, - outside: current.outside, - occluded: current.occluded, - attributes: {}, - }; + redoShape = copyShape(current); } } diff --git a/cvat-ui/package.json b/cvat-ui/package.json index 8a87738e029..36d40a6b3c3 100644 --- a/cvat-ui/package.json +++ b/cvat-ui/package.json @@ -1,6 +1,6 @@ { "name": "cvat-ui", - "version": "1.50.6", + "version": "1.50.7", "description": "CVAT single-page application", "main": "src/index.tsx", "scripts": { diff --git a/tests/cypress/e2e/actions_tasks/case_70_mutable_attribute.js b/tests/cypress/e2e/actions_tasks/mutable_attributes.js similarity index 65% rename from tests/cypress/e2e/actions_tasks/case_70_mutable_attribute.js rename to tests/cypress/e2e/actions_tasks/mutable_attributes.js index a03cbf52af2..27b40aa92b7 100644 --- a/tests/cypress/e2e/actions_tasks/case_70_mutable_attribute.js +++ b/tests/cypress/e2e/actions_tasks/mutable_attributes.js @@ -1,4 +1,5 @@ // Copyright (C) 2021-2022 Intel Corporation +// Copyright (C) 2023 CVAT.ai Corporation // // SPDX-License-Identifier: MIT @@ -7,8 +8,7 @@ import { taskName } from '../../support/const'; context('Mutable attribute.', () => { - const caseId = '70'; - const labelTrack = `Case ${caseId}`; + const labelName = 'car'; const additionalAttrsLabelShape = [ { additionalAttrName: 'tree', additionalValue: 'birch tree', typeAttribute: 'Text', mutable: true, @@ -18,7 +18,7 @@ context('Mutable attribute.', () => { const createRectangleTrack2Points = { points: 'By 2 Points', type: 'Track', - labelName: labelTrack, + labelName, firstX: 260, firstY: 200, secondX: 360, @@ -45,15 +45,15 @@ context('Mutable attribute.', () => { before(() => { cy.openTask(taskName); - cy.addNewLabel(labelTrack, additionalAttrsLabelShape); + cy.addNewLabel(labelName, additionalAttrsLabelShape); cy.openJob(); cy.createRectangle(createRectangleTrack2Points); }); - describe(`Testing case "${caseId}"`, () => { + describe('Check different use-cases with mutable attributes', () => { it('Go to AAM. For the 2nd and 3rd frames, change the attribute value.', () => { cy.changeWorkspace('Attribute annotation'); - cy.changeLabelAAM(labelTrack); + cy.changeLabelAAM(labelName); testChangingAttributeValue(additionalAttrsLabelShape[0].additionalValue, attrValueSecondFrame); testChangingAttributeValue(attrValueSecondFrame, attrValueThirdFrame); }); @@ -76,5 +76,32 @@ context('Mutable attribute.', () => { checkObjectDetailValue(num, val); }); }); + + it('Test attribute can be changed between two keyframes and can be selected after', () => { + cy.goCheckFrameNumber(0); + cy.removeAnnotations(); + cy.createRectangle(createRectangleTrack2Points); + cy.goCheckFrameNumber(2); + + cy.get('#cvat-objects-sidebar-state-item-1') + .within(() => { + cy.get('.cvat-object-item-button-keyframe').click(); + cy.get('span').contains('DETAILS').click(); + }); + + cy.goCheckFrameNumber(1); + + cy.get('#cvat-objects-sidebar-state-item-1') + .within(() => { + cy.get('.cvat-object-item-text-attribute').should('exist').and('be.visible').clear(); + cy.get('.cvat-object-item-text-attribute').type('new attribute value'); + }); + + cy.get('body').click(); // deactivate + cy.get('#cvat_canvas_shape_1') + .trigger('mousemove') + .trigger('mouseover') + .should('have.class', 'cvat_canvas_shape_activated'); + }); }); });