Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved issues comments pipeline #6937

Merged
merged 7 commits into from
Oct 5, 2023
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- TDB
- The latest comment displayed in issues sidebar (<https://github.com/opencv/cvat/pull/6937>)

### Changed

Expand All @@ -25,7 +25,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

- TDB
- It was not possible to copy issue comment from issue dialog (<https://github.com/opencv/cvat/pull/6937>)

### Security

Expand Down
2 changes: 1 addition & 1 deletion cvat-canvas/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cvat-canvas",
"version": "2.17.5",
"version": "2.17.6",
"description": "Part of Computer Vision Annotation Tool which presents its canvas library",
"main": "src/canvas.ts",
"scripts": {
Expand Down
12 changes: 5 additions & 7 deletions cvat-canvas/src/typescript/canvasView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1258,13 +1258,11 @@ export class CanvasViewImpl implements CanvasView, Listener {
window.document.addEventListener('keydown', this.onShiftKeyDown);
window.document.addEventListener('keyup', this.onShiftKeyUp);

this.attachmentBoard.addEventListener('wheel', (event) => {
event.stopPropagation();
});

this.attachmentBoard.addEventListener('mousemove', (event) => {
event.stopPropagation();
});
for (const eventName of ['wheel', 'mousedown', 'dblclick', 'contextmenu']) {
this.attachmentBoard.addEventListener(eventName, (event) => {
event.stopPropagation();
});
}

this.canvas.addEventListener('wheel', (event): void => {
if (event.ctrlKey) return;
Expand Down
2 changes: 1 addition & 1 deletion cvat-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cvat-ui",
"version": "1.57.1",
"version": "1.57.2",
"description": "CVAT single-page application",
"main": "src/index.tsx",
"scripts": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import React, {
} from 'react';
import ReactDOM from 'react-dom';
import Tag from 'antd/lib/tag';
import { CheckCircleOutlined, CloseCircleOutlined, WarningOutlined } from '@ant-design/icons';
import { CheckCircleOutlined, CloseCircleOutlined } from '@ant-design/icons';

import { Issue } from 'cvat-core-wrapper';
import CVATTooltip from 'components/common/cvat-tooltip';
Expand Down Expand Up @@ -63,7 +63,7 @@ export default function HiddenIssueLabel(props: Props): ReactPortal {

const elementID = `cvat-hidden-issue-label-${id}`;
return ReactDOM.createPortal(
<CVATTooltip title={comments[0]?.message || 'Messages not found'}>
<CVATTooltip title={comments[0]?.message || 'No comments found'}>
<Tag
ref={ref}
id={elementID}
Expand All @@ -78,7 +78,7 @@ export default function HiddenIssueLabel(props: Props): ReactPortal {
) : (
<CloseCircleOutlined className='cvat-hidden-issue-unsolved-indicator' />
)}
{comments[0]?.message || <WarningOutlined />}
{comments[0]?.message || null}
</Tag>
</CVATTooltip>,
window.document.getElementById('cvat_canvas_attachment_board') as HTMLElement,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import Comment from 'antd/lib/comment';
import Text from 'antd/lib/typography/Text';
import Title from 'antd/lib/typography/Title';
import Button from 'antd/lib/button';
import Spin from 'antd/lib/spin';
import Input from 'antd/lib/input';
import moment from 'moment';
import CVATTooltip from 'components/common/cvat-tooltip';
Expand Down Expand Up @@ -148,7 +147,9 @@ export default function IssueDialog(props: Props): JSX.Element {
</Row>
<Row className='cvat-issue-dialog-chat' justify='start'>
{
lines.length > 0 ? <Col style={{ display: 'block' }}>{lines}</Col> : <Spin />
lines.length > 0 ? <Col style={{ display: 'block' }}>{lines}</Col> : (
<Col>No comments found</Col>
)
}
</Row>
<Row className='cvat-issue-dialog-input' justify='start'>
Expand Down
5 changes: 2 additions & 3 deletions cvat-ui/src/components/annotation-page/review/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// SPDX-License-Identifier: MIT

@import 'base.scss';
@import 'base';

.cvat-create-issue-dialog {
position: absolute;
Expand Down Expand Up @@ -72,7 +72,6 @@
transform-origin: top left;
box-shadow: $box-shadow-base;
border-radius: 0.5 * $grid-unit-size;
opacity: 0.95;

.cvat-issue-dialog-chat {
> div {
Expand All @@ -93,7 +92,7 @@
}
}

border-radius: 0.5 * $grid-unit-size;
user-select: all;
background: $background-color-1;
padding: $grid-unit-size;
max-height: $grid-unit-size * 45;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,45 +131,70 @@ export default function LabelsListComponent(): JSX.Element {
</div>
<div className='cvat-objects-sidebar-issues-list'>
{frameIssues.map(
(frameIssue: any): JSX.Element => (
<div
key={frameIssue.id}
id={`cvat-objects-sidebar-issue-item-${frameIssue.id}`}
className={
`cvat-objects-sidebar-issue-item ${frameIssue.resolved ? 'cvat-objects-sidebar-issue-resolved' : ''}`
}
onMouseEnter={() => {
const element = window.document.getElementById(
`cvat_canvas_issue_region_${frameIssue.id}`,
);
if (element) {
element.setAttribute('fill', 'url(#cvat_issue_region_pattern_2)');
}
dispatch(activateObject(null, null, null));
}}
onMouseLeave={() => {
const element = window.document.getElementById(
`cvat_canvas_issue_region_${frameIssue.id}`,
);
if (element) {
element.setAttribute('fill', 'url(#cvat_issue_region_pattern_1)');
(frameIssue: any): JSX.Element => {
bsekachev marked this conversation as resolved.
Show resolved Hide resolved
const firstComment = frameIssue.comments[0];
const lastComment = frameIssue.comments.slice(-1)[0];
return (
<div
key={frameIssue.id}
id={`cvat-objects-sidebar-issue-item-${frameIssue.id}`}
className={
`cvat-objects-sidebar-issue-item ${frameIssue.resolved ? 'cvat-objects-sidebar-issue-resolved' : ''}`
}
}}
>
<Row>
<Text strong>{`#${frameIssue.id} • Issue`}</Text>
</Row>
<Row>
<Paragraph ellipsis={{ rows: 2 }}>
{frameIssue.comments[0]?.message ? frameIssue.comments[0]?.message : ''}
</Paragraph>
<Text />
</Row>
<Row>
<Text>{moment(frameIssue.createdDate).fromNow()}</Text>
</Row>
</div>
),
onMouseEnter={() => {
const element = window.document.getElementById(
`cvat_canvas_issue_region_${frameIssue.id}`,
);
if (element) {
element.setAttribute('fill', 'url(#cvat_issue_region_pattern_2)');
}
dispatch(activateObject(null, null, null));
}}
onMouseLeave={() => {
const element = window.document.getElementById(
`cvat_canvas_issue_region_${frameIssue.id}`,
);
if (element) {
element.setAttribute('fill', 'url(#cvat_issue_region_pattern_1)');
}
}}
>
<Row justify='space-between'>
<Col>
<Text strong>
{`#${frameIssue.id} • Issue`}
</Text>
</Col>
<Col offset={1}>
<Text type='secondary'>
{`created ${moment(frameIssue.createdDate).fromNow()}`}
</Text>
</Col>
</Row>
<Row>
<Paragraph ellipsis={{ rows: 2 }}>
<Text strong>{`${firstComment?.owner?.username || ''} `}</Text>
<Text>{firstComment?.message || ''}</Text>
</Paragraph>
</Row>
{ lastComment !== firstComment && (
<>
<Row justify='start'>
<Col>
<Text strong>&#8230;</Text>
</Col>
</Row>
<Row>
<Paragraph ellipsis={{ rows: 2 }}>
<Text strong>{`${lastComment?.owner?.username || ''} `}</Text>
<Text>{lastComment?.message || ''}</Text>
</Paragraph>
</Row>
</>
)}
</div>
);
},
)}
{showGroundTruth && frameConflicts.map(
(frameConflict: QualityConflict): JSX.Element => (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//
// SPDX-License-Identifier: MIT

@import 'base.scss';
@import 'base';

.cvat-objects-appearance-collapse.ant-collapse {
width: 100%;
Expand Down Expand Up @@ -123,6 +123,12 @@
padding: $grid-unit-size $grid-unit-size $grid-unit-size $grid-unit-size * 8;
}

> .ant-row {
.ant-typography {
margin-bottom: 0;
}
}

p {
margin-bottom: 0;
}
Expand Down Expand Up @@ -217,7 +223,7 @@

.cvat-objects-sidebar-state-item {
width: 100%;
padding: 5px 3px 3px 3px;
padding: 5px 3px 3px;
opacity: 1;

> div:nth-child(1) {
Expand Down Expand Up @@ -297,7 +303,7 @@

.cvat-object-item-radio-attribute {
border: 1px double $border-color-hover;
border-radius: 7px 7px 7px 7px;
border-radius: 7px;

> legend {
text-align: center;
Expand All @@ -316,7 +322,7 @@

> .ant-radio-group {
display: grid;
padding: 1px 5px 1px 5px;
padding: 1px 5px;
}
}

Expand All @@ -337,7 +343,7 @@
.cvat-objects-sidebar-label-item {
height: 2.5em;
border-bottom: 1px solid $border-color-1;
padding: 5px 3px 3px 3px;
padding: 5px 3px 3px;

span {
@extend .cvat-object-sidebar-icon;
Expand Down Expand Up @@ -469,10 +475,6 @@
padding: $grid-unit-size * 0.5;
border: 1px solid $object-item-border-color;
border-bottom: 0;
padding-top: 1px;
padding-left: 1px;
padding-right: 1px;
padding-bottom: 2px;

&:last-child {
border-bottom: 1px solid $object-item-border-color;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -488,8 +488,7 @@ class ObjectsListContainer extends React.PureComponent<Props, State> {
updateAnnotations([state]);
}
},
COPY_SHAPE: (event: KeyboardEvent | undefined) => {
preventDefault(event);
COPY_SHAPE: () => {
const state = activatedState();
if (state && !readonly) {
copyShape(state);
Expand Down