diff --git a/CHANGELOG.md b/CHANGELOG.md index 995f0e2e..ad5bde75 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Project page requests took a long time and did many DB queries () - Fixed Python 3.6 support () - Incorrect attribute import in tracks () +- Issue "is not a constructor" when create object, save, undo, save, redo save () - Fix CLI create an infinite loop if git repository responds with failure () ### Security diff --git a/cvat-core/package-lock.json b/cvat-core/package-lock.json index de12729b..16741ff6 100644 --- a/cvat-core/package-lock.json +++ b/cvat-core/package-lock.json @@ -1,6 +1,6 @@ { "name": "cvat-core", - "version": "3.13.1", + "version": "3.13.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/cvat-core/package.json b/cvat-core/package.json index 48284f16..b70014c2 100644 --- a/cvat-core/package.json +++ b/cvat-core/package.json @@ -1,6 +1,6 @@ { "name": "cvat-core", - "version": "3.13.1", + "version": "3.13.2", "description": "Part of Computer Vision Tool which presents an interface for client-side integration", "main": "babel.config.js", "scripts": { diff --git a/cvat-core/src/annotations-collection.js b/cvat-core/src/annotations-collection.js index bc3ec093..26486bbe 100644 --- a/cvat-core/src/annotations-collection.js +++ b/cvat-core/src/annotations-collection.js @@ -788,6 +788,7 @@ () => { importedArray.forEach((object) => { object.removed = false; + object.serverID = undefined; }); }, importedArray.map((object) => object.clientID), diff --git a/cvat-core/src/annotations-saver.js b/cvat-core/src/annotations-saver.js index 92c01500..3d5e69cc 100644 --- a/cvat-core/src/annotations-saver.js +++ b/cvat-core/src/annotations-saver.js @@ -1,11 +1,11 @@ -// Copyright (C) 2019-2020 Intel Corporation +// Copyright (C) 2019-2021 Intel Corporation // // SPDX-License-Identifier: MIT (() => { const serverProxy = require('./server-proxy'); const { Task } = require('./session'); - const { ScriptingError } = './exceptions'; + const { ScriptingError } = require('./exceptions'); class AnnotationsSaver { constructor(version, collection, session) { diff --git a/cvat-core/tests/api/annotations.js b/cvat-core/tests/api/annotations.js index 94bb5100..4377db5a 100644 --- a/cvat-core/tests/api/annotations.js +++ b/cvat-core/tests/api/annotations.js @@ -311,6 +311,27 @@ describe('Feature: check unsaved changes', () => { }); describe('Feature: save annotations', () => { + test('create, save, undo, save, redo save', async () => { + const task = (await window.cvat.tasks.get({ id: 101 }))[0]; + await task.annotations.get(0); + const state = new window.cvat.classes.ObjectState({ + frame: 0, + objectType: window.cvat.enums.ObjectType.SHAPE, + shapeType: window.cvat.enums.ObjectShape.POLYGON, + points: [0, 0, 100, 0, 100, 50], + occluded: true, + label: task.labels[0], + zOrder: 0, + }); + + await task.annotations.put([state]); + await task.annotations.save(); + await task.actions.undo(); + await task.annotations.save(); + await task.actions.redo(); + await task.annotations.save(); + }); + test('create & save annotations for a task', async () => { const task = (await window.cvat.tasks.get({ id: 101 }))[0]; let annotations = await task.annotations.get(0);