Merged develop

main
Boris Sekachev 5 years ago
commit 4ef1de0081

@ -29,6 +29,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Saving relative paths in dummy chunks instead of absolute (<https://github.com/openvinotoolkit/cvat/pull/2424>) - Saving relative paths in dummy chunks instead of absolute (<https://github.com/openvinotoolkit/cvat/pull/2424>)
- Objects with a specific label cannot be displayed if at least one tag with the label exist (<https://github.com/openvinotoolkit/cvat/pull/2435>) - Objects with a specific label cannot be displayed if at least one tag with the label exist (<https://github.com/openvinotoolkit/cvat/pull/2435>)
- Wrong attribute can be removed in labels editor (<https://github.com/openvinotoolkit/cvat/pull/2436>) - Wrong attribute can be removed in labels editor (<https://github.com/openvinotoolkit/cvat/pull/2436>)
- UI fails with the error "Cannot read property 'label' of undefined" (<https://github.com/openvinotoolkit/cvat/pull/2442>)
- Exception: "Value must be a user instance" (<https://github.com/openvinotoolkit/cvat/pull/2441>)
- Reset zoom option doesn't work in tag annotation mode (<https://github.com/openvinotoolkit/cvat/pull/2443>)
- Canvas is busy error (<https://github.com/openvinotoolkit/cvat/pull/2437>) - Canvas is busy error (<https://github.com/openvinotoolkit/cvat/pull/2437>)
### Security ### Security

@ -1,6 +1,6 @@
{ {
"name": "cvat-ui", "name": "cvat-ui",
"version": "1.10.3", "version": "1.10.6",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {

@ -1,6 +1,6 @@
{ {
"name": "cvat-ui", "name": "cvat-ui",
"version": "1.10.3", "version": "1.10.6",
"description": "CVAT single-page application", "description": "CVAT single-page application",
"main": "src/index.tsx", "main": "src/index.tsx",
"scripts": { "scripts": {

@ -10,7 +10,9 @@ import Icon from 'antd/lib/icon';
import Layout from 'antd/lib/layout/layout'; import Layout from 'antd/lib/layout/layout';
import Slider, { SliderValue } from 'antd/lib/slider'; import Slider, { SliderValue } from 'antd/lib/slider';
import { ColorBy, GridColor, ObjectType, ContextMenuType, Workspace, ShapeType } from 'reducers/interfaces'; import {
ColorBy, GridColor, ObjectType, ContextMenuType, Workspace, ShapeType,
} from 'reducers/interfaces';
import { LogType } from 'cvat-logger'; import { LogType } from 'cvat-logger';
import { Canvas } from 'cvat-canvas-wrapper'; import { Canvas } from 'cvat-canvas-wrapper';
import getCore from 'cvat-core-wrapper'; import getCore from 'cvat-core-wrapper';
@ -217,10 +219,7 @@ export default class CanvasWrapperComponent extends React.PureComponent<Props> {
this.updateCanvas(); this.updateCanvas();
} }
if ( if (prevProps.frame !== frameData.number && resetZoom && workspace !== Workspace.ATTRIBUTE_ANNOTATION) {
prevProps.frame !== frameData.number &&
((resetZoom && workspace !== Workspace.ATTRIBUTE_ANNOTATION) || workspace === Workspace.TAG_ANNOTATION)
) {
canvasInstance.html().addEventListener( canvasInstance.html().addEventListener(
'canvas.setup', 'canvas.setup',
() => { () => {
@ -304,7 +303,9 @@ export default class CanvasWrapperComponent extends React.PureComponent<Props> {
} }
private onCanvasShapeDrawn = (event: any): void => { private onCanvasShapeDrawn = (event: any): void => {
const { jobInstance, activeLabelID, activeObjectType, frame, onShapeDrawn, onCreateAnnotations } = this.props; const {
jobInstance, activeLabelID, activeObjectType, frame, onShapeDrawn, onCreateAnnotations,
} = this.props;
if (!event.detail.continue) { if (!event.detail.continue) {
onShapeDrawn(); onShapeDrawn();
@ -327,7 +328,9 @@ export default class CanvasWrapperComponent extends React.PureComponent<Props> {
}; };
private onCanvasObjectsMerged = (event: any): void => { private onCanvasObjectsMerged = (event: any): void => {
const { jobInstance, frame, onMergeAnnotations, onMergeObjects } = this.props; const {
jobInstance, frame, onMergeAnnotations, onMergeObjects,
} = this.props;
onMergeObjects(false); onMergeObjects(false);
@ -340,7 +343,9 @@ export default class CanvasWrapperComponent extends React.PureComponent<Props> {
}; };
private onCanvasObjectsGroupped = (event: any): void => { private onCanvasObjectsGroupped = (event: any): void => {
const { jobInstance, frame, onGroupAnnotations, onGroupObjects } = this.props; const {
jobInstance, frame, onGroupAnnotations, onGroupObjects,
} = this.props;
onGroupObjects(false); onGroupObjects(false);
@ -349,7 +354,9 @@ export default class CanvasWrapperComponent extends React.PureComponent<Props> {
}; };
private onCanvasTrackSplitted = (event: any): void => { private onCanvasTrackSplitted = (event: any): void => {
const { jobInstance, frame, onSplitAnnotations, onSplitTrack } = this.props; const {
jobInstance, frame, onSplitAnnotations, onSplitTrack,
} = this.props;
onSplitTrack(false); onSplitTrack(false);
@ -429,7 +436,9 @@ export default class CanvasWrapperComponent extends React.PureComponent<Props> {
}; };
private onCanvasCursorMoved = async (event: any): Promise<void> => { private onCanvasCursorMoved = async (event: any): Promise<void> => {
const { jobInstance, activatedStateID, workspace, onActivateObject } = this.props; const {
jobInstance, activatedStateID, workspace, onActivateObject,
} = this.props;
if (workspace !== Workspace.STANDARD) { if (workspace !== Workspace.STANDARD) {
return; return;
@ -560,7 +569,9 @@ export default class CanvasWrapperComponent extends React.PureComponent<Props> {
} }
private updateShapesView(): void { private updateShapesView(): void {
const { annotations, opacity, colorBy, outlined, outlineColor } = this.props; const {
annotations, opacity, colorBy, outlined, outlineColor,
} = this.props;
for (const state of annotations) { for (const state of annotations) {
let shapeColor = ''; let shapeColor = '';
@ -588,7 +599,9 @@ export default class CanvasWrapperComponent extends React.PureComponent<Props> {
} }
private updateCanvas(): void { private updateCanvas(): void {
const { curZLayer, annotations, frameData, canvasInstance } = this.props; const {
curZLayer, annotations, frameData, canvasInstance,
} = this.props;
if (frameData !== null) { if (frameData !== null) {
canvasInstance.setup( canvasInstance.setup(

@ -83,13 +83,7 @@ export default function UserSelector(props: Props): JSX.Element {
if (value && !users.filter((user) => user.id === value.id).length) { if (value && !users.filter((user) => user.id === value.id).length) {
core.users.get({ id: value.id }).then((result: User[]) => { core.users.get({ id: value.id }).then((result: User[]) => {
const [user] = result; const [user] = result;
setUsers([ setUsers([...users, user]);
...users,
{
id: user.id,
username: user.username,
},
]);
setSearchPhrase(user.username); setSearchPhrase(user.username);
}); });
} }

@ -24,7 +24,10 @@ function mapStateToProps(state: CombinedState): StateToProps {
annotation: { annotation: {
annotations: { activatedStateID, collapsed, states: objectStates }, annotations: { activatedStateID, collapsed, states: objectStates },
canvas: { canvas: {
contextMenu: { visible, top, left, type }, contextMenu: {
visible, top, left, type,
},
ready,
}, },
}, },
} = state; } = state;
@ -33,7 +36,11 @@ function mapStateToProps(state: CombinedState): StateToProps {
activatedStateID, activatedStateID,
collapsed: activatedStateID !== null ? collapsed[activatedStateID] : undefined, collapsed: activatedStateID !== null ? collapsed[activatedStateID] : undefined,
objectStates, objectStates,
visible, visible:
activatedStateID !== null &&
visible &&
ready &&
objectStates.map((_state: any): number => _state.clientID).includes(activatedStateID),
left, left,
top, top,
type, type,
@ -166,7 +173,9 @@ class CanvasContextMenuContainer extends React.PureComponent<Props, State> {
public render(): JSX.Element { public render(): JSX.Element {
const { left, top } = this.state; const { left, top } = this.state;
const { visible, activatedStateID, objectStates, type } = this.props; const {
visible, activatedStateID, objectStates, type,
} = this.props;
return ( return (
<> <>

@ -7,7 +7,9 @@ import copy from 'copy-to-clipboard';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { LogType } from 'cvat-logger'; import { LogType } from 'cvat-logger';
import { ActiveControl, CombinedState, ColorBy, ShapeType } from 'reducers/interfaces'; import {
ActiveControl, CombinedState, ColorBy, ShapeType,
} from 'reducers/interfaces';
import { import {
collapseObjectItems, collapseObjectItems,
updateAnnotationsAsync, updateAnnotationsAsync,
@ -83,40 +85,25 @@ function mapStateToProps(state: CombinedState, own: OwnProps): StateToProps {
const stateIDs = states.map((_state: any): number => _state.clientID); const stateIDs = states.map((_state: any): number => _state.clientID);
const index = stateIDs.indexOf(clientID); const index = stateIDs.indexOf(clientID);
try { const collapsedState =
const collapsedState = typeof statesCollapsed[clientID] === 'undefined' ? initialCollapsed : statesCollapsed[clientID];
typeof statesCollapsed[clientID] === 'undefined' ? initialCollapsed : statesCollapsed[clientID];
return {
return { objectState: states[index],
objectState: states[index], collapsed: collapsedState,
collapsed: collapsedState, attributes: jobAttributes[states[index].label.id],
attributes: jobAttributes[states[index].label.id], labels,
labels, ready,
ready, activeControl,
activeControl, colorBy,
colorBy, jobInstance,
jobInstance, frameNumber,
frameNumber, activated: activatedStateID === clientID,
activated: activatedStateID === clientID, minZLayer,
minZLayer, maxZLayer,
maxZLayer, normalizedKeyMap,
normalizedKeyMap, aiToolsRef,
aiToolsRef, };
};
} catch (exception) {
// we have an exception here sometimes
// but I cannot understand when it happens and what is the root reason
// maybe this temporary hack helps us
const dataObject = {
index,
frameNumber,
clientID: own.clientID,
stateIDs,
};
throw new Error(
`${exception.toString()} in mapStateToProps of ObjectItemContainer. Data are ${JSON.stringify(dataObject)}`,
);
}
} }
function mapDispatchToProps(dispatch: any): DispatchToProps { function mapDispatchToProps(dispatch: any): DispatchToProps {
@ -219,7 +206,9 @@ class ObjectItemContainer extends React.PureComponent<Props> {
}; };
private activate = (): void => { private activate = (): void => {
const { activateObject, objectState, ready, activeControl } = this.props; const {
activateObject, objectState, ready, activeControl,
} = this.props;
if (ready && activeControl === ActiveControl.CURSOR) { if (ready && activeControl === ActiveControl.CURSOR) {
activateObject(objectState.clientID); activateObject(objectState.clientID);
@ -324,7 +313,9 @@ class ObjectItemContainer extends React.PureComponent<Props> {
} }
public render(): JSX.Element { public render(): JSX.Element {
const { objectState, collapsed, labels, attributes, activated, colorBy, normalizedKeyMap } = this.props; const {
objectState, collapsed, labels, attributes, activated, colorBy, normalizedKeyMap,
} = this.props;
let stateColor = ''; let stateColor = '';
if (colorBy === ColorBy.INSTANCE) { if (colorBy === ColorBy.INSTANCE) {

Loading…
Cancel
Save