未验证 提交 284be86f 编写于 作者: B Boris Sekachev 提交者: GitHub

Fixed issue: is not a constructor when create object, save, undo, save, redo save (#3292)

* Fixed issue #3216

* Updated version & changelog

* Added unit test
Co-authored-by: NNikita Manovich <nikita.manovich@intel.com>
上级 59e47a36
......@@ -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 (<https://github.com/openvinotoolkit/cvat/pull/3223>)
- Fixed Python 3.6 support (<https://github.com/openvinotoolkit/cvat/pull/3258>)
- Incorrect attribute import in tracks (<https://github.com/openvinotoolkit/cvat/pull/3229>)
- Issue "is not a constructor" when create object, save, undo, save, redo save (<https://github.com/openvinotoolkit/cvat/pull/3292>)
- Fix CLI create an infinite loop if git repository responds with failure (<https://github.com/openvinotoolkit/cvat/pull/3267>)
### Security
......
{
"name": "cvat-core",
"version": "3.13.1",
"version": "3.13.2",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
......
{
"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": {
......
......@@ -788,6 +788,7 @@
() => {
importedArray.forEach((object) => {
object.removed = false;
object.serverID = undefined;
});
},
importedArray.map((object) => object.clientID),
......
// 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) {
......
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册