未验证 提交 667a3f92 编写于 作者: D Dmitry Kalinin 提交者: GitHub

CVAT UI: batch of fixes (#1955)

上级 7679434b
......@@ -36,6 +36,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- No mapping between side object element and context menu in some attributes (<https://github.com/opencv/cvat/pull/1923>)
- Interpolated shapes exported as `keyframe = True` (<https://github.com/opencv/cvat/pull/1937>)
- Stylelint filetype scans (<https://github.com/opencv/cvat/pull/1952>)
- Fixed toolip closing issue (<https://github.com/opencv/cvat/pull/1955>)
### Security
-
......
{
"name": "cvat-ui",
"version": "1.6.4",
"version": "1.6.5",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
{
"name": "cvat-ui",
"version": "1.6.4",
"version": "1.6.5",
"description": "CVAT single-page application",
"main": "src/index.tsx",
"scripts": {
......
......@@ -147,7 +147,7 @@ function AnnotationsFiltersInput(props: StateToProps & DispatchToProps): JSX.Ele
placeholder={
underCursor ? (
<>
<Tooltip title='Click to open help'>
<Tooltip title='Click to open help' mouseLeaveDelay={0}>
<Icon
type='filter'
onClick={(e: React.MouseEvent) => {
......
......@@ -28,16 +28,16 @@ function AttributeSwitcher(props: Props): JSX.Element {
const title = `${currentAttribute} [${currentIndex + 1}/${attributesCount}]`;
return (
<div className='attribute-annotation-sidebar-switcher'>
<Tooltip title={`Previous attribute ${normalizedKeyMap.PREVIOUS_ATTRIBUTE}`}>
<Tooltip title={`Previous attribute ${normalizedKeyMap.PREVIOUS_ATTRIBUTE}`} mouseLeaveDelay={0}>
<Button disabled={attributesCount <= 1} onClick={() => nextAttribute(-1)}>
<Icon type='left' />
</Button>
</Tooltip>
<Tooltip title={title}>
<Tooltip title={title} mouseLeaveDelay={0}>
<Text className='cvat-text'>{currentAttribute}</Text>
<Text strong>{` [${currentIndex + 1}/${attributesCount}]`}</Text>
</Tooltip>
<Tooltip title={`Next attribute ${normalizedKeyMap.NEXT_ATTRIBUTE}`}>
<Tooltip title={`Next attribute ${normalizedKeyMap.NEXT_ATTRIBUTE}`} mouseLeaveDelay={0}>
<Button disabled={attributesCount <= 1} onClick={() => nextAttribute(1)}>
<Icon type='right' />
</Button>
......
......@@ -32,17 +32,17 @@ function ObjectSwitcher(props: Props): JSX.Element {
const title = `${currentLabel} ${clientID} [${currentIndex + 1}/${objectsCount}]`;
return (
<div className='attribute-annotation-sidebar-switcher'>
<Tooltip title={`Previous object ${normalizedKeyMap.PREVIOUS_OBJECT}`}>
<Tooltip title={`Previous object ${normalizedKeyMap.PREVIOUS_OBJECT}`} mouseLeaveDelay={0}>
<Button disabled={objectsCount <= 1} onClick={() => nextObject(-1)}>
<Icon type='left' />
</Button>
</Tooltip>
<Tooltip title={title}>
<Tooltip title={title} mouseLeaveDelay={0}>
<Text className='cvat-text'>{currentLabel}</Text>
<Text className='cvat-text'>{` ${clientID} `}</Text>
<Text strong>{`[${currentIndex + 1}/${objectsCount}]`}</Text>
</Tooltip>
<Tooltip title={`Next object ${normalizedKeyMap.NEXT_OBJECT}`}>
<Tooltip title={`Next object ${normalizedKeyMap.NEXT_OBJECT}`} mouseLeaveDelay={0}>
<Button disabled={objectsCount <= 1} onClick={() => nextObject(1)}>
<Icon type='right' />
</Button>
......
......@@ -111,7 +111,7 @@ function CanvasPointContextMenu(props: Props): React.ReactPortal | null {
return visible && contextMenuFor && type === ContextMenuType.CANVAS_SHAPE_POINT
? (ReactDOM.createPortal(
<div className='cvat-canvas-point-context-menu' style={{ top, left }}>
<Tooltip title='Delete point [Ctrl + dblclick]'>
<Tooltip title='Delete point [Ctrl + dblclick]' mouseLeaveDelay={0}>
<Button type='link' icon='delete' onClick={onPointDelete}>
Delete point
</Button>
......
......@@ -876,7 +876,7 @@ export default class CanvasWrapperComponent extends React.PureComponent<Props> {
defaultValue={0}
onChange={(value: SliderValue): void => onSwitchZLayer(value as number)}
/>
<Tooltip title={`Add new layer ${maxZLayer + 1} and switch to it`}>
<Tooltip title={`Add new layer ${maxZLayer + 1} and switch to it`} mouseLeaveDelay={0}>
<Icon type='plus-circle' onClick={onAddZLayer} />
</Tooltip>
</div>
......
......@@ -24,7 +24,7 @@ function CursorControl(props: Props): JSX.Element {
} = props;
return (
<Tooltip title={`Cursor ${cursorShortkey}`} placement='right'>
<Tooltip title={`Cursor ${cursorShortkey}`} placement='right' mouseLeaveDelay={0}>
<Icon
component={CursorIcon}
className={activeControl === ActiveControl.CURSOR
......
......@@ -62,7 +62,7 @@ function DEXTRPlugin(props: StateToProps & DispatchToProps): JSX.Element | null
return (
pluginEnabled ? (
<Tooltip title='Make AI polygon from at least 4 extreme points using deep extreme cut'>
<Tooltip title='Make AI polygon from at least 4 extreme points using deep extreme cut' mouseLeaveDelay={0}>
<Checkbox
style={{ marginTop: 5 }}
checked={pluginActivated}
......
......@@ -186,14 +186,14 @@ function DrawShapePopoverComponent(props: Props): JSX.Element {
}
<Row type='flex' justify='space-around'>
<Col span={12}>
<Tooltip title={`Press ${repeatShapeShortcut} to draw again`}>
<Tooltip title={`Press ${repeatShapeShortcut} to draw again`} mouseLeaveDelay={0}>
<Button onClick={onDrawShape}>
Shape
</Button>
</Tooltip>
</Col>
<Col span={12}>
<Tooltip title={`Press ${repeatShapeShortcut} to draw again`}>
<Tooltip title={`Press ${repeatShapeShortcut} to draw again`} mouseLeaveDelay={0}>
<Button onClick={onDrawTrack}>
Track
</Button>
......
......@@ -19,7 +19,7 @@ function FitControl(props: Props): JSX.Element {
} = props;
return (
<Tooltip title='Fit the image [Double Click]' placement='right'>
<Tooltip title='Fit the image [Double Click]' placement='right' mouseLeaveDelay={0}>
<Icon component={FitIcon} onClick={(): void => canvasInstance.fit()} />
</Tooltip>
);
......
......@@ -45,7 +45,7 @@ function GroupControl(props: Props): JSX.Element {
const title = `Group shapes/tracks ${switchGroupShortcut}.`
+ ` Select and press ${resetGroupShortcut} to reset a group`;
return (
<Tooltip title={title} placement='right'>
<Tooltip title={title} placement='right' mouseLeaveDelay={0}>
<Icon {...dynamicIconProps} component={GroupIcon} />
</Tooltip>
);
......
......@@ -41,7 +41,7 @@ function MergeControl(props: Props): JSX.Element {
};
return (
<Tooltip title={`Merge shapes/tracks ${switchMergeShortcut}`} placement='right'>
<Tooltip title={`Merge shapes/tracks ${switchMergeShortcut}`} placement='right' mouseLeaveDelay={0}>
<Icon {...dynamicIconProps} component={MergeIcon} />
</Tooltip>
);
......
......@@ -19,7 +19,7 @@ function MoveControl(props: Props): JSX.Element {
const { canvasInstance, activeControl } = props;
return (
<Tooltip title='Move the image' placement='right'>
<Tooltip title='Move the image' placement='right' mouseLeaveDelay={0}>
<Icon
component={MoveIcon}
className={activeControl === ActiveControl.DRAG_CANVAS
......
......@@ -22,7 +22,7 @@ function ResizeControl(props: Props): JSX.Element {
} = props;
return (
<Tooltip title='Select a region of interest' placement='right'>
<Tooltip title='Select a region of interest' placement='right' mouseLeaveDelay={0}>
<Icon
component={ZoomIcon}
className={activeControl === ActiveControl.ZOOM_CANVAS
......
......@@ -29,14 +29,14 @@ function RotateControl(props: Props): JSX.Element {
placement='right'
content={(
<>
<Tooltip title={`Rotate the image anticlockwise ${anticlockwiseShortcut}`} placement='topRight'>
<Tooltip title={`Rotate the image anticlockwise ${anticlockwiseShortcut}`} placement='topRight' mouseLeaveDelay={0}>
<Icon
className='cvat-rotate-canvas-controls-left'
onClick={(): void => rotateFrame(Rotation.ANTICLOCKWISE90)}
component={RotateIcon}
/>
</Tooltip>
<Tooltip title={`Rotate the image clockwise ${clockwiseShortcut}`} placement='topRight'>
<Tooltip title={`Rotate the image clockwise ${clockwiseShortcut}`} placement='topRight' mouseLeaveDelay={0}>
<Icon
className='cvat-rotate-canvas-controls-right'
onClick={(): void => rotateFrame(Rotation.CLOCKWISE90)}
......
......@@ -61,7 +61,7 @@ function SetupTagPopover(props: Props): JSX.Element {
</Row>
<Row type='flex' justify='space-around'>
<Col span={24}>
<Tooltip title={`Press ${repeatShapeShortcut} to add a tag again`}>
<Tooltip title={`Press ${repeatShapeShortcut} to add a tag again`} mouseLeaveDelay={0}>
<Button onClick={() => onSetup(selectedLabeID)}>
Tag
</Button>
......
......@@ -41,7 +41,7 @@ function SplitControl(props: Props): JSX.Element {
};
return (
<Tooltip title={`Split a track ${switchSplitShortcut}`} placement='right'>
<Tooltip title={`Split a track ${switchSplitShortcut}`} placement='right' mouseLeaveDelay={0}>
<Icon {...dynamicIconProps} component={SplitIcon} />
</Tooltip>
);
......
......@@ -74,7 +74,7 @@ function ItemTopComponent(props: Props): JSX.Element {
<Text type='secondary' style={{ fontSize: 10 }}>{type}</Text>
</Col>
<Col span={12}>
<Tooltip title='Change current label'>
<Tooltip title='Change current label' mouseLeaveDelay={0}>
<Select
size='small'
value={`${labelID}`}
......
......@@ -113,7 +113,7 @@ function ItemButtonsComponent(props: Props): JSX.Element {
<Col>
{ navigatePrevKeyframe
? (
<Tooltip title={`Go to previous keyframe ${prevKeyFrameShortcut}`}>
<Tooltip title={`Go to previous keyframe ${prevKeyFrameShortcut}`} mouseLeaveDelay={0}>
<Icon
component={PreviousIcon}
onClick={navigatePrevKeyframe}
......@@ -125,7 +125,7 @@ function ItemButtonsComponent(props: Props): JSX.Element {
<Col>
{ navigateNextKeyframe
? (
<Tooltip title={`Go to next keyframe ${nextKeyFrameShortcut}`}>
<Tooltip title={`Go to next keyframe ${nextKeyFrameShortcut}`} mouseLeaveDelay={0}>
<Icon
component={NextIcon}
onClick={navigateNextKeyframe}
......@@ -142,7 +142,7 @@ function ItemButtonsComponent(props: Props): JSX.Element {
</Row>
<Row type='flex' justify='space-around'>
<Col>
<Tooltip title={`Switch outside property ${switchOutsideShortcut}`}>
<Tooltip title={`Switch outside property ${switchOutsideShortcut}`} mouseLeaveDelay={0}>
{ outside
? (
<Icon
......@@ -155,28 +155,28 @@ function ItemButtonsComponent(props: Props): JSX.Element {
</Tooltip>
</Col>
<Col>
<Tooltip title={`Switch lock property ${switchLockShortcut}`}>
<Tooltip title={`Switch lock property ${switchLockShortcut}`} mouseLeaveDelay={0}>
{ locked
? <Icon type='lock' theme='filled' onClick={unlock} />
: <Icon type='unlock' onClick={lock} />}
</Tooltip>
</Col>
<Col>
<Tooltip title={`Switch occluded property ${switchOccludedShortcut}`}>
<Tooltip title={`Switch occluded property ${switchOccludedShortcut}`} mouseLeaveDelay={0}>
{ occluded
? <Icon type='team' onClick={unsetOccluded} />
: <Icon type='user' onClick={setOccluded} />}
</Tooltip>
</Col>
<Col>
<Tooltip title={`Switch hidden property ${switchHiddenShortcut}`}>
<Tooltip title={`Switch hidden property ${switchHiddenShortcut}`} mouseLeaveDelay={0}>
{ hidden
? <Icon type='eye-invisible' theme='filled' onClick={show} style={hiddenStyle} />
: <Icon type='eye' onClick={hide} style={hiddenStyle} />}
</Tooltip>
</Col>
<Col>
<Tooltip title={`Switch keyframe property ${switchKeyFrameShortcut}`}>
<Tooltip title={`Switch keyframe property ${switchKeyFrameShortcut}`} mouseLeaveDelay={0}>
{ keyframe
? <Icon type='star' theme='filled' onClick={unsetKeyframe} style={keyframeStyle} />
: <Icon type='star' onClick={setKeyframe} style={keyframeStyle} />}
......@@ -185,7 +185,7 @@ function ItemButtonsComponent(props: Props): JSX.Element {
{
shapeType !== ShapeType.POINTS && (
<Col>
<Tooltip title='Switch pinned property'>
<Tooltip title='Switch pinned property' mouseLeaveDelay={0}>
{ pinned
? <Icon type='pushpin' theme='filled' onClick={unpin} />
: <Icon type='pushpin' onClick={pin} />}
......@@ -205,7 +205,7 @@ function ItemButtonsComponent(props: Props): JSX.Element {
<Col span={20} style={{ textAlign: 'center' }}>
<Row type='flex' justify='space-around'>
<Col>
<Tooltip title={`Switch lock property ${switchLockShortcut}`}>
<Tooltip title={`Switch lock property ${switchLockShortcut}`} mouseLeaveDelay={0}>
{ locked
? <Icon type='lock' onClick={unlock} theme='filled' />
: <Icon type='unlock' onClick={lock} />}
......@@ -222,21 +222,21 @@ function ItemButtonsComponent(props: Props): JSX.Element {
<Col span={20} style={{ textAlign: 'center' }}>
<Row type='flex' justify='space-around'>
<Col>
<Tooltip title={`Switch lock property ${switchLockShortcut}`}>
<Tooltip title={`Switch lock property ${switchLockShortcut}`} mouseLeaveDelay={0}>
{ locked
? <Icon type='lock' onClick={unlock} theme='filled' />
: <Icon type='unlock' onClick={lock} />}
</Tooltip>
</Col>
<Col>
<Tooltip title={`Switch occluded property ${switchOccludedShortcut}`}>
<Tooltip title={`Switch occluded property ${switchOccludedShortcut}`} mouseLeaveDelay={0}>
{ occluded
? <Icon type='team' onClick={unsetOccluded} />
: <Icon type='user' onClick={setOccluded} />}
</Tooltip>
</Col>
<Col>
<Tooltip title={`Switch hidden property ${switchHiddenShortcut}`}>
<Tooltip title={`Switch hidden property ${switchHiddenShortcut}`} mouseLeaveDelay={0}>
{ hidden
? <Icon type='eye-invisible' onClick={show} />
: <Icon type='eye' onClick={hide} />}
......@@ -245,7 +245,7 @@ function ItemButtonsComponent(props: Props): JSX.Element {
{
shapeType !== ShapeType.POINTS && (
<Col>
<Tooltip title='Switch pinned property'>
<Tooltip title='Switch pinned property' mouseLeaveDelay={0}>
{ pinned
? <Icon type='pushpin' theme='filled' onClick={unpin} />
: <Icon type='pushpin' onClick={pin} />}
......
......@@ -63,14 +63,14 @@ export default function ItemMenu(props: Props): JSX.Element {
</Button>
</Menu.Item>
<Menu.Item>
<Tooltip title={`${copyShortcut} and ${pasteShortcut}`}>
<Tooltip title={`${copyShortcut} and ${pasteShortcut}`} mouseLeaveDelay={0}>
<Button type='link' icon='copy' onClick={copy}>
Make a copy
</Button>
</Tooltip>
</Menu.Item>
<Menu.Item>
<Tooltip title={`${propagateShortcut}`}>
<Tooltip title={`${propagateShortcut}`} mouseLeaveDelay={0}>
<Button type='link' icon='block' onClick={propagate}>
Propagate
</Button>
......@@ -93,7 +93,7 @@ export default function ItemMenu(props: Props): JSX.Element {
)}
{objectType !== ObjectType.TAG && (
<Menu.Item>
<Tooltip title={`${toBackgroundShortcut}`}>
<Tooltip title={`${toBackgroundShortcut}`} mouseLeaveDelay={0}>
<Button type='link' onClick={toBackground}>
<Icon component={BackgroundIcon} />
To background
......@@ -103,7 +103,7 @@ export default function ItemMenu(props: Props): JSX.Element {
)}
{objectType !== ObjectType.TAG && (
<Menu.Item>
<Tooltip title={`${toForegroundShortcut}`}>
<Tooltip title={`${toForegroundShortcut}`} mouseLeaveDelay={0}>
<Button type='link' onClick={toForeground}>
<Icon component={ForegroundIcon} />
To foreground
......@@ -112,7 +112,7 @@ export default function ItemMenu(props: Props): JSX.Element {
</Menu.Item>
)}
<Menu.Item>
<Tooltip title={`${removeShortcut}`}>
<Tooltip title={`${removeShortcut}`} mouseLeaveDelay={0}>
<Button
type='link'
icon='delete'
......
......@@ -95,21 +95,21 @@ function ObjectListHeader(props: Props): JSX.Element {
</Row>
<Row type='flex' justify='space-between' align='middle'>
<Col span={2}>
<Tooltip title={`Switch lock property for all ${switchLockAllShortcut}`}>
<Tooltip title={`Switch lock property for all ${switchLockAllShortcut}`} mouseLeaveDelay={0}>
{ statesLocked
? <Icon type='lock' onClick={unlockAllStates} theme='filled' />
: <Icon type='unlock' onClick={lockAllStates} />}
</Tooltip>
</Col>
<Col span={2}>
<Tooltip title={`Switch hidden property for all ${switchHiddenAllShortcut}`}>
<Tooltip title={`Switch hidden property for all ${switchHiddenAllShortcut}`} mouseLeaveDelay={0}>
{ statesHidden
? <Icon type='eye-invisible' onClick={showAllStates} />
: <Icon type='eye' onClick={hideAllStates} />}
</Tooltip>
</Col>
<Col span={2}>
<Tooltip title='Expand/collapse all'>
<Tooltip title='Expand/collapse all' mouseLeaveDelay={0}>
{ statesCollapsed
? <Icon type='caret-down' onClick={expandAllStates} />
: <Icon type='caret-up' onClick={collapseAllStates} />}
......
......@@ -2,7 +2,7 @@
//
// SPDX-License-Identifier: MIT
import React, { useState, useEffect, Fragment } from 'react';
import React, { useState, useEffect } from 'react';
import { useSelector } from 'react-redux';
import { GlobalHotKeys, KeyMap } from 'react-hotkeys';
import { Row, Col } from 'antd/lib/grid';
......@@ -86,38 +86,41 @@ const ShortcutsSelect = (props: Props): JSX.Element => {
<Text strong>Shortcuts for labels:</Text>
</Col>
</Row>
{shift(Object.keys(shortcutLabelMap), 1).slice(0, Math.min(labels.length, 10)).map((id) => (
<Row key={id}>
<Col>
<Text strong>{`Key ${id}:`}</Text>
<Select
value={`${shortcutLabelMap[Number.parseInt(id, 10)]}`}
onChange={(value: string) => {
onChangeShortcutLabel(value, Number.parseInt(id, 10));
}}
size='default'
style={{ width: 200 }}
className='cvat-tag-annotation-label-select'
>
<Select.Option value=''>
<Text type='secondary'>
None
</Text>
</Select.Option>
{
(labels as any[]).map((label: any) => (
<Select.Option
key={label.id}
value={`${label.id}`}
>
{label.name}
{
shift(Object.keys(shortcutLabelMap), 1).slice(0, Math.min(labels.length, 10))
.map((id) => (
<Row key={id}>
<Col>
<Text strong>{`Key ${id}:`}</Text>
<Select
value={`${shortcutLabelMap[Number.parseInt(id, 10)]}`}
onChange={(value: string) => {
onChangeShortcutLabel(value, Number.parseInt(id, 10));
}}
size='default'
style={{ width: 200 }}
className='cvat-tag-annotation-label-select'
>
<Select.Option value=''>
<Text type='secondary'>
None
</Text>
</Select.Option>
))
}
</Select>
</Col>
</Row>
))}
{
(labels as any[]).map((label: any) => (
<Select.Option
key={label.id}
value={`${label.id}`}
>
{label.name}
</Select.Option>
))
}
</Select>
</Col>
</Row>
))
}
</div>
);
};
......
......@@ -54,19 +54,19 @@ function PlayerButtons(props: Props): JSX.Element {
return (
<Col className='cvat-player-buttons'>
<Tooltip title='Go to the first frame'>
<Tooltip title='Go to the first frame' mouseLeaveDelay={0}>
<Icon component={FirstIcon} onClick={onFirstFrame} />
</Tooltip>
<Tooltip title={`Go back with a step ${backwardShortcut}`}>
<Tooltip title={`Go back with a step ${backwardShortcut}`} mouseLeaveDelay={0}>
<Icon component={BackJumpIcon} onClick={onBackward} />
</Tooltip>
<Tooltip title={`Go back ${previousFrameShortcut}`}>
<Tooltip title={`Go back ${previousFrameShortcut}`} mouseLeaveDelay={0}>
<Icon component={PreviousIcon} onClick={onPrevFrame} />
</Tooltip>
{!playing
? (
<Tooltip title={`Play ${playPauseShortcut}`}>
<Tooltip title={`Play ${playPauseShortcut}`} mouseLeaveDelay={0}>
<Icon
component={PlayIcon}
onClick={onSwitchPlay}
......@@ -74,7 +74,7 @@ function PlayerButtons(props: Props): JSX.Element {
</Tooltip>
)
: (
<Tooltip title={`Pause ${playPauseShortcut}`}>
<Tooltip title={`Pause ${playPauseShortcut}`} mouseLeaveDelay={0}>
<Icon
component={PauseIcon}
onClick={onSwitchPlay}
......@@ -82,13 +82,13 @@ function PlayerButtons(props: Props): JSX.Element {
</Tooltip>
)}
<Tooltip title={`Go next ${nextFrameShortcut}`}>
<Tooltip title={`Go next ${nextFrameShortcut}`} mouseLeaveDelay={0}>
<Icon component={NextIcon} onClick={onNextFrame} />
</Tooltip>
<Tooltip title={`Go next with a step ${forwardShortcut}`}>
<Tooltip title={`Go next with a step ${forwardShortcut}`} mouseLeaveDelay={0}>
<Icon component={ForwardJumpIcon} onClick={onForward} />
</Tooltip>
<Tooltip title='Go to the last frame'>
<Tooltip title='Go to the last frame' mouseLeaveDelay={0}>
<Icon component={LastIcon} onClick={onLastFrame} />
</Tooltip>
</Col>
......
......@@ -62,19 +62,19 @@ function PlayerNavigation(props: Props): JSX.Element {
</Row>
<Row type='flex' justify='center'>
<Col className='cvat-player-filename-wrapper'>
<Tooltip title={frameFilename}>
<Tooltip title={frameFilename} mouseLeaveDelay={0}>
<Text type='secondary'>{frameFilename}</Text>
</Tooltip>
</Col>
<Col offset={1}>
<Tooltip title='Create frame URL'>
<Tooltip title='Create frame URL' mouseLeaveDelay={0}>
<Icon className='cvat-player-frame-url-icon' type='link' onClick={onURLIconClick} />
</Tooltip>
</Col>
</Row>
</Col>
<Col>
<Tooltip title={`Press ${focusFrameInputShortcut} to focus here`}>
<Tooltip title={`Press ${focusFrameInputShortcut} to focus here`} mouseLeaveDelay={0}>
<InputNumber
className='cvat-player-frame-selector'
type='number'
......
......@@ -41,7 +41,7 @@ function InputModal(props: InputModalProps): JSX.Element {
>
<Row type='flex'>
<Col span={10}>
<Tooltip title='Similarity of objects on neighbour frames is calculated using AI model'>
<Tooltip title='Similarity of objects on neighbour frames is calculated using AI model' mouseLeaveDelay={0}>
<Text>Similarity threshold: </Text>
</Tooltip>
</Col>
......@@ -62,7 +62,7 @@ function InputModal(props: InputModalProps): JSX.Element {
</Row>
<Row type='flex'>
<Col span={10}>
<Tooltip title='The value defines max distance to merge (between centers of two objects on neighbour frames)'>
<Tooltip title='The value defines max distance to merge (between centers of two objects on neighbour frames)' mouseLeaveDelay={0}>
<Text>Max pixel distance: </Text>
</Tooltip>
</Col>
......@@ -189,6 +189,8 @@ function ReIDPlugin(props: StateToProps & DispatchToProps): JSX.Element {
});
await jobInstance.annotations.clear();
updateAnnotations(); // one more call to do not confuse canvas
// False positive of no-unsanitized/method
// eslint-disable-next-line no-unsanitized/method
await jobInstance.annotations.import(merged);
updateAnnotations();
} catch (error) {
......
......@@ -49,7 +49,7 @@ function RightGroup(props: Props): JSX.Element {
value={workspace}
>
{Object.values(Workspace).map((ws) => (
<Select.Option key={ws} value={ws} >
<Select.Option key={ws} value={ws}>
{ws}
</Select.Option>
))}
......
......@@ -89,7 +89,7 @@ export default function StatisticsModalComponent(props: Props): JSX.Element {
});
const makeShapesTracksTitle = (title: string): JSX.Element => (
<Tooltip title='Shapes / Tracks'>
<Tooltip title='Shapes / Tracks' mouseLeaveDelay={0}>
<Text strong style={{ marginRight: 5 }}>{title}</Text>
<Icon className='cvat-info-circle-icon' type='question-circle' />
</Tooltip>
......
......@@ -18,8 +18,8 @@ import ConnectedFileManager, {
} from 'containers/file-manager/file-manager';
import { ModelFiles } from 'reducers/interfaces';
import CreateModelForm, {
CreateModelForm as WrappedCreateModelForm,
import WrappedCreateModelForm, {
CreateModelForm,
} from './create-model-form';
interface Props {
......@@ -29,12 +29,12 @@ interface Props {
}
export default class CreateModelContent extends React.PureComponent<Props> {
private modelForm: WrappedCreateModelForm;
private modelForm: CreateModelForm;
private fileManagerContainer: FileManagerContainer;
public constructor(props: Props) {
super(props);
this.modelForm = null as any as WrappedCreateModelForm;
this.modelForm = null as any as CreateModelForm;
this.fileManagerContainer = null as any as FileManagerContainer;
}
......@@ -107,7 +107,7 @@ export default class CreateModelContent extends React.PureComponent<Props> {
return (
<Row type='flex' justify='start' align='middle' className='cvat-create-model-content'>
<Col span={24}>
<Tooltip title='Click to open guide'>
<Tooltip title='Click to open guide' mouseLeaveDelay={0}>
<Icon
onClick={(): void => {
// false positive
......@@ -119,9 +119,9 @@ export default class CreateModelContent extends React.PureComponent<Props> {
</Tooltip>
</Col>
<Col span={24}>
<CreateModelForm
<WrappedCreateModelForm
wrappedComponentRef={
(ref: WrappedCreateModelForm): void => {
(ref: CreateModelForm): void => {
this.modelForm = ref;
}
}
......
......@@ -57,7 +57,7 @@ export class CreateModelForm extends React.PureComponent<Props> {
</Col>
<Col span={8} offset={2}>
<Form.Item>
<Tooltip title='Will this model be availabe for everyone?'>
<Tooltip title='Will this model be availabe for everyone?' mouseLeaveDelay={0}>
{ getFieldDecorator('global', {
initialValue: false,
valuePropName: 'checked',
......
......@@ -142,7 +142,7 @@ class AdvancedConfigurationForm extends React.PureComponent<Props> {
return (
<Form.Item label={<span>Image quality</span>}>
<Tooltip title='Defines image quality level'>
<Tooltip title='Defines image quality level' mouseLeaveDelay={0}>
{form.getFieldDecorator('imageQuality', {
initialValue: 70,
rules: [{
......@@ -168,7 +168,7 @@ class AdvancedConfigurationForm extends React.PureComponent<Props> {
return (
<Form.Item label={<span>Overlap size</span>}>
<Tooltip title='Defines a number of intersected frames between different segments'>
<Tooltip title='Defines a number of intersected frames between different segments' mouseLeaveDelay={0}>
{form.getFieldDecorator('overlapSize', {
rules: [{
validator: isNonNegativeInteger,
......@@ -186,7 +186,7 @@ class AdvancedConfigurationForm extends React.PureComponent<Props> {
return (
<Form.Item label={<span>Segment size</span>}>
<Tooltip title='Defines a number of frames in a segment'>
<Tooltip title='Defines a number of frames in a segment' mouseLeaveDelay={0}>
{form.getFieldDecorator('segmentSize', {
rules: [{
validator: isPositiveInteger,
......@@ -403,6 +403,7 @@ class AdvancedConfigurationForm extends React.PureComponent<Props> {
More: 1 - 4
</>
)}
mouseLeaveDelay={0}
>
{form.getFieldDecorator('dataChunkSize', {
rules: [{
......
......@@ -10,7 +10,7 @@ import Collapse from 'antd/lib/collapse';
import notification from 'antd/lib/notification';
import Text from 'antd/lib/typography/Text';
import FileManagerContainer from 'containers/file-manager/file-manager';
import ConnectedFileManager from 'containers/file-manager/file-manager';
import BasicConfigurationForm, { BaseConfiguration } from './basic-configuration-form';
import AdvancedConfigurationForm, { AdvancedConfiguration } from './advanced-configuration-form';
import LabelsEditor from '../labels-editor/labels-editor';
......@@ -184,7 +184,7 @@ export default class CreateTaskContent extends React.PureComponent<Props, State>
<Col span={24}>
<Text type='danger'>* </Text>
<Text className='cvat-text-color'>Select files:</Text>
<FileManagerContainer
<ConnectedFileManager
ref={
(container: any): void => { this.fileManagerContainer = container; }
}
......
......@@ -189,6 +189,7 @@ class CVATApplication extends React.PureComponent<CVATAppProps & RouteComponentP
description: error.length > 200 ? 'Open the Browser Console to get details' : error,
});
// eslint-disable-next-line no-console
console.error(error);
}
......
......@@ -153,7 +153,7 @@ class GlobalErrorBoundary extends React.PureComponent<Props, State> {
</Paragraph>
<ul>
<li>
<Tooltip title='Copied!' trigger='click'>
<Tooltip title='Copied!' trigger='click' mouseLeaveDelay={0}>
{/* eslint-disable-next-line */}
<a onClick={() => {copy(message)}}> Copy </a>
</Tooltip>
......
......@@ -27,7 +27,7 @@ export default function ConstructorViewerItem(props: ConstructorViewerItemProps)
return (
<div style={{ background: color }} className='cvat-constructor-viewer-item'>
<Text>{label.name}</Text>
<Tooltip title='Update attributes'>
<Tooltip title='Update attributes' mouseLeaveDelay={0}>
<span
role='button'
tabIndex={0}
......@@ -39,7 +39,7 @@ export default function ConstructorViewerItem(props: ConstructorViewerItemProps)
</Tooltip>
{ label.id < 0
&& (
<Tooltip title='Delete label'>
<Tooltip title='Delete label' mouseLeaveDelay={0}>
<span
role='button'
tabIndex={0}
......
......@@ -137,7 +137,7 @@ class LabelForm extends React.PureComponent<Props, {}> {
return (
<Col span={4}>
<Form.Item>
<Tooltip title='An HTML element representing the attribute'>
<Tooltip title='An HTML element representing the attribute' mouseLeaveDelay={0}>
{ form.getFieldDecorator(`type[${key}]`, {
initialValue: type,
})(
......@@ -187,7 +187,7 @@ class LabelForm extends React.PureComponent<Props, {}> {
};
return (
<Tooltip title='Press enter to add a new value'>
<Tooltip title='Press enter to add a new value' mouseLeaveDelay={0}>
<Form.Item>
{ form.getFieldDecorator(`values[${key}]`, {
initialValue: existedValues,
......@@ -214,7 +214,7 @@ class LabelForm extends React.PureComponent<Props, {}> {
const { form } = this.props;
return (
<Tooltip title='Specify a default value'>
<Tooltip title='Specify a default value' mouseLeaveDelay={0}>
<Form.Item>
{ form.getFieldDecorator(`values[${key}]`, {
initialValue: value,
......@@ -304,7 +304,7 @@ class LabelForm extends React.PureComponent<Props, {}> {
return (
<Form.Item>
<Tooltip title='Can this attribute be changed frame to frame?'>
<Tooltip title='Can this attribute be changed frame to frame?' mouseLeaveDelay={0}>
{ form.getFieldDecorator(`mutable[${key}]`, {
initialValue: value,
valuePropName: 'checked',
......@@ -321,7 +321,7 @@ class LabelForm extends React.PureComponent<Props, {}> {
return (
<Form.Item>
<Tooltip title='Delete the attribute'>
<Tooltip title='Delete the attribute' mouseLeaveDelay={0}>
<Button
type='link'
className='cvat-delete-attribute-button'
......@@ -422,7 +422,7 @@ class LabelForm extends React.PureComponent<Props, {}> {
private renderDoneButton(): JSX.Element {
return (
<Col>
<Tooltip title='Save the label and return'>
<Tooltip title='Save the label and return' mouseLeaveDelay={0}>
<Button
style={{ width: '150px' }}
type='primary'
......@@ -445,7 +445,7 @@ class LabelForm extends React.PureComponent<Props, {}> {
label ? <div />
: (
<Col offset={1}>
<Tooltip title='Save the label and create one more'>
<Tooltip title='Save the label and create one more' mouseLeaveDelay={0}>
<Button
style={{ width: '150px' }}
type='primary'
......@@ -467,7 +467,7 @@ class LabelForm extends React.PureComponent<Props, {}> {
return (
<Col offset={1}>
<Tooltip title='Do not save the label and return'>
<Tooltip title='Do not save the label and return' mouseLeaveDelay={0}>
<Button
style={{ width: '150px' }}
type='danger'
......
......@@ -235,7 +235,7 @@ export default class LabelsEditor
tabBarStyle={{ marginBottom: '0px' }}
tabBarExtraContent={(
<>
<Tooltip title='Copied to clipboard!' trigger='click'>
<Tooltip title='Copied to clipboard!' trigger='click' mouseLeaveDelay={0}>
<Button
type='link'
icon='copy'
......
......@@ -94,7 +94,7 @@ class RawViewer extends React.PureComponent<Props> {
</Form.Item>
<Row type='flex' justify='start' align='middle'>
<Col>
<Tooltip title='Save labels and return'>
<Tooltip title='Save labels and return' mouseLeaveDelay={0}>
<Button
style={{ width: '150px' }}
type='primary'
......@@ -105,7 +105,7 @@ class RawViewer extends React.PureComponent<Props> {
</Tooltip>
</Col>
<Col offset={1}>
<Tooltip title='Do not save the label and return'>
<Tooltip title='Do not save the label and return' mouseLeaveDelay={0}>
<Button
style={{ width: '150px' }}
type='danger'
......
......@@ -186,7 +186,7 @@ export default class ModelRunnerModalComponent extends React.PureComponent<Props
<Tag color={colors[modelLabel]}>{taskLabel}</Tag>
</Col>
<Col span={1} offset={1}>
<Tooltip title='Remove the mapped values'>
<Tooltip title='Remove the mapped values' mouseLeaveDelay={0}>
<Icon
className='cvat-run-model-dialog-remove-mapping-icon'
type='close-circle'
......@@ -288,7 +288,7 @@ export default class ModelRunnerModalComponent extends React.PureComponent<Props
)}
</Col>
<Col span={1} offset={1}>
<Tooltip title='Specify a label mapping between model labels and task labels'>
<Tooltip title='Specify a label mapping between model labels and task labels' mouseLeaveDelay={0}>
<Icon className='cvat-info-circle-icon' type='question-circle' />
</Tooltip>
</Col>
......
......@@ -55,9 +55,11 @@ function JobListComponent(props: Props & RouteComponentProps): JSX.Element {
{`Job #${id}`}
</Button>
|
<Tooltip title='Old version of UI is deprecated and will be removed from
new versions of UI. We still recomend it only if you use
specific features from it like cuboids annotation.'
<Tooltip
title='Old version of UI is deprecated and will be removed from
new versions of UI. We still recomend it only if you use
specific features from it like cuboids annotation.'
mouseLeaveDelay={0}
>
<Button type='link' href={`${baseURL}/?id=${id}`}>Old UI</Button>
</Tooltip>
......@@ -150,7 +152,7 @@ function JobListComponent(props: Props & RouteComponentProps): JSX.Element {
<Row type='flex' justify='space-between' align='middle'>
<Col>
<Text className='cvat-text-color cvat-jobs-header'> Jobs </Text>
<Tooltip trigger='click' title='Copied to clipboard!'>
<Tooltip trigger='click' title='Copied to clipboard!' mouseLeaveDelay={0}>
<Button
type='link'
onClick={(): void => {
......
......@@ -145,7 +145,7 @@ class TaskItemComponent extends React.PureComponent<TaskItemProps & RouteCompone
/>
</Col>
<Col span={1} className='close-auto-annotation-icon'>
<Tooltip title='Cancel automatic annotation'>
<Tooltip title='Cancel automatic annotation' mouseLeaveDelay={0}>
<Icon
type='close'
onClick={() => {
......
......@@ -72,7 +72,7 @@ function mapStateToProps(state: CombinedState): StateToProps {
coreVersion: packageVersion.core,
canvasVersion: packageVersion.canvas,
uiVersion: packageVersion.ui,
switchSettingsShortcut: normalizedKeyMap.OPEN_SETTINGS,
switchSettingsShortcut: normalizedKeyMap.SWITCH_SETTINGS,
settingsDialogShown,
};
}
......
......@@ -2,6 +2,9 @@
//
// SPDX-License-Identifier: MIT
/* eslint-disable @typescript-eslint/no-implied-eval */
/* eslint-disable no-new-func */
export function isDev(): boolean {
return process.env.NODE_ENV === 'development';
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册