Skip to content

Commit

Permalink
Merge 2be0db3 into c6da90c
Browse files Browse the repository at this point in the history
  • Loading branch information
vnishukov committed Oct 15, 2020
2 parents c6da90c + 2be0db3 commit 95e410f
Show file tree
Hide file tree
Showing 33 changed files with 3,440 additions and 3,613 deletions.
27 changes: 27 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"arrowParens": "always",
"bracketSpacing": true,
"embeddedLanguageFormatting": "auto",
"htmlWhitespaceSensitivity": "css",
"insertPragma": false,
"jsxBracketSameLine": false,
"jsxSingleQuote": true,
"printWidth": 120,
"proseWrap": "preserve",
"quoteProps": "as-needed",
"requirePragma": false,
"semi": true,
"singleQuote": true,
"tabWidth": 4,
"trailingComma": "all",
"useTabs": false,
"vueIndentScriptAndStyle": false,
"overrides": [
{
"files": ["*.json", "*.yml", "*.yaml", "*.md"],
"options": {
"tabWidth": 2
}
}
]
}
28 changes: 14 additions & 14 deletions .remarkrc.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
exports.settings = {bullet: '*', paddedTable: false}
exports.settings = { bullet: '*', paddedTable: false };

exports.plugins = [
'remark-preset-lint-recommended',
'remark-preset-lint-consistent',
['remark-preset-lint-markdown-style-guide', 'mixed'],
['remark-lint-no-dead-urls', { skipOffline: true }],
['remark-lint-maximum-line-length', 120],
['remark-lint-maximum-heading-length', 120],
['remark-lint-strong-marker', "*"],
['remark-lint-emphasis-marker', "_"],
['remark-lint-unordered-list-marker-style', "-"],
['remark-lint-ordered-list-marker-style', "."],
['remark-lint-no-file-name-irregular-characters', false],
['remark-lint-list-item-spacing', false],
]
'remark-preset-lint-recommended',
'remark-preset-lint-consistent',
['remark-preset-lint-markdown-style-guide', 'mixed'],
['remark-lint-no-dead-urls', { skipOffline: true }],
['remark-lint-maximum-line-length', 120],
['remark-lint-maximum-heading-length', 120],
['remark-lint-strong-marker', '*'],
['remark-lint-emphasis-marker', '_'],
['remark-lint-unordered-list-marker-style', '-'],
['remark-lint-ordered-list-marker-style', '.'],
['remark-lint-no-file-name-irregular-characters', false],
['remark-lint-list-item-spacing', false],
];
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [1.2.0] - Unreleased

### Added
- Removed Z-Order flag from task creation process
- Ability to login into CVAT-UI with token from api/v1/auth/login (<https://github.com/openvinotoolkit/cvat/pull/2234>)
- Added eslint-prettier integration & code autoformat in precommiting hook
- Added layout grids toggling ('ctrl + alt + Enter')
Expand Down
2 changes: 1 addition & 1 deletion cvat-core/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cvat-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cvat-core",
"version": "3.8.0",
"version": "3.8.1",
"description": "Part of Computer Vision Tool which presents an interface for client-side integration",
"main": "babel.config.js",
"scripts": {
Expand Down
22 changes: 0 additions & 22 deletions cvat-core/src/session.js
Original file line number Diff line number Diff line change
Expand Up @@ -824,7 +824,6 @@
* <br> <li style="margin-left: 10px;"> name
* <br> <li style="margin-left: 10px;"> assignee
* <br> <li style="margin-left: 10px;"> bug_tracker
* <br> <li style="margin-left: 10px;"> z_order
* <br> <li style="margin-left: 10px;"> labels
* <br> <li style="margin-left: 10px;"> segment_size
* <br> <li style="margin-left: 10px;"> overlap
Expand All @@ -844,7 +843,6 @@
bug_tracker: undefined,
overlap: undefined,
segment_size: undefined,
z_order: undefined,
image_quality: undefined,
start_frame: undefined,
stop_frame: undefined,
Expand Down Expand Up @@ -1055,24 +1053,6 @@
data.segment_size = segment;
},
},
/**
* @name zOrder
* @type {boolean}
* @memberof module:API.cvat.classes.Task
* @instance
* @throws {module:API.cvat.exceptions.ArgumentError}
*/
zOrder: {
get: () => data.z_order,
set: (zOrder) => {
if (typeof (zOrder) !== 'boolean') {
throw new ArgumentError(
'Value must be a boolean',
);
}
data.z_order = zOrder;
},
},
/**
* @name imageQuality
* @type {integer}
Expand Down Expand Up @@ -1700,7 +1680,6 @@
assignee: this.assignee ? this.assignee.id : null,
name: this.name,
bug_tracker: this.bugTracker,
z_order: this.zOrder,
labels: [...this.labels.map((el) => el.toJSON())],
};

Expand All @@ -1711,7 +1690,6 @@
const taskSpec = {
name: this.name,
labels: this.labels.map((el) => el.toJSON()),
z_order: Boolean(this.zOrder),
};

if (typeof (this.bugTracker) !== 'undefined') {
Expand Down
68 changes: 37 additions & 31 deletions cvat-core/tests/api/tasks.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Copyright (C) 2018 Intel Corporation
* SPDX-License-Identifier: MIT
*/
*/

/* global
require:false
Expand All @@ -20,7 +20,6 @@ window.cvat = require('../../src/api');

const { Task } = require('../../src/session');


// Test cases
describe('Feature: get a list of tasks', () => {
test('get all tasks', async () => {
Expand Down Expand Up @@ -51,9 +50,11 @@ describe('Feature: get a list of tasks', () => {
});

test('get a task by an invalid id', async () => {
expect(window.cvat.tasks.get({
id: '50',
})).rejects.toThrow(window.cvat.exceptions.ArgumentError);
expect(
window.cvat.tasks.get({
id: '50',
}),
).rejects.toThrow(window.cvat.exceptions.ArgumentError);
});

test('get tasks by filters', async () => {
Expand All @@ -69,9 +70,11 @@ describe('Feature: get a list of tasks', () => {
});

test('get tasks by invalid filters', async () => {
expect(window.cvat.tasks.get({
unknown: '5',
})).rejects.toThrow(window.cvat.exceptions.ArgumentError);
expect(
window.cvat.tasks.get({
unknown: '5',
}),
).rejects.toThrow(window.cvat.exceptions.ArgumentError);
});

test('get task by name, status and mode', async () => {
Expand All @@ -98,7 +101,6 @@ describe('Feature: save a task', () => {
});

result[0].bugTracker = 'newBugTracker';
result[0].zOrder = true;
result[0].name = 'New Task Name';

result[0].save();
Expand All @@ -108,7 +110,6 @@ describe('Feature: save a task', () => {
});

expect(result[0].bugTracker).toBe('newBugTracker');
expect(result[0].zOrder).toBe(true);
expect(result[0].name).toBe('New Task Name');
});

Expand All @@ -119,14 +120,16 @@ describe('Feature: save a task', () => {

const labelsLength = result[0].labels.length;
const newLabel = new window.cvat.classes.Label({
name: 'My boss\'s car',
attributes: [{
default_value: 'false',
input_type: 'checkbox',
mutable: true,
name: 'parked',
values: ['false'],
}],
name: "My boss's car",
attributes: [
{
default_value: 'false',
input_type: 'checkbox',
mutable: true,
name: 'parked',
values: ['false'],
},
],
});

result[0].labels = [...result[0].labels, newLabel];
Expand All @@ -137,7 +140,7 @@ describe('Feature: save a task', () => {
});

expect(result[0].labels).toHaveLength(labelsLength + 1);
const appendedLabel = result[0].labels.filter((el) => el.name === 'My boss\'s car');
const appendedLabel = result[0].labels.filter((el) => el.name === "My boss's car");
expect(appendedLabel).toHaveLength(1);
expect(appendedLabel[0].attributes).toHaveLength(1);
expect(appendedLabel[0].attributes[0].name).toBe('parked');
Expand All @@ -149,23 +152,26 @@ describe('Feature: save a task', () => {
test('save new task without an id', async () => {
const task = new window.cvat.classes.Task({
name: 'New Task',
labels: [{
name: 'My boss\'s car',
attributes: [{
default_value: 'false',
input_type: 'checkbox',
mutable: true,
name: 'parked',
values: ['false'],
}],
}],
labels: [
{
name: "My boss's car",
attributes: [
{
default_value: 'false',
input_type: 'checkbox',
mutable: true,
name: 'parked',
values: ['false'],
},
],
},
],
bug_tracker: 'bug tracker value',
image_quality: 50,
z_order: true,
});

const result = await task.save();
expect(typeof (result.id)).toBe('number');
expect(typeof result.id).toBe('number');
});
});

Expand Down

0 comments on commit 95e410f

Please sign in to comment.