diff --git a/CHANGELOG.md b/CHANGELOG.md index d9a6c5f10cb7..aa5927b2eab2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Memory consumption for the task creation process () - Frame preloading () +- Project cannot be removed from the project page () ### Security diff --git a/cvat-canvas/src/typescript/canvas.ts b/cvat-canvas/src/typescript/canvas.ts index 29355d509afb..bc19a8381cd5 100644 --- a/cvat-canvas/src/typescript/canvas.ts +++ b/cvat-canvas/src/typescript/canvas.ts @@ -8,8 +8,8 @@ import { MergeData, SplitData, GroupData, - InteractionData, - InteractionResult, + InteractionData as _InteractionData, + InteractionResult as _InteractionResult, CanvasModel, CanvasModelImpl, RectDrawingMethod, @@ -165,13 +165,9 @@ class CanvasImpl implements Canvas { } } +export type InteractionData = _InteractionData; +export type InteractionResult = _InteractionResult; + export { - CanvasImpl as Canvas, - CanvasVersion, - Configuration, - RectDrawingMethod, - CuboidDrawingMethod, - Mode as CanvasMode, - InteractionData, - InteractionResult, + CanvasImpl as Canvas, CanvasVersion, RectDrawingMethod, CuboidDrawingMethod, Mode as CanvasMode, }; diff --git a/cvat-core/package-lock.json b/cvat-core/package-lock.json index 49fd1e2ddd20..663df2da7fa4 100644 --- a/cvat-core/package-lock.json +++ b/cvat-core/package-lock.json @@ -3274,9 +3274,9 @@ "integrity": "sha512-3YDiu347mtVtjpyV3u5kVqQLP242c06zwDOgpeRnybmXlYYsLbtTrUBUm8i8srONt+FWobl5aibnU1030PeeuA==" }, "axios": { - "version": "0.21.0", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.0.tgz", - "integrity": "sha512-fmkJBknJKoZwem3/IKSSLpkdNXZeBu5Q7GA/aRsr2btgrptmSCxi2oFjZHqGdK9DoTil9PIHlPIZw2EcRJXRvw==", + "version": "0.21.1", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz", + "integrity": "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==", "requires": { "follow-redirects": "^1.10.0" } @@ -12973,9 +12973,9 @@ } }, "follow-redirects": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.0.tgz", - "integrity": "sha512-aq6gF1BEKje4a9i9+5jimNFIpq4Q1WiwBToeRK5NvZBd/TRsmW8BsJfOEGkr76TbOyPVD3OVDN910EcUNtRYEA==" + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.1.tgz", + "integrity": "sha512-SSG5xmZh1mkPGyKzjZP8zLjltIfpW32Y5QpdNJyjcfGxK3qo3NDDkZOZSFiGn1A6SclQxY9GzEwAHQ3dmYRWpg==" }, "for-in": { "version": "1.0.2", diff --git a/cvat-core/package.json b/cvat-core/package.json index eef263d21f46..3ab719d84001 100644 --- a/cvat-core/package.json +++ b/cvat-core/package.json @@ -33,7 +33,7 @@ "webpack-cli": "^3.3.2" }, "dependencies": { - "axios": "^0.21.0", + "axios": "^0.21.1", "browser-or-node": "^1.2.1", "cvat-data": "../cvat-data", "detect-browser": "^5.2.0", diff --git a/cvat-ui/package-lock.json b/cvat-ui/package-lock.json index 028b0476e2d8..c0668d70b5b0 100644 --- a/cvat-ui/package-lock.json +++ b/cvat-ui/package-lock.json @@ -1,6 +1,6 @@ { "name": "cvat-ui", - "version": "1.13.2", + "version": "1.13.3", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/cvat-ui/package.json b/cvat-ui/package.json index 49420f74871a..450fbc4e3569 100644 --- a/cvat-ui/package.json +++ b/cvat-ui/package.json @@ -1,6 +1,6 @@ { "name": "cvat-ui", - "version": "1.13.2", + "version": "1.13.3", "description": "CVAT single-page application", "main": "src/index.tsx", "scripts": { diff --git a/cvat-ui/src/components/annotation-page/standard-workspace/controls-side-bar/draw-cuboid-control.tsx b/cvat-ui/src/components/annotation-page/standard-workspace/controls-side-bar/draw-cuboid-control.tsx index 9c2018e9c276..958b208bba78 100644 --- a/cvat-ui/src/components/annotation-page/standard-workspace/controls-side-bar/draw-cuboid-control.tsx +++ b/cvat-ui/src/components/annotation-page/standard-workspace/controls-side-bar/draw-cuboid-control.tsx @@ -12,6 +12,7 @@ import { ShapeType } from 'reducers/interfaces'; import { CubeIcon } from 'icons'; import DrawShapePopoverContainer from 'containers/annotation-page/standard-workspace/controls-side-bar/draw-shape-popover'; +import withVisibilityHandling from './handle-popover-visibility'; interface Props { canvasInstance: Canvas; @@ -20,6 +21,7 @@ interface Props { function DrawPolygonControl(props: Props): JSX.Element { const { canvasInstance, isDrawing } = props; + const CustomPopover = withVisibilityHandling(Popover, 'draw-cuboid'); const dynamcPopoverPros = isDrawing ? { @@ -41,14 +43,14 @@ function DrawPolygonControl(props: Props): JSX.Element { }; return ( - } > - + ); } diff --git a/cvat-ui/src/components/annotation-page/standard-workspace/controls-side-bar/draw-points-control.tsx b/cvat-ui/src/components/annotation-page/standard-workspace/controls-side-bar/draw-points-control.tsx index 975d0919963d..8127059d4a06 100644 --- a/cvat-ui/src/components/annotation-page/standard-workspace/controls-side-bar/draw-points-control.tsx +++ b/cvat-ui/src/components/annotation-page/standard-workspace/controls-side-bar/draw-points-control.tsx @@ -11,6 +11,7 @@ import { PointIcon } from 'icons'; import { ShapeType } from 'reducers/interfaces'; import DrawShapePopoverContainer from 'containers/annotation-page/standard-workspace/controls-side-bar/draw-shape-popover'; +import withVisibilityHandling from './handle-popover-visibility'; interface Props { canvasInstance: Canvas; @@ -19,6 +20,7 @@ interface Props { function DrawPointsControl(props: Props): JSX.Element { const { canvasInstance, isDrawing } = props; + const CustomPopover = withVisibilityHandling(Popover, 'draw-points'); const dynamcPopoverPros = isDrawing ? { @@ -40,14 +42,14 @@ function DrawPointsControl(props: Props): JSX.Element { }; return ( - } > - + ); } diff --git a/cvat-ui/src/components/annotation-page/standard-workspace/controls-side-bar/draw-polygon-control.tsx b/cvat-ui/src/components/annotation-page/standard-workspace/controls-side-bar/draw-polygon-control.tsx index d856e1e4030b..23f5e7549eb7 100644 --- a/cvat-ui/src/components/annotation-page/standard-workspace/controls-side-bar/draw-polygon-control.tsx +++ b/cvat-ui/src/components/annotation-page/standard-workspace/controls-side-bar/draw-polygon-control.tsx @@ -11,6 +11,7 @@ import { PolygonIcon } from 'icons'; import { ShapeType } from 'reducers/interfaces'; import DrawShapePopoverContainer from 'containers/annotation-page/standard-workspace/controls-side-bar/draw-shape-popover'; +import withVisibilityHandling from './handle-popover-visibility'; interface Props { canvasInstance: Canvas; @@ -19,6 +20,7 @@ interface Props { function DrawPolygonControl(props: Props): JSX.Element { const { canvasInstance, isDrawing } = props; + const CustomPopover = withVisibilityHandling(Popover, 'draw-polygon'); const dynamcPopoverPros = isDrawing ? { @@ -40,14 +42,14 @@ function DrawPolygonControl(props: Props): JSX.Element { }; return ( - } > - + ); } diff --git a/cvat-ui/src/components/annotation-page/standard-workspace/controls-side-bar/draw-polyline-control.tsx b/cvat-ui/src/components/annotation-page/standard-workspace/controls-side-bar/draw-polyline-control.tsx index b4b323a1657f..2139ad4dcb9b 100644 --- a/cvat-ui/src/components/annotation-page/standard-workspace/controls-side-bar/draw-polyline-control.tsx +++ b/cvat-ui/src/components/annotation-page/standard-workspace/controls-side-bar/draw-polyline-control.tsx @@ -11,6 +11,7 @@ import { PolylineIcon } from 'icons'; import { ShapeType } from 'reducers/interfaces'; import DrawShapePopoverContainer from 'containers/annotation-page/standard-workspace/controls-side-bar/draw-shape-popover'; +import withVisibilityHandling from './handle-popover-visibility'; interface Props { canvasInstance: Canvas; @@ -19,6 +20,7 @@ interface Props { function DrawPolylineControl(props: Props): JSX.Element { const { canvasInstance, isDrawing } = props; + const CustomPopover = withVisibilityHandling(Popover, 'draw-polyline'); const dynamcPopoverPros = isDrawing ? { @@ -40,14 +42,14 @@ function DrawPolylineControl(props: Props): JSX.Element { }; return ( - } > - + ); } diff --git a/cvat-ui/src/components/annotation-page/standard-workspace/controls-side-bar/draw-rectangle-control.tsx b/cvat-ui/src/components/annotation-page/standard-workspace/controls-side-bar/draw-rectangle-control.tsx index 402d37a41c40..50efd5183f01 100644 --- a/cvat-ui/src/components/annotation-page/standard-workspace/controls-side-bar/draw-rectangle-control.tsx +++ b/cvat-ui/src/components/annotation-page/standard-workspace/controls-side-bar/draw-rectangle-control.tsx @@ -11,6 +11,7 @@ import { RectangleIcon } from 'icons'; import { ShapeType } from 'reducers/interfaces'; import DrawShapePopoverContainer from 'containers/annotation-page/standard-workspace/controls-side-bar/draw-shape-popover'; +import withVisibilityHandling from './handle-popover-visibility'; interface Props { canvasInstance: Canvas; @@ -19,6 +20,7 @@ interface Props { function DrawRectangleControl(props: Props): JSX.Element { const { canvasInstance, isDrawing } = props; + const CustomPopover = withVisibilityHandling(Popover, 'draw-rectangle'); const dynamcPopoverPros = isDrawing ? { @@ -40,14 +42,14 @@ function DrawRectangleControl(props: Props): JSX.Element { }; return ( - } > - + ); } diff --git a/cvat-ui/src/components/annotation-page/standard-workspace/controls-side-bar/handle-popover-visibility.tsx b/cvat-ui/src/components/annotation-page/standard-workspace/controls-side-bar/handle-popover-visibility.tsx new file mode 100644 index 000000000000..c9de255dca18 --- /dev/null +++ b/cvat-ui/src/components/annotation-page/standard-workspace/controls-side-bar/handle-popover-visibility.tsx @@ -0,0 +1,41 @@ +// Copyright (C) 2020 Intel Corporation +// +// SPDX-License-Identifier: MIT + +import React, { useState } from 'react'; +import Popover, { PopoverProps } from 'antd/lib/popover'; + +export default function withVisibilityHandling(WrappedComponent: typeof Popover, popoverType: string) { + return (props: PopoverProps): JSX.Element => { + const [initialized, setInitialized] = useState(false); + const [visible, setVisible] = useState(false); + let { overlayClassName } = props; + if (typeof overlayClassName !== 'string') overlayClassName = ''; + + overlayClassName += ` cvat-${popoverType}-popover`; + if (visible) { + overlayClassName += ` cvat-${popoverType}-popover-visible`; + } + + const callback = (event: Event): void => { + if ((event as AnimationEvent).animationName === 'antZoomBigIn') { + setVisible(true); + } + }; + + return ( + { + if (!_visible) setVisible(false); + if (!initialized) { + const self = window.document.getElementsByClassName(`cvat-${popoverType}-popover`)[0]; + self?.addEventListener('animationend', callback); + setInitialized(true); + } + }} + /> + ); + }; +} diff --git a/cvat-ui/src/components/annotation-page/standard-workspace/controls-side-bar/rotate-control.tsx b/cvat-ui/src/components/annotation-page/standard-workspace/controls-side-bar/rotate-control.tsx index 094e8d7cf1fb..380e6b55f8a6 100644 --- a/cvat-ui/src/components/annotation-page/standard-workspace/controls-side-bar/rotate-control.tsx +++ b/cvat-ui/src/components/annotation-page/standard-workspace/controls-side-bar/rotate-control.tsx @@ -10,6 +10,8 @@ import Popover from 'antd/lib/popover'; import { RotateIcon } from 'icons'; import { Rotation } from 'reducers/interfaces'; +import withVisibilityHandling from './handle-popover-visibility'; + interface Props { clockwiseShortcut: string; anticlockwiseShortcut: string; @@ -18,10 +20,10 @@ interface Props { function RotateControl(props: Props): JSX.Element { const { anticlockwiseShortcut, clockwiseShortcut, rotateFrame } = props; + const CustomPopover = withVisibilityHandling(Popover, 'rotate-canvas'); return ( - @@ -52,7 +54,7 @@ function RotateControl(props: Props): JSX.Element { trigger='hover' > - + ); } diff --git a/cvat-ui/src/components/annotation-page/standard-workspace/controls-side-bar/setup-tag-control.tsx b/cvat-ui/src/components/annotation-page/standard-workspace/controls-side-bar/setup-tag-control.tsx index cef80d88c7ec..fcc4ea39a6c5 100644 --- a/cvat-ui/src/components/annotation-page/standard-workspace/controls-side-bar/setup-tag-control.tsx +++ b/cvat-ui/src/components/annotation-page/standard-workspace/controls-side-bar/setup-tag-control.tsx @@ -10,6 +10,7 @@ import { Canvas } from 'cvat-canvas-wrapper'; import { TagIcon } from 'icons'; import SetupTagPopoverContainer from 'containers/annotation-page/standard-workspace/controls-side-bar/setup-tag-popover'; +import withVisibilityHandling from './handle-popover-visibility'; interface Props { canvasInstance: Canvas; @@ -18,22 +19,20 @@ interface Props { function SetupTagControl(props: Props): JSX.Element { const { isDrawing } = props; + const CustomPopover = withVisibilityHandling(Popover, 'setup-tag'); - const dynamcPopoverPros = isDrawing ? { - overlayStyle: { - display: 'none', - }, - } : {}; + const dynamcPopoverPros = isDrawing ? + { + overlayStyle: { + display: 'none', + }, + } : + {}; return ( - } - > + }> - + ); } diff --git a/cvat-ui/src/components/annotation-page/standard-workspace/controls-side-bar/setup-tag-popover.tsx b/cvat-ui/src/components/annotation-page/standard-workspace/controls-side-bar/setup-tag-popover.tsx index bbbc5ccb1dd5..a0e31a605dbb 100644 --- a/cvat-ui/src/components/annotation-page/standard-workspace/controls-side-bar/setup-tag-popover.tsx +++ b/cvat-ui/src/components/annotation-page/standard-workspace/controls-side-bar/setup-tag-popover.tsx @@ -23,7 +23,7 @@ function SetupTagPopover(props: Props): JSX.Element { } = props; return ( -
+
diff --git a/cvat-ui/src/components/annotation-page/standard-workspace/controls-side-bar/tools-control.tsx b/cvat-ui/src/components/annotation-page/standard-workspace/controls-side-bar/tools-control.tsx index 88c2b0a76bbd..28da997b0752 100644 --- a/cvat-ui/src/components/annotation-page/standard-workspace/controls-side-bar/tools-control.tsx +++ b/cvat-ui/src/components/annotation-page/standard-workspace/controls-side-bar/tools-control.tsx @@ -32,6 +32,7 @@ import { import { InteractionResult } from 'cvat-canvas/src/typescript/canvas'; import DetectorRunner from 'components/model-runner-modal/detector-runner'; import LabelSelector from 'components/label-selector/label-selector'; +import withVisibilityHandling from './handle-popover-visibility'; interface StateToProps { canvasInstance: Canvas; @@ -746,6 +747,7 @@ export class ToolsControlComponent extends React.PureComponent { const { fetching, trackingProgress } = this.state; if (![...interactors, ...detectors, ...trackers].length) return null; + const CustomPopover = withVisibilityHandling(Popover, 'tools-control'); const dynamcPopoverPros = isActivated ? { @@ -781,14 +783,9 @@ export class ToolsControlComponent extends React.PureComponent { )} - + - + ); } diff --git a/cvat-ui/src/components/annotation-page/standard-workspace/styles.scss b/cvat-ui/src/components/annotation-page/standard-workspace/styles.scss index d869537202e3..498a0dac058f 100644 --- a/cvat-ui/src/components/annotation-page/standard-workspace/styles.scss +++ b/cvat-ui/src/components/annotation-page/standard-workspace/styles.scss @@ -85,13 +85,14 @@ } } -.cvat-rotate-canvas-controls { +.cvat-rotate-canvas-popover { .ant-popover-inner-content { padding: 0; } } .cvat-draw-shape-popover, +.cvat-setup-tag-popover, .cvat-tools-control-popover { .ant-popover-inner-content { padding: 0; @@ -115,6 +116,7 @@ background: $background-color-2; } +.cvat-setup-tag-popover-content, .cvat-draw-shape-popover-content { padding: 10px; border-radius: 5px; diff --git a/cvat-ui/src/components/cvat-app.tsx b/cvat-ui/src/components/cvat-app.tsx index a7c5079ef331..1c2c868d8411 100644 --- a/cvat-ui/src/components/cvat-app.tsx +++ b/cvat-ui/src/components/cvat-app.tsx @@ -276,6 +276,7 @@ class CVATApplication extends React.PureComponent diff --git a/cvat-ui/src/components/project-page/top-bar.tsx b/cvat-ui/src/components/project-page/top-bar.tsx index b90d7be32609..dde03ecb9288 100644 --- a/cvat-ui/src/components/project-page/top-bar.tsx +++ b/cvat-ui/src/components/project-page/top-bar.tsx @@ -32,7 +32,7 @@ export default function ProjectTopBar(props: DetailsComponentProps): JSX.Element - }> + }>