From 90e97b649440bbac9ab1b771db293420d7a13679 Mon Sep 17 00:00:00 2001 From: Boris Sekachev Date: Fri, 11 Dec 2020 15:28:15 +0300 Subject: [PATCH 1/6] Fixed: 'Cannot read property key of undefined' --- cvat-ui/package-lock.json | 6 +++--- cvat-ui/package.json | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cvat-ui/package-lock.json b/cvat-ui/package-lock.json index 1cd51dc77197..73be24723315 100644 --- a/cvat-ui/package-lock.json +++ b/cvat-ui/package-lock.json @@ -28698,9 +28698,9 @@ } }, "rc-virtual-list": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/rc-virtual-list/-/rc-virtual-list-3.2.2.tgz", - "integrity": "sha512-OepvZDQGUbQQBFk5m2Ds32rfO/tSj9gZkLbzwaIw/hwGgvatDmW+j97YQvFkUQp/XDgdSGcfFfj/6XTKpz0J4g==", + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/rc-virtual-list/-/rc-virtual-list-3.2.3.tgz", + "integrity": "sha512-uEeYDQWwQhxR97SekPeGRbzPtHSbSpw/mYb6QpZZ9bA43kf7s1socV3fD3ySYhQVzo0I+/IUD9jFGit6FbM0WA==", "requires": { "classnames": "^2.2.6", "rc-resize-observer": "^0.2.3", diff --git a/cvat-ui/package.json b/cvat-ui/package.json index 29ab177026cb..89f92544e4b7 100644 --- a/cvat-ui/package.json +++ b/cvat-ui/package.json @@ -68,6 +68,7 @@ "moment": "^2.29.1", "platform": "^1.3.6", "prop-types": "^15.7.2", + "rc-virtual-list": "^3.2.3", "react": "^16.14.0", "react-color": "^2.19.3", "react-cookie": "^4.0.3", From ecde564e3f60ed51e7184be70339a4b012918fec Mon Sep 17 00:00:00 2001 From: Boris Sekachev Date: Fri, 11 Dec 2020 15:28:40 +0300 Subject: [PATCH 2/6] Removed extra pagination parameters --- cvat-ui/src/components/projects-page/project-list.tsx | 1 + cvat-ui/src/components/tasks-page/task-list.tsx | 1 + 2 files changed, 2 insertions(+) diff --git a/cvat-ui/src/components/projects-page/project-list.tsx b/cvat-ui/src/components/projects-page/project-list.tsx index 5ff8b2ff19c0..1d7138902dac 100644 --- a/cvat-ui/src/components/projects-page/project-list.tsx +++ b/cvat-ui/src/components/projects-page/project-list.tsx @@ -58,6 +58,7 @@ export default function ProjectListComponent(): JSX.Element { Date: Fri, 11 Dec 2020 15:28:58 +0300 Subject: [PATCH 3/6] Fit canvas when collapsed --- .../attribute-annotation-sidebar.tsx | 16 ++++++----- .../objects-side-bar/objects-side-bar.tsx | 28 +++++++++---------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/cvat-ui/src/components/annotation-page/attribute-annotation-workspace/attribute-annotation-sidebar/attribute-annotation-sidebar.tsx b/cvat-ui/src/components/annotation-page/attribute-annotation-workspace/attribute-annotation-sidebar/attribute-annotation-sidebar.tsx index 8782eb18376c..10f0b5961c48 100644 --- a/cvat-ui/src/components/annotation-page/attribute-annotation-workspace/attribute-annotation-sidebar/attribute-annotation-sidebar.tsx +++ b/cvat-ui/src/components/annotation-page/attribute-annotation-workspace/attribute-annotation-sidebar/attribute-annotation-sidebar.tsx @@ -125,14 +125,16 @@ function AttributeAnnotationSidebar(props: StateToProps & DispatchToProps): JSX. const collapse = (): void => { const [collapser] = window.document.getElementsByClassName('attribute-annotation-sidebar'); + const listener = (event: TransitionEvent): void => { + if (event.target && event.propertyName === 'width' && event.target === collapser) { + canvasInstance.fitCanvas(); + canvasInstance.fit(); + (collapser as HTMLElement).removeEventListener('transitionend', listener as any); + } + }; + if (collapser) { - collapser.addEventListener( - 'transitionend', - () => { - canvasInstance.fitCanvas(); - }, - { once: true }, - ); + (collapser as HTMLElement).addEventListener('transitionend', listener as any); } setSidebarCollapsed(!sidebarCollapsed); diff --git a/cvat-ui/src/components/annotation-page/standard-workspace/objects-side-bar/objects-side-bar.tsx b/cvat-ui/src/components/annotation-page/standard-workspace/objects-side-bar/objects-side-bar.tsx index feaef8c523f3..c5288a9b7132 100644 --- a/cvat-ui/src/components/annotation-page/standard-workspace/objects-side-bar/objects-side-bar.tsx +++ b/cvat-ui/src/components/annotation-page/standard-workspace/objects-side-bar/objects-side-bar.tsx @@ -3,7 +3,7 @@ // SPDX-License-Identifier: MIT import './styles.scss'; -import React, { Dispatch, useEffect } from 'react'; +import React, { Dispatch, useEffect, TransitionEvent } from 'react'; import { AnyAction } from 'redux'; import { connect } from 'react-redux'; import { MenuFoldOutlined, MenuUnfoldOutlined } from '@ant-design/icons'; @@ -81,24 +81,22 @@ function ObjectsSideBar(props: StateToProps & DispatchToProps & OwnProps): JSX.E }; }, []); - useEffect(() => { - const listener = (event: Event): void => { - if ( - (event as TransitionEvent).propertyName === 'width' && - ((event.target as any).classList as DOMTokenList).contains('ant-tabs-tab-prev') - ) { + const collapse = (): void => { + const [collapser] = window.document.getElementsByClassName('cvat-objects-sidebar'); + const listener = (event: TransitionEvent): void => { + if (event.target && event.propertyName === 'width' && event.target === collapser) { + canvasInstance.fitCanvas(); canvasInstance.fit(); + (collapser as HTMLElement).removeEventListener('transitionend', listener as any); } }; - const [sidebar] = window.document.getElementsByClassName('cvat-objects-sidebar'); - - sidebar.addEventListener('transitionstart', listener); + if (collapser) { + (collapser as HTMLElement).addEventListener('transitionend', listener as any); + } - return () => { - sidebar.removeEventListener('transitionstart', listener); - }; - }, []); + collapseSidebar(); + }; return ( {sidebarCollapsed ? : } From a9d584e52c8d2da6d59b42c913c95d5caac4e9ff Mon Sep 17 00:00:00 2001 From: Boris Sekachev Date: Fri, 11 Dec 2020 15:30:36 +0300 Subject: [PATCH 4/6] Fixed task completion indicator --- cvat-ui/src/components/tasks-page/task-item.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cvat-ui/src/components/tasks-page/task-item.tsx b/cvat-ui/src/components/tasks-page/task-item.tsx index 250a66cc5514..32e455992764 100644 --- a/cvat-ui/src/components/tasks-page/task-item.tsx +++ b/cvat-ui/src/components/tasks-page/task-item.tsx @@ -116,7 +116,7 @@ class TaskItemComponent extends React.PureComponent - + Date: Fri, 11 Dec 2020 15:37:20 +0300 Subject: [PATCH 5/6] Added reviewer info to serialized copy --- cvat-ui/src/components/task-page/job-list.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cvat-ui/src/components/task-page/job-list.tsx b/cvat-ui/src/components/task-page/job-list.tsx index e9587fd420a5..fca29a40331d 100644 --- a/cvat-ui/src/components/task-page/job-list.tsx +++ b/cvat-ui/src/components/task-page/job-list.tsx @@ -243,8 +243,13 @@ function JobListComponent(props: Props & RouteComponentProps): JSX.Element { ); if (job.assignee) { - serialized += `\t assigned to: ${job.assignee.username}`; + serialized += `\t assigned to "${job.assignee.username}"`; } + + if (job.reviewer) { + serialized += `\t reviewed by "${job.reviewer.username}"`; + } + serialized += '\n'; } copy(serialized); From ea90c032aa83c8a2727a4ad6dc255fda67bf58bf Mon Sep 17 00:00:00 2001 From: Boris Sekachev Date: Fri, 11 Dec 2020 15:43:02 +0300 Subject: [PATCH 6/6] Updated version --- cvat-ui/package-lock.json | 2 +- cvat-ui/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cvat-ui/package-lock.json b/cvat-ui/package-lock.json index 73be24723315..0bd69313f3de 100644 --- a/cvat-ui/package-lock.json +++ b/cvat-ui/package-lock.json @@ -1,6 +1,6 @@ { "name": "cvat-ui", - "version": "1.13.0", + "version": "1.13.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/cvat-ui/package.json b/cvat-ui/package.json index 89f92544e4b7..f532bcc01a1a 100644 --- a/cvat-ui/package.json +++ b/cvat-ui/package.json @@ -1,6 +1,6 @@ { "name": "cvat-ui", - "version": "1.13.0", + "version": "1.13.1", "description": "CVAT single-page application", "main": "src/index.tsx", "scripts": {