Merge branch 'develop' into do/cypress_test_pr_2203_error_сannot_read_property_at_saving_job

main
Dmitriy Oparin 5 years ago
commit 2587d8e53d

@ -13,7 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
-
- PATCH requests from cvat-core submit only changed fields (<https://github.com/openvinotoolkit/cvat/pull/2445>)
### Deprecated

File diff suppressed because it is too large Load Diff

@ -1,6 +1,6 @@
{
"name": "cvat-core",
"version": "3.9.0",
"version": "3.9.1",
"description": "Part of Computer Vision Tool which presents an interface for client-side integration",
"main": "babel.config.js",
"scripts": {
@ -39,7 +39,7 @@
"detect-browser": "^5.2.0",
"error-stack-parser": "^2.0.2",
"form-data": "^2.5.0",
"jest-config": "^24.8.0",
"jest-config": "^26.6.1",
"js-cookie": "^2.2.0",
"jsonpath": "^1.0.2",
"platform": "^1.3.5",

@ -674,6 +674,11 @@
task: undefined,
};
let updatedFields = {
assignee: false,
status: false,
};
for (const property in data) {
if (Object.prototype.hasOwnProperty.call(data, property)) {
if (property in initialData) {
@ -715,6 +720,7 @@
if (assignee !== null && !(assignee instanceof User)) {
throw new ArgumentError('Value must be a user instance');
}
updatedFields.assignee = true;
data.assignee = assignee;
},
},
@ -743,6 +749,7 @@
);
}
updatedFields.status = true;
data.status = status;
},
},
@ -776,6 +783,12 @@
task: {
get: () => data.task,
},
__updatedFields: {
get: () => updatedFields,
set: (fields) => {
updatedFields = fields;
},
},
}),
);
@ -879,6 +892,13 @@
use_cache: undefined,
};
let updatedFields = {
name: false,
assignee: false,
bug_tracker: false,
labels: false,
};
for (const property in data) {
if (Object.prototype.hasOwnProperty.call(data, property) && property in initialData) {
data[property] = initialData[property];
@ -948,6 +968,7 @@
if (!value.trim().length) {
throw new ArgumentError('Value must not be empty');
}
updatedFields.name = true;
data.name = value;
},
},
@ -1006,6 +1027,7 @@
if (assignee !== null && !(assignee instanceof User)) {
throw new ArgumentError('Value must be a user instance');
}
updatedFields.assignee = true;
data.assignee = assignee;
},
},
@ -1039,6 +1061,7 @@
bugTracker: {
get: () => data.bug_tracker,
set: (tracker) => {
updatedFields.bug_tracker = true;
data.bug_tracker = tracker;
},
},
@ -1145,6 +1168,7 @@
}
}
updatedFields.labels = true;
data.labels = [...labels];
},
},
@ -1311,6 +1335,12 @@
dataChunkType: {
get: () => data.data_compressed_chunk_type,
},
__updatedFields: {
get: () => updatedFields,
set: (fields) => {
updatedFields = fields;
},
},
}),
);
@ -1443,12 +1473,30 @@
Job.prototype.save.implementation = async function () {
// TODO: Add ability to change an assignee
if (this.id) {
const jobData = {
status: this.status,
assignee_id: this.assignee ? this.assignee.id : null,
};
const jobData = {};
for (const [field, isUpdated] of Object.entries(this.__updatedFields)) {
if (isUpdated) {
switch (field) {
case 'status':
jobData.status = this.status;
break;
case 'assignee':
jobData.assignee_id = this.assignee ? this.assignee.id : null;
break;
default:
break;
}
}
}
await serverProxy.jobs.saveJob(this.id, jobData);
this.__updatedFields = {
status: false,
assignee: false,
};
return this;
}
@ -1653,14 +1701,38 @@
// TODO: Add ability to change an owner and an assignee
if (typeof this.id !== 'undefined') {
// If the task has been already created, we update it
const taskData = {
assignee_id: this.assignee ? this.assignee.id : null,
name: this.name,
bug_tracker: this.bugTracker,
labels: [...this.labels.map((el) => el.toJSON())],
};
const taskData = {};
for (const [field, isUpdated] of Object.entries(this.__updatedFields)) {
if (isUpdated) {
switch (field) {
case 'assignee':
taskData.assignee_id = this.assignee ? this.assignee.id : null;
break;
case 'name':
taskData.name = this.name;
break;
case 'bug_tracker':
taskData.bug_tracker = this.bugTracker;
break;
case 'labels':
taskData.labels = [...this.labels.map((el) => el.toJSON())];
break;
default:
break;
}
}
}
await serverProxy.tasks.saveTask(this.id, taskData);
this.updatedFields = {
assignee: false,
name: false,
bugTracker: false,
labels: false,
};
return this;
}

@ -1,6 +1,6 @@
{
"name": "cvat-ui",
"version": "1.10.6",
"version": "1.10.7",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@ -1213,9 +1213,9 @@
"dev": true
},
"@types/react": {
"version": "16.9.54",
"resolved": "https://registry.npmjs.org/@types/react/-/react-16.9.54.tgz",
"integrity": "sha512-GhawhYraQZpGFO2hVMArjPrYbnA/6+DS8SubK8IPhhVClmKqANihsRenOm5E0mvqK0m/BKoqVktA1O1+Xvlz9w==",
"version": "16.9.55",
"resolved": "https://registry.npmjs.org/@types/react/-/react-16.9.55.tgz",
"integrity": "sha512-6KLe6lkILeRwyyy7yG9rULKJ0sXplUsl98MGoCfpteXf9sPWFWWMknDcsvubcpaTdBuxtsLF6HDUwdApZL/xIg==",
"requires": {
"@types/prop-types": "*",
"csstype": "^3.0.2"
@ -25957,6 +25957,11 @@
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz",
"integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA=="
},
"lodash-es": {
"version": "4.17.15",
"resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.15.tgz",
"integrity": "sha512-rlrc3yU3+JNOpZ9zj5pQtxnx2THmvRykwL4Xlxoa8I9lHBlVbbyPhgyPMioxVZ4NqyxaVVtaJnzsyOidQIhyyQ=="
},
"lodash._reinterpolate": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz",
@ -28864,12 +28869,13 @@
}
},
"react-color": {
"version": "2.18.1",
"resolved": "https://registry.npmjs.org/react-color/-/react-color-2.18.1.tgz",
"integrity": "sha512-X5XpyJS6ncplZs74ak0JJoqPi+33Nzpv5RYWWxn17bslih+X7OlgmfpmGC1fNvdkK7/SGWYf1JJdn7D2n5gSuQ==",
"version": "2.19.3",
"resolved": "https://registry.npmjs.org/react-color/-/react-color-2.19.3.tgz",
"integrity": "sha512-LEeGE/ZzNLIsFWa1TMe8y5VYqr7bibneWmvJwm1pCn/eNmrabWDh659JSPn9BuaMpEfU83WTOJfnCcjDZwNQTA==",
"requires": {
"@icons/material": "^0.2.4",
"lodash": "^4.17.11",
"lodash": "^4.17.15",
"lodash-es": "^4.17.15",
"material-colors": "^1.2.1",
"prop-types": "^15.5.10",
"reactcss": "^1.2.0",

@ -1,6 +1,6 @@
{
"name": "cvat-ui",
"version": "1.10.6",
"version": "1.10.7",
"description": "CVAT single-page application",
"main": "src/index.tsx",
"scripts": {
@ -49,7 +49,7 @@
"dependencies": {
"@types/lodash": "^4.14.165",
"@types/platform": "^1.3.3",
"@types/react": "^16.9.54",
"@types/react": "^16.9.55",
"@types/react-color": "^3.0.4",
"@types/react-dom": "^16.9.9",
"@types/react-redux": "^7.1.2",
@ -68,7 +68,7 @@
"platform": "^1.3.6",
"prop-types": "^15.7.2",
"react": "^16.14.0",
"react-color": "^2.18.1",
"react-color": "^2.19.3",
"react-cookie": "^4.0.3",
"react-dom": "^16.14.0",
"react-hotkeys": "^2.0.0",

@ -124,7 +124,7 @@ class LabelForm extends React.PureComponent<Props, {}> {
message: patterns.validateAttributeName.message,
},
],
})(<Input disabled={locked} placeholder='Name' />)}
})(<Input className='cvat-attribute-name-input' disabled={locked} placeholder='Name' />)}
</Form.Item>
</Col>
);
@ -142,7 +142,7 @@ class LabelForm extends React.PureComponent<Props, {}> {
{form.getFieldDecorator(`type[${key}]`, {
initialValue: type,
})(
<Select disabled={locked}>
<Select className='cvat-attribute-type-input' disabled={locked}>
<Select.Option value={AttributeType.SELECT}>Select</Select.Option>
<Select.Option value={AttributeType.RADIO}>Radio</Select.Option>
<Select.Option value={AttributeType.CHECKBOX}>Checkbox</Select.Option>
@ -191,7 +191,14 @@ class LabelForm extends React.PureComponent<Props, {}> {
validator,
},
],
})(<Select mode='tags' dropdownMenuStyle={{ display: 'none' }} placeholder='Attribute values' />)}
})(
<Select
className='cvat-attribute-values-input'
mode='tags'
dropdownMenuStyle={{ display: 'none' }}
placeholder='Attribute values'
/>,
)}
</Form.Item>
</Tooltip>
);
@ -207,7 +214,7 @@ class LabelForm extends React.PureComponent<Props, {}> {
{form.getFieldDecorator(`values[${key}]`, {
initialValue: value,
})(
<Select>
<Select className='cvat-attribute-values-input'>
<Select.Option value='false'> False </Select.Option>
<Select.Option value='true'> True </Select.Option>
</Select>,
@ -264,7 +271,7 @@ class LabelForm extends React.PureComponent<Props, {}> {
validator,
},
],
})(<Input disabled={locked} placeholder='min;max;step' />)}
})(<Input className='cvat-attribute-values-input' disabled={locked} placeholder='min;max;step' />)}
</Form.Item>
);
}
@ -277,7 +284,7 @@ class LabelForm extends React.PureComponent<Props, {}> {
<Form.Item>
{form.getFieldDecorator(`values[${key}]`, {
initialValue: value,
})(<Input placeholder='Default value' />)}
})(<Input className='cvat-attribute-values-input' placeholder='Default value' />)}
</Form.Item>
);
}
@ -293,7 +300,13 @@ class LabelForm extends React.PureComponent<Props, {}> {
{form.getFieldDecorator(`mutable[${key}]`, {
initialValue: value,
valuePropName: 'checked',
})(<Checkbox disabled={locked}> Mutable </Checkbox>)}
})(
<Checkbox className='cvat-attribute-mutable-checkbox' disabled={locked}>
{' '}
Mutable
{' '}
</Checkbox>,
)}
</Tooltip>
</Form.Item>
);
@ -326,7 +339,13 @@ class LabelForm extends React.PureComponent<Props, {}> {
return (
<Form.Item key={key}>
<Row type='flex' justify='space-between' align='middle'>
<Row
type='flex'
justify='space-between'
align='middle'
cvat-attribute-id={key}
className='cvat-attribute-inputs-wrapper'
>
{this.renderAttributeNameInput(key, attr)}
{this.renderAttributeTypeInput(key, attr)}
<Col span={6}>

@ -4,7 +4,7 @@
/// <reference types="cypress" />
import { taskName } from '../../support/const';
import { taskName, labelName } from '../../support/const';
context('Actions on polygon', () => {
const caseId = '10';
@ -12,7 +12,7 @@ context('Actions on polygon', () => {
const createPolygonShape = {
reDraw: false,
type: 'Shape',
switchLabel: false,
labelName: labelName,
pointsMap: [
{ x: 200, y: 200 },
{ x: 250, y: 200 },
@ -24,7 +24,7 @@ context('Actions on polygon', () => {
const createPolygonTrack = {
reDraw: false,
type: 'Track',
switchLabel: false,
labelName: labelName,
pointsMap: [
{ x: 300, y: 200 },
{ x: 350, y: 200 },
@ -36,7 +36,7 @@ context('Actions on polygon', () => {
const createPolygonShapePoints = {
reDraw: false,
type: 'Shape',
switchLabel: false,
labelName: labelName,
pointsMap: [
{ x: 400, y: 200 },
{ x: 450, y: 200 },
@ -49,7 +49,7 @@ context('Actions on polygon', () => {
const createPolygonTrackPoints = {
reDraw: false,
type: 'Track',
switchLabel: false,
labelName: labelName,
pointsMap: [
{ x: 500, y: 200 },
{ x: 550, y: 200 },
@ -62,7 +62,6 @@ context('Actions on polygon', () => {
const createPolygonShapeSwitchLabel = {
reDraw: false,
type: 'Shape',
switchLabel: true,
labelName: newLabelName,
pointsMap: [
{ x: 600, y: 200 },
@ -75,7 +74,6 @@ context('Actions on polygon', () => {
const createPolygonTrackSwitchLabel = {
reDraw: false,
type: 'Track',
switchLabel: true,
labelName: newLabelName,
pointsMap: [
{ x: 700, y: 200 },

@ -4,14 +4,14 @@
/// <reference types="cypress" />
import { taskName } from '../../support/const';
import { taskName, labelName } from '../../support/const';
context('Actions on polylines', () => {
const caseId = '11';
const newLabelName = `New label for case ${caseId}`;
const createPolylinesShape = {
type: 'Shape',
switchLabel: false,
labelName: labelName,
pointsMap: [
{ x: 200, y: 200 },
{ x: 250, y: 200 },
@ -22,7 +22,7 @@ context('Actions on polylines', () => {
};
const createPolylinesTrack = {
type: 'Track',
switchLabel: false,
labelName: labelName,
pointsMap: [
{ x: 300, y: 200 },
{ x: 350, y: 200 },
@ -33,7 +33,7 @@ context('Actions on polylines', () => {
};
const createPolylinesShapePoints = {
type: 'Shape',
switchLabel: false,
labelName: labelName,
pointsMap: [
{ x: 400, y: 200 },
{ x: 450, y: 200 },
@ -45,7 +45,7 @@ context('Actions on polylines', () => {
};
const createPolylinesTrackPoints = {
type: 'Track',
switchLabel: false,
labelName: labelName,
pointsMap: [
{ x: 500, y: 200 },
{ x: 550, y: 200 },
@ -57,7 +57,6 @@ context('Actions on polylines', () => {
};
const createPolylinesShapeSwitchLabel = {
type: 'Shape',
switchLabel: true,
labelName: newLabelName,
pointsMap: [
{ x: 600, y: 200 },
@ -69,7 +68,6 @@ context('Actions on polylines', () => {
};
const createPolylinesTrackSwitchLabel = {
type: 'Track',
switchLabel: true,
labelName: newLabelName,
pointsMap: [
{ x: 700, y: 200 },

@ -4,14 +4,14 @@
/// <reference types="cypress" />
import { taskName } from '../../support/const';
import { taskName, labelName } from '../../support/const';
context('Actions on points', () => {
const caseId = '12';
const newLabelName = `New label for case ${caseId}`;
const createPointsShape = {
type: 'Shape',
switchLabel: false,
labelName: labelName,
pointsMap: [
{ x: 200, y: 200 },
{ x: 250, y: 200 },
@ -22,7 +22,7 @@ context('Actions on points', () => {
};
const createPointsTrack = {
type: 'Track',
switchLabel: false,
labelName: labelName,
pointsMap: [
{ x: 300, y: 200 },
{ x: 350, y: 200 },
@ -33,7 +33,7 @@ context('Actions on points', () => {
};
const createPointsShapePoints = {
type: 'Shape',
switchLabel: false,
labelName: labelName,
pointsMap: [
{ x: 400, y: 200 },
{ x: 450, y: 200 },
@ -45,7 +45,7 @@ context('Actions on points', () => {
};
const createPointsTrackPoints = {
type: 'Track',
switchLabel: false,
labelName: labelName,
pointsMap: [
{ x: 500, y: 200 },
{ x: 550, y: 200 },
@ -57,7 +57,6 @@ context('Actions on points', () => {
};
const createPointsShapeSwitchLabel = {
type: 'Shape',
switchLabel: true,
labelName: newLabelName,
pointsMap: [
{ x: 600, y: 200 },
@ -69,7 +68,6 @@ context('Actions on points', () => {
};
const createPointsTrackSwitchLabel = {
type: 'Track',
switchLabel: true,
labelName: newLabelName,
pointsMap: [
{ x: 700, y: 200 },

@ -4,14 +4,14 @@
/// <reference types="cypress" />
import { taskName } from '../../support/const';
import { taskName, labelName } from '../../support/const';
context('Merge/split features', () => {
const caseId = '13';
const createRectangleShape2Points = {
points: 'By 2 Points',
type: 'Shape',
switchLabel: false,
labelName: labelName,
firstX: 250,
firstY: 350,
secondX: 350,
@ -20,7 +20,7 @@ context('Merge/split features', () => {
const createRectangleShape2PointsSecond = {
points: 'By 2 Points',
type: 'Shape',
switchLabel: false,
labelName: labelName,
firstX: createRectangleShape2Points.firstX + 300,
firstY: createRectangleShape2Points.firstY,
secondX: createRectangleShape2Points.secondX + 300,

@ -4,7 +4,7 @@
/// <reference types="cypress" />
import { taskName } from '../../support/const';
import { taskName, labelName } from '../../support/const';
context('Appearance features', () => {
const caseId = '14';
@ -15,7 +15,7 @@ context('Appearance features', () => {
const createRectangleShape2Points = {
points: 'By 2 Points',
type: 'Shape',
switchLabel: false,
labelName: labelName,
firstX: 100,
firstY: 350,
secondX: 200,
@ -24,7 +24,7 @@ context('Appearance features', () => {
const createPolygonShape = {
reDraw: false,
type: 'Shape',
switchLabel: false,
labelName: labelName,
pointsMap: [
{ x: 250, y: 350 },
{ x: 300, y: 300 },
@ -35,7 +35,7 @@ context('Appearance features', () => {
};
const createPolylinesShape = {
type: 'Shape',
switchLabel: false,
labelName: labelName,
pointsMap: [
{ x: 350, y: 350 },
{ x: 400, y: 300 },
@ -48,7 +48,7 @@ context('Appearance features', () => {
const createCuboidShape2Points = {
points: 'From rectangle',
type: 'Shape',
switchLabel: false,
labelName: labelName,
firstX: 450,
firstY: 350,
secondX: 550,
@ -56,7 +56,7 @@ context('Appearance features', () => {
};
const createPointsShape = {
type: 'Shape',
switchLabel: false,
labelName: labelName,
pointsMap: [{ x: 650, y: 350 }],
complete: true,
numberOfPoints: null,

@ -4,14 +4,14 @@
/// <reference types="cypress" />
import { taskName } from '../../support/const';
import { taskName, labelName } from '../../support/const';
context('Group features', () => {
const caseId = '15';
const createRectangleShape2Points = {
points: 'By 2 Points',
type: 'Shape',
switchLabel: false,
labelName: labelName,
firstX: 250,
firstY: 350,
secondX: 350,
@ -20,7 +20,7 @@ context('Group features', () => {
const createRectangleShape2PointsSecond = {
points: 'By 2 Points',
type: 'Shape',
switchLabel: false,
labelName: labelName,
firstX: createRectangleShape2Points.firstX + 300,
firstY: createRectangleShape2Points.firstY,
secondX: createRectangleShape2Points.secondX + 300,
@ -29,7 +29,7 @@ context('Group features', () => {
const createRectangleTrack2Points = {
points: 'By 2 Points',
type: 'Track',
switchLabel: false,
labelName: labelName,
firstX: 250,
firstY: 600,
secondX: 350,
@ -38,7 +38,7 @@ context('Group features', () => {
const createRectangleTrack2PointsSecond = {
points: 'By 2 Points',
type: 'Track',
switchLabel: false,
labelName: labelName,
firstX: createRectangleTrack2Points.firstX + 300,
firstY: createRectangleTrack2Points.firstY,
secondX: createRectangleTrack2Points.secondX + 300,

@ -4,7 +4,7 @@
/// <reference types="cypress" />
import { taskName } from '../../support/const';
import { taskName, labelName } from '../../support/const';
context('Actions on polygon', () => {
const caseId = '16';
@ -12,7 +12,7 @@ context('Actions on polygon', () => {
const createPolygonShapeFirst = {
reDraw: false,
type: 'Shape',
switchLabel: false,
labelName: labelName,
pointsMap: [
{ x: 340, y: 200 },
{ x: 590, y: 200 },
@ -24,7 +24,7 @@ context('Actions on polygon', () => {
const createPolygonShapeSecond = {
reDraw: false,
type: 'Shape',
switchLabel: false,
labelName: labelName,
pointsMap: [
{ x: 190, y: 210 },
{ x: 440, y: 210 },

@ -16,7 +16,7 @@ context('Lock/hide features.', () => {
const createPolygonShape = {
reDraw: false,
type: 'Shape',
switchLabel: false,
labelName: labelName,
pointsMap: [
{ x: 200, y: 200 },
{ x: 250, y: 200 },
@ -28,7 +28,7 @@ context('Lock/hide features.', () => {
const createRectangleTrack2Points = {
points: 'By 2 Points',
type: 'Track',
switchLabel: false,
labelName: labelName,
firstX: 260,
firstY: 200,
secondX: 360,
@ -37,7 +37,7 @@ context('Lock/hide features.', () => {
const createCuboidShape4Points = {
points: 'By 4 Points',
type: 'Shape',
switchLabel: false,
labelName: labelName,
firstX: 400,
firstY: 350,
secondX: 500,
@ -49,7 +49,6 @@ context('Lock/hide features.', () => {
};
const createPolylinesShapeSwitchLabel = {
type: 'Shape',
switchLabel: true,
labelName: newLabelName1,
pointsMap: [
{ x: 600, y: 200 },
@ -61,7 +60,6 @@ context('Lock/hide features.', () => {
};
const createPointsShapeSwitchLabel = {
type: 'Shape',
switchLabel: true,
labelName: newLabelName2,
pointsMap: [
{ x: 700, y: 200 }
@ -72,7 +70,6 @@ context('Lock/hide features.', () => {
const createRectangleShape4Points = {
points: 'By 4 Points',
type: 'Shape',
switchLabel: true,
labelName: newLabelName3,
firstX: 550,
firstY: 350,
@ -86,7 +83,6 @@ context('Lock/hide features.', () => {
const createPolygonTrack = {
reDraw: false,
type: 'Track',
switchLabel: true,
labelName: newLabelName4,
pointsMap: [
{ x: 700, y: 350 },

@ -4,7 +4,7 @@
/// <reference types="cypress" />
import { taskName } from '../../support/const';
import { taskName, labelName } from '../../support/const';
context('Actions on rectangle', () => {
const caseId = '8';
@ -12,7 +12,7 @@ context('Actions on rectangle', () => {
const createRectangleShape2Points = {
points: 'By 2 Points',
type: 'Shape',
switchLabel: false,
labelName: labelName,
firstX: 250,
firstY: 350,
secondX: 350,
@ -21,7 +21,7 @@ context('Actions on rectangle', () => {
const createRectangleShape4Points = {
points: 'By 4 Points',
type: 'Shape',
switchLabel: false,
labelName: labelName,
firstX: 400,
firstY: 350,
secondX: 500,
@ -34,7 +34,7 @@ context('Actions on rectangle', () => {
const createRectangleTrack2Points = {
points: 'By 2 Points',
type: 'Track',
switchLabel: false,
labelName: labelName,
firstX: createRectangleShape2Points.firstX,
firstY: createRectangleShape2Points.firstY - 150,
secondX: createRectangleShape2Points.secondX,
@ -43,7 +43,7 @@ context('Actions on rectangle', () => {
const createRectangleTrack4Points = {
points: 'By 4 Points',
type: 'Track',
switchLabel: false,
labelName: labelName,
firstX: createRectangleShape4Points.firstX,
firstY: createRectangleShape4Points.firstY - 150,
secondX: createRectangleShape4Points.secondX - 100,
@ -57,7 +57,6 @@ context('Actions on rectangle', () => {
labelName: newLabelName,
points: 'By 2 Points',
type: 'Shape',
switchLabel: true,
firstX: createRectangleShape2Points.firstX,
firstY: createRectangleShape2Points.firstY + 150,
secondX: createRectangleShape2Points.secondX,
@ -67,7 +66,6 @@ context('Actions on rectangle', () => {
labelName: newLabelName,
points: 'By 4 Points',
type: 'Shape',
switchLabel: true,
firstX: createRectangleShape4Points.firstX,
firstY: createRectangleShape4Points.firstY + 150,
secondX: createRectangleShape4Points.secondX,

@ -4,7 +4,7 @@
/// <reference types="cypress" />
import { taskName } from '../../support/const';
import { taskName, labelName } from '../../support/const';
context('Actions on Cuboid', () => {
const caseId = '9';
@ -12,7 +12,7 @@ context('Actions on Cuboid', () => {
const createCuboidShape2Points = {
points: 'From rectangle',
type: 'Shape',
switchLabel: false,
labelName: labelName,
firstX: 250,
firstY: 350,
secondX: 350,
@ -21,7 +21,7 @@ context('Actions on Cuboid', () => {
const createCuboidShape4Points = {
points: 'By 4 Points',
type: 'Shape',
switchLabel: false,
labelName: labelName,
firstX: 400,
firstY: 350,
secondX: 500,
@ -34,7 +34,7 @@ context('Actions on Cuboid', () => {
const createCuboidTrack2Points = {
points: 'From rectangle',
type: 'Track',
switchLabel: false,
labelName: labelName,
firstX: createCuboidShape2Points.firstX,
firstY: createCuboidShape2Points.firstY - 150,
secondX: createCuboidShape2Points.secondX,
@ -43,7 +43,7 @@ context('Actions on Cuboid', () => {
const createCuboidTrack4Points = {
points: 'By 4 Points',
type: 'Track',
switchLabel: false,
labelName: labelName,
firstX: createCuboidShape4Points.firstX,
firstY: createCuboidShape4Points.firstY - 150,
secondX: createCuboidShape4Points.secondX - 100,
@ -57,7 +57,6 @@ context('Actions on Cuboid', () => {
labelName: newLabelName,
points: 'From rectangle',
type: 'Shape',
switchLabel: true,
firstX: createCuboidShape2Points.firstX,
firstY: createCuboidShape2Points.firstY + 150,
secondX: createCuboidShape2Points.secondX,
@ -67,7 +66,6 @@ context('Actions on Cuboid', () => {
labelName: newLabelName,
points: 'By 4 Points',
type: 'Shape',
switchLabel: true,
firstX: createCuboidShape4Points.firstX,
firstY: createCuboidShape4Points.firstY + 150,
secondX: createCuboidShape4Points.secondX,

@ -4,14 +4,14 @@
/// <reference types="cypress" />
import { taskName } from '../../support/const';
import { taskName, labelName } from '../../support/const';
context('Check if UI not fails with shape dragging over sidebar', () => {
const issueId = '1216';
const createRectangleShape2Points = {
points: 'By 2 Points',
type: 'Shape',
switchLabel: false,
labelName: labelName,
firstX: 250,
firstY: 350,
secondX: 350,
@ -20,7 +20,7 @@ context('Check if UI not fails with shape dragging over sidebar', () => {
const createRectangleShape2PointsSecond = {
points: 'By 2 Points',
type: 'Shape',
switchLabel: false,
labelName: labelName,
firstX: createRectangleShape2Points.firstX,
firstY: createRectangleShape2Points.firstY - 150,
secondX: createRectangleShape2Points.secondX,

@ -4,13 +4,13 @@
/// <reference types="cypress" />
import { taskName } from '../../support/const';
import { taskName, labelName } from '../../support/const';
context('Points track it is still invisible on next frames', () => {
const issueId = '1368';
const createPointsTrack = {
type: 'Track',
switchLabel: false,
labelName: labelName,
pointsMap: [{ x: 300, y: 410 }],
complete: true,
numberOfPoints: null,

@ -4,7 +4,7 @@
/// <reference types="cypress" />
import { taskName } from '../../support/const';
import { taskName, labelName } from '../../support/const';
context('When delete a point, the required point is deleted.', () => {
const issueId = '1391';
@ -12,7 +12,7 @@ context('When delete a point, the required point is deleted.', () => {
let pointsСoordinatesAfterDeletePoint = [];
const createPolylinesShape = {
type: 'Shape',
switchLabel: false,
labelName: labelName,
pointsMap: [
{ x: 309, y: 250 },
{ x: 309, y: 350 },

@ -12,7 +12,7 @@ context('The highlighted attribute in AAM should correspond to the chosen attrib
const createRectangleShape2Points = {
points: 'By 2 Points',
type: 'Shape',
switchLabel: false,
labelName: labelName,
firstX: 250,
firstY: 350,
secondX: 350,

@ -4,16 +4,15 @@
/// <reference types="cypress" />
import { taskName } from '../../support/const';
import { taskName, labelName } from '../../support/const';
context('Check if the new label reflects in the options', () => {
const issueId = '1429';
const labelName = `Issue ${issueId}`;
const newLabelName = `New ${labelName}`;
const createRectangleShape2Points = {
points: 'By 2 Points',
type: 'Shape',
switchLabel: false,
labelName: labelName,
firstX: 250,
firstY: 350,
secondX: 350,

@ -4,14 +4,14 @@
/// <reference types="cypress" />
import { taskName } from '../../support/const';
import { taskName, labelName } from '../../support/const';
context('Check hide functionality (H)', () => {
const issueId = '1433';
const createRectangleShape2Points = {
points: 'By 2 Points',
type: 'Shape',
switchLabel: false,
labelName: labelName,
firstX: 250,
firstY: 350,
secondX: 350,

@ -4,14 +4,14 @@
/// <reference types="cypress" />
import { taskName } from '../../support/const';
import { taskName, labelName } from '../../support/const';
context('Cancel "multiple paste". UI is not locked.', () => {
const issueId = '1438';
const createRectangleShape2Points = {
points: 'By 2 Points',
type: 'Shape',
switchLabel: false,
labelName: labelName,
firstX: 250,
firstY: 350,
secondX: 350,

@ -11,7 +11,7 @@ context('Information about a blocked object disappears if hover the cursor over
const createRectangleShape2Points = {
points: 'By 2 Points',
type: 'Shape',
switchLabel: false,
labelName: labelName,
firstX: 250,
firstY: 350,
secondX: 350,
@ -20,7 +20,7 @@ context('Information about a blocked object disappears if hover the cursor over
const createRectangleShape2PointsSecond = {
points: 'By 2 Points',
type: 'Shape',
switchLabel: false,
labelName: labelName,
firstX: createRectangleShape2Points.firstX,
firstY: createRectangleShape2Points.firstY - 150,
secondX: createRectangleShape2Points.secondX,

@ -4,14 +4,14 @@
/// <reference types="cypress" />
import { taskName } from '../../support/const';
import { taskName, labelName } from '../../support/const';
context('Filter property "shape" work correctly', () => {
const issueId = '1444';
const createRectangleShape2Points = {
points: 'By 2 Points',
type: 'Shape',
switchLabel: false,
labelName: labelName,
firstX: 250,
firstY: 350,
secondX: 350,
@ -20,7 +20,7 @@ context('Filter property "shape" work correctly', () => {
const createPolygonShape = {
reDraw: false,
type: 'Shape',
switchLabel: false,
labelName: labelName,
pointsMap: [
{ x: 300, y: 100 },
{ x: 400, y: 400 },

@ -4,14 +4,14 @@
/// <reference types="cypress" />
import { taskName } from '../../support/const';
import { taskName, labelName } from '../../support/const';
context('Dump annotation if cuboid created', () => {
const issueId = '1568';
const createCuboidShape2Points = {
points: 'From rectangle',
type: 'Shape',
switchLabel: false,
labelName: labelName,
firstX: 250,
firstY: 350,
secondX: 350,

@ -11,7 +11,7 @@ context('An error occurs in AAM when switching to 2 frames, if the frames have o
const createRectangleShape2Points = {
points: 'By 2 Points',
type: 'Shape',
switchLabel: false,
labelName: labelName,
firstX: 250,
firstY: 350,
secondX: 350,
@ -20,7 +20,7 @@ context('An error occurs in AAM when switching to 2 frames, if the frames have o
const createRectangleShape2PointsSecond = {
points: 'By 2 Points',
type: 'Shape',
switchLabel: false,
labelName: labelName,
firstX: createRectangleShape2Points.firstX,
firstY: createRectangleShape2Points.firstY - 150,
secondX: createRectangleShape2Points.secondX,

@ -4,14 +4,14 @@
/// <reference types="cypress" />
import { taskName, advancedConfigurationParams } from '../../support/const';
import { taskName, advancedConfigurationParams, labelName } from '../../support/const';
context('Check propagation work from the latest frame', () => {
const issueId = '1785';
const createRectangleShape2Points = {
points: 'By 2 Points',
type: 'Shape',
switchLabel: false,
labelName: labelName,
firstX: 250,
firstY: 350,
secondX: 350,

@ -4,14 +4,14 @@
/// <reference types="cypress" />
import { taskName, advancedConfigurationParams } from '../../support/const';
import { taskName, advancedConfigurationParams, labelName } from '../../support/const';
context('First part of a splitted track is visible', () => {
const issueId = '1819';
const createRectangleTrack2Points = {
points: 'By 2 Points',
type: 'Track',
switchLabel: false,
labelName: labelName,
firstX: 250,
firstY: 350,
secondX: 350,

@ -4,7 +4,7 @@
/// <reference types="cypress" />
import { taskName } from '../../support/const';
import { taskName, labelName } from '../../support/const';
context(
"Hidden objects mustn't consider when we want to group visible objects only and use an grouping area for it.",
@ -13,21 +13,21 @@ context(
let bgcolor = '';
const createFirstPointsShape = {
type: 'Shape',
switchLabel: false,
labelName: labelName,
pointsMap: [{ x: 300, y: 410 }],
complete: true,
numberOfPoints: null,
};
const createSecondPointsShape = {
type: 'Shape',
switchLabel: false,
labelName: labelName,
pointsMap: [{ x: 350, y: 410 }],
complete: true,
numberOfPoints: null,
};
const createThridPointsShape = {
type: 'Shape',
switchLabel: false,
labelName: labelName,
pointsMap: [{ x: 400, y: 410 }],
complete: true,
numberOfPoints: null,

@ -4,7 +4,7 @@
/// <reference types="cypress" />
import { taskName, textDefaultValue, attrName } from '../../support/const';
import { taskName, textDefaultValue, attrName, labelName } from '../../support/const';
context(
"Checks that the cursor doesn't automatically jump to the end of a word when the attribute value changes",
@ -13,7 +13,7 @@ context(
const createRectangleShape2Points = {
points: 'By 2 Points',
type: 'Shape',
switchLabel: false,
labelName: labelName,
firstX: 250,
firstY: 350,
secondX: 350,

@ -4,14 +4,14 @@
/// <reference types="cypress" />
import { taskName } from '../../support/const';
import { taskName, labelName } from '../../support/const';
context("The points of the previous polygon mustn't appear while polygon's interpolation.", () => {
const issueId = '1882';
const createPolygonTrack = {
reDraw: false,
type: 'Track',
switchLabel: false,
labelName: labelName,
pointsMap: [
{ x: 309, y: 431 },
{ x: 360, y: 500 },
@ -23,7 +23,7 @@ context("The points of the previous polygon mustn't appear while polygon's inter
const reDrawPolygonTrack = {
reDraw: true,
type: 'Track',
switchLabel: false,
labelName: labelName,
pointsMap: [
{ x: 359, y: 431 },
{ x: 410, y: 500 },

@ -4,7 +4,7 @@
/// <reference types="cypress" />
import { taskName, advancedConfigurationParams } from '../../support/const';
import { taskName, advancedConfigurationParams, labelName } from '../../support/const';
context("Point coordinates are not duplicated while polygon's interpolation.", () => {
const issueId = '1886';
@ -12,7 +12,7 @@ context("Point coordinates are not duplicated while polygon's interpolation.", (
const createPolygonTrack = {
reDraw: false,
type: 'Track',
switchLabel: false,
labelName: labelName,
pointsMap: [
{ x: 300, y: 450 },
{ x: 400, y: 450 },

@ -4,7 +4,7 @@
/// <reference types="cypress" />
import { taskName, textDefaultValue, attrName } from '../../support/const';
import { taskName, textDefaultValue, attrName, labelName } from '../../support/const';
context('Check label attribute changes', () => {
const issueId = '1919';
@ -12,7 +12,7 @@ context('Check label attribute changes', () => {
const createRectangleShape2Points = {
points: 'By 2 Points',
type: 'Shape',
switchLabel: false,
labelName: labelName,
firstX: 250,
firstY: 350,
secondX: 350,

@ -0,0 +1,31 @@
// Copyright (C) 2020 Intel Corporation
//
// SPDX-License-Identifier: MIT
/// <reference types="cypress" />
import { taskName, labelName } from '../../support/const';
context('Draw a point shape, specify one point', () => {
const issueId = '2306';
const createPointsShape = {
type: 'Shape',
labelName: labelName,
pointsMap: [{ x: 500, y: 200 }],
numberOfPoints: 1,
};
before(() => {
cy.openTaskJob(taskName);
});
describe(`Testing case "${issueId}"`, () => {
it('Draw a point shape, specify one point. Drag cursor.', () => {
cy.createPoint(createPointsShape);
cy.get('.cvat-canvas-container').trigger('mousemove');
// Test fail before fix with error:
// The following error originated from your application code, not from Cypress.
// > Cannot read property 'each' of undefined.
});
});
});

@ -0,0 +1,110 @@
// Copyright (C) 2020 Intel Corporation
//
// SPDX-License-Identifier: MIT
/// <reference types="cypress" />
context('Wrong attribute is removed in label constructor.', () => {
const issueId = '2411';
const taskRaw = [
{
name: "person",
color: "#ff6037",
attributes: [
{
name: "lower_body",
input_type: "select",
mutable: true,
values: [
"__undefined__",
"long",
"short",
"n/a"
]
},
{
name: "hair_color",
input_type: "select",
mutable: true,
values: [
"__undefined__",
"black",
"brown",
"blond",
"grey",
"other",
"n/a"
]
},
{
name: "cellphone",
input_type: "select",
mutable: true,
values: [
"__undefined__",
"yes",
"no",
"n/a"
]
}
]
}
];
before(() => {
cy.visit('auth/login');
cy.login();
});
describe(`Testing issue "${issueId}"`, () => {
it('Open the create task page.', () => {
cy.get('#cvat-create-task-button').click({ force: true });
});
it('Go to Raw labels editor. Insert values.', () => {
cy.get('[role="tab"]').contains('Raw').click();
cy.get('#labels').clear().type(JSON.stringify(taskRaw), { parseSpecialCharSequences: false });
cy.contains('Done').click();
});
it('Go to constructor tab. The label "person" appeared there.', () => {
cy.get('[role="tab"]').contains('Constructor').click();
cy.get('.cvat-constructor-viewer-item').should('have.text', 'person').within(() => {
cy.get('i[aria-label="icon: edit"]').click();
});
});
it('Remove the average attribute "hair_color". It has been deleted.', () => {
cy.get('.cvat-label-constructor-updater').within(() => {
cy.get('.ant-row-flex-space-between').eq(1).within(() => {
cy.get('[placeholder="Name"]').invoke('val').then(placeholderNameValue => {
expect(placeholderNameValue).to.be.equal('hair_color');
});
cy.get('.cvat-delete-attribute-button').click();
});
cy.get('.ant-row-flex-space-between').eq(0).within(() => {
cy.get('[placeholder="Name"]').invoke('val').then(placeholderNameValue => {
expect(placeholderNameValue).to.be.equal('cellphone');
});
});
cy.get('.ant-row-flex-space-between').eq(1).within(() => {
cy.get('[placeholder="Name"]').invoke('val').then(placeholderNameValue => {
expect(placeholderNameValue).to.be.equal('lower_body');
});
});
});
});
it('Remove the latest attribute "lower_body". It has been deleted.', () => {
cy.get('.cvat-label-constructor-updater').within(() => {
cy.get('.ant-row-flex-space-between').eq(1).within(() => {
cy.get('[placeholder="Name"]').invoke('val').then(placeholderNameValue => {
expect(placeholderNameValue).to.be.equal('lower_body');
});
cy.get('.cvat-delete-attribute-button').click();
});
cy.get('.ant-row-flex-space-between').eq(0).within(() => {
cy.get('[placeholder="Name"]').invoke('val').then(placeholderNameValue => {
expect(placeholderNameValue).to.be.equal('cellphone');
});
});
});
});
});
});

@ -0,0 +1,60 @@
// Copyright (C) 2020 Intel Corporation
//
// SPDX-License-Identifier: MIT
/// <reference types="cypress" />
import { taskName, labelName } from '../../support/const';
context('Check hide/unhide functionality from label tab for object and tag with a same label.', () => {
const issueId = '2418';
const createRectangleShape2Points = {
points: 'By 2 Points',
type: 'Shape',
labelName: labelName,
firstX: 260,
firstY: 200,
secondX: 360,
secondY: 250,
};
before(() => {
cy.openTaskJob(taskName);
});
describe(`Testing issue "${issueId}"`, () => {
it('Crearte an object. Create a tag.', () => {
cy.createRectangle(createRectangleShape2Points);
cy.createTag(labelName);
});
it('Go to "Labels" tab.', () => {
cy.get('.cvat-objects-sidebar').within(() => {
cy.contains('Labels').click();
});
});
it('Hide object by label name.', () => {
cy.get('.cvat-objects-sidebar-labels-list').within(() => {
cy.contains(labelName)
.parents('.cvat-objects-sidebar-label-item')
.within(() => {
cy.get('.cvat-label-item-button-hidden')
.click()
.should('have.class', 'cvat-label-item-button-hidden-enabled');
});
});
cy.get('#cvat_canvas_shape_1').should('be.hidden');
});
it('Unhide object by label name.', () => {
cy.get('.cvat-objects-sidebar-labels-list').within(() => {
cy.contains(labelName)
.parents('.cvat-objects-sidebar-label-item')
.within(() => {
cy.get('.cvat-label-item-button-hidden')
.click()
.should('not.have.class', 'cvat-label-item-button-hidden-enabled');
});
});
cy.get('#cvat_canvas_shape_1').should('be.visible');
});
});
});

@ -4,14 +4,14 @@
/// <reference types="cypress" />
import { taskName } from '../../support/const';
import { taskName, labelName } from '../../support/const';
context('Check if the UI fails by moving to the next frame while dragging the object', () => {
const prId = '1370';
const createRectangleShape2Points = {
points: 'By 2 Points',
type: 'Shape',
switchLabel: false,
labelName: labelName,
firstX: 250,
firstY: 350,
secondX: 350,

@ -102,9 +102,7 @@ Cypress.Commands.add('openTaskJob', (taskName, jobNumber = 0) => {
Cypress.Commands.add('createRectangle', (createRectangleParams) => {
cy.get('.cvat-draw-rectangle-control').click();
if (createRectangleParams.switchLabel) {
cy.switchLabel(createRectangleParams.labelName, 'rectangle');
}
cy.switchLabel(createRectangleParams.labelName, 'rectangle');
cy.contains('Draw new rectangle')
.parents('.cvat-draw-shape-popover-content')
.within(() => {
@ -129,7 +127,7 @@ Cypress.Commands.add('switchLabel', (labelName, objectType) => {
cy.contains(regex).parents('.cvat-draw-shape-popover-content').within(() => {
cy.get('.ant-select-selection-selected-value').click();
});
cy.get('.ant-select-dropdown-menu').last().contains(labelName).click();
cy.get('.ant-select-dropdown').not('.ant-select-dropdown-hidden').contains(new RegExp(`^${labelName}$`, 'g')).click();
});
Cypress.Commands.add('checkObjectParameters', (objectParameters, objectType) => {
@ -152,9 +150,7 @@ Cypress.Commands.add('checkObjectParameters', (objectParameters, objectType) =>
Cypress.Commands.add('createPoint', (createPointParams) => {
cy.get('.cvat-draw-points-control').click();
if (createPointParams.switchLabel) {
cy.switchLabel(createPointParams.labelName, 'points');
}
cy.switchLabel(createPointParams.labelName, 'points');
cy.contains('Draw new points')
.parents('.cvat-draw-shape-popover-content')
.within(() => {
@ -196,9 +192,7 @@ Cypress.Commands.add('shapeGrouping', (firstX, firstY, lastX, lastY) => {
Cypress.Commands.add('createPolygon', (createPolygonParams) => {
if (!createPolygonParams.reDraw) {
cy.get('.cvat-draw-polygon-control').click();
if (createPolygonParams.switchLabel) {
cy.switchLabel(createPolygonParams.labelName, 'polygon');
}
cy.switchLabel(createPolygonParams.labelName, 'polygon');
cy.contains('Draw new polygon')
.parents('.cvat-draw-shape-popover-content')
.within(() => {
@ -248,16 +242,14 @@ Cypress.Commands.add('changeLabelAAM', (labelName) => {
cy.get('.attribute-annotation-sidebar-basics-editor').within(() => {
cy.get('.ant-select-selection').click();
});
cy.get('.ant-select-dropdown-menu-item').contains(labelName).click();
cy.get('.ant-select-dropdown').not('.ant-select-dropdown-hidden').contains(new RegExp(`^${labelName}$`, 'g')).click();
}
});
});
Cypress.Commands.add('createCuboid', (createCuboidParams) => {
cy.get('.cvat-draw-cuboid-control').click();
if (createCuboidParams.switchLabel) {
cy.switchLabel(createCuboidParams.labelName, 'cuboid');
}
cy.switchLabel(createCuboidParams.labelName, 'cuboid');
cy.contains('Draw new cuboid')
.parents('.cvat-draw-shape-popover-content')
.within(() => {
@ -286,9 +278,7 @@ Cypress.Commands.add('updateAttributes', (multiAttrParams) => {
Cypress.Commands.add('createPolyline', (createPolylineParams) => {
cy.get('.cvat-draw-polyline-control').click();
if (createPolylineParams.switchLabel) {
cy.switchLabel(createPolylineParams.labelName, 'polyline');
}
cy.switchLabel(createPolylineParams.labelName, 'polyline');
cy.contains('Draw new polyline')
.parents('.cvat-draw-shape-popover-content')
.within(() => {

Loading…
Cancel
Save