Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
疯人忠
Cvat
提交
9c07dbfd
C
Cvat
项目概览
疯人忠
/
Cvat
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
Cvat
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
9c07dbfd
编写于
10月 28, 2020
作者:
B
Boris Sekachev
提交者:
GitHub
10月 28, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Additional CSS classes in CVAT to cypress testing (#2366)
上级
3531316d
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
127 addition
and
30 deletion
+127
-30
cvat-ui/src/components/annotation-page/standard-workspace/objects-side-bar/object-item-buttons.tsx
...andard-workspace/objects-side-bar/object-item-buttons.tsx
+127
-30
未找到文件。
cvat-ui/src/components/annotation-page/standard-workspace/objects-side-bar/object-item-buttons.tsx
浏览文件 @
9c07dbfd
...
...
@@ -7,7 +7,9 @@ import { Row, Col } from 'antd/lib/grid';
import
Icon
from
'
antd/lib/icon
'
;
import
Tooltip
from
'
antd/lib/tooltip
'
;
import
{
ObjectOutsideIcon
,
FirstIcon
,
LastIcon
,
PreviousIcon
,
NextIcon
}
from
'
icons
'
;
import
{
ObjectOutsideIcon
,
FirstIcon
,
LastIcon
,
PreviousIcon
,
NextIcon
,
}
from
'
icons
'
;
import
{
ObjectType
,
ShapeType
}
from
'
reducers/interfaces
'
;
interface
Props
{
...
...
@@ -93,6 +95,37 @@ function ItemButtonsComponent(props: Props): JSX.Element {
const
hiddenStyle
=
hiddenDisabled
?
{
opacity
:
0.5
,
pointerEvents
:
'
none
'
as
const
}
:
{};
const
keyframeStyle
=
keyframeDisabled
?
{
opacity
:
0.5
,
pointerEvents
:
'
none
'
as
const
}
:
{};
const
classes
=
{
firstKeyFrame
:
{
className
:
'
cvat-object-item-button-first-keyframe
'
},
prevKeyFrame
:
{
className
:
'
cvat-object-item-button-prev-keyframe
'
},
nextKeyFrame
:
{
className
:
'
cvat-object-item-button-next-keyframe
'
},
lastKeyFrame
:
{
className
:
'
cvat-object-item-button-last-keyframe
'
},
outside
:
{
enabled
:
{
className
:
'
cvat-object-item-button-outside cvat-object-item-button-outside-enabled
'
},
disabled
:
{
className
:
'
cvat-object-item-button-outside
'
},
},
lock
:
{
enabled
:
{
className
:
'
cvat-object-item-button-lock cvat-object-item-button-lock-enabled
'
},
disabled
:
{
className
:
'
cvat-object-item-button-lock
'
},
},
occluded
:
{
enabled
:
{
className
:
'
cvat-object-item-button-occluded cvat-object-item-button-occluded-enabled
'
},
disabled
:
{
className
:
'
cvat-object-item-button-occluded
'
},
},
pinned
:
{
enabled
:
{
className
:
'
cvat-object-item-button-pinned cvat-object-item-button-pinned-enabled
'
},
disabled
:
{
className
:
'
cvat-object-item-button-pinned
'
},
},
hidden
:
{
enabled
:
{
className
:
'
cvat-object-item-button-hidden cvat-object-item-button-hidden-enabled
'
},
disabled
:
{
className
:
'
cvat-object-item-button-hidden
'
},
},
keyframe
:
{
enabled
:
{
className
:
'
cvat-object-item-button-keyframe cvat-object-item-button-keyframe-enabled
'
},
disabled
:
{
className
:
'
cvat-object-item-button-keyframe
'
},
},
};
if
(
objectType
===
ObjectType
.
TRACK
)
{
return
(
<
Row
type
=
'flex'
align
=
'middle'
justify
=
'space-around'
>
...
...
@@ -100,34 +133,62 @@ function ItemButtonsComponent(props: Props): JSX.Element {
<
Row
type
=
'flex'
justify
=
'space-around'
>
<
Col
>
{
navigateFirstKeyframe
?
(
<
Icon
component
=
{
FirstIcon
}
onClick
=
{
navigateFirstKeyframe
}
/>
<
Icon
{
...
classes
.
firstKeyFrame
}
component
=
{
FirstIcon
}
onClick
=
{
navigateFirstKeyframe
}
/>
)
:
(
<
Icon
component
=
{
FirstIcon
}
style
=
{
{
opacity
:
0.5
,
pointerEvents
:
'
none
'
}
}
/>
<
Icon
{
...
classes
.
firstKeyFrame
}
component
=
{
FirstIcon
}
style
=
{
{
opacity
:
0.5
,
pointerEvents
:
'
none
'
}
}
/>
)
}
</
Col
>
<
Col
>
{
navigatePrevKeyframe
?
(
<
Tooltip
title
=
{
`Go to previous keyframe
${
prevKeyFrameShortcut
}
`
}
mouseLeaveDelay
=
{
0
}
>
<
Icon
component
=
{
PreviousIcon
}
onClick
=
{
navigatePrevKeyframe
}
/>
<
Icon
{
...
classes
.
prevKeyFrame
}
component
=
{
PreviousIcon
}
onClick
=
{
navigatePrevKeyframe
}
/>
</
Tooltip
>
)
:
(
<
Icon
component
=
{
PreviousIcon
}
style
=
{
{
opacity
:
0.5
,
pointerEvents
:
'
none
'
}
}
/>
<
Icon
{
...
classes
.
prevKeyFrame
}
component
=
{
PreviousIcon
}
style
=
{
{
opacity
:
0.5
,
pointerEvents
:
'
none
'
}
}
/>
)
}
</
Col
>
<
Col
>
{
navigateNextKeyframe
?
(
<
Tooltip
title
=
{
`Go to next keyframe
${
nextKeyFrameShortcut
}
`
}
mouseLeaveDelay
=
{
0
}
>
<
Icon
component
=
{
NextIcon
}
onClick
=
{
navigateNextKeyframe
}
/>
<
Icon
{
...
classes
.
nextKeyFrame
}
component
=
{
NextIcon
}
onClick
=
{
navigateNextKeyframe
}
/>
</
Tooltip
>
)
:
(
<
Icon
component
=
{
NextIcon
}
style
=
{
{
opacity
:
0.5
,
pointerEvents
:
'
none
'
}
}
/>
<
Icon
{
...
classes
.
nextKeyFrame
}
component
=
{
NextIcon
}
style
=
{
{
opacity
:
0.5
,
pointerEvents
:
'
none
'
}
}
/>
)
}
</
Col
>
<
Col
>
{
navigateLastKeyframe
?
(
<
Icon
component
=
{
LastIcon
}
onClick
=
{
navigateLastKeyframe
}
/>
<
Icon
{
...
classes
.
lastKeyFrame
}
component
=
{
LastIcon
}
onClick
=
{
navigateLastKeyframe
}
/>
)
:
(
<
Icon
component
=
{
LastIcon
}
style
=
{
{
opacity
:
0.5
,
pointerEvents
:
'
none
'
}
}
/>
<
Icon
{
...
classes
.
lastKeyFrame
}
component
=
{
LastIcon
}
style
=
{
{
opacity
:
0.5
,
pointerEvents
:
'
none
'
}
}
/>
)
}
</
Col
>
</
Row
>
...
...
@@ -135,45 +196,72 @@ function ItemButtonsComponent(props: Props): JSX.Element {
<
Col
>
<
Tooltip
title
=
{
`Switch outside property
${
switchOutsideShortcut
}
`
}
mouseLeaveDelay
=
{
0
}
>
{
outside
?
(
<
Icon
component
=
{
ObjectOutsideIcon
}
onClick
=
{
unsetOutside
}
style
=
{
outsideStyle
}
/>
<
Icon
{
...
classes
.
outside
.
enabled
}
component
=
{
ObjectOutsideIcon
}
onClick
=
{
unsetOutside
}
style
=
{
outsideStyle
}
/>
)
:
(
<
Icon
type
=
'select'
onClick
=
{
setOutside
}
style
=
{
outsideStyle
}
/>
<
Icon
type
=
'select'
{
...
classes
.
outside
.
disabled
}
onClick
=
{
setOutside
}
style
=
{
outsideStyle
}
/>
)
}
</
Tooltip
>
</
Col
>
<
Col
>
<
Tooltip
title
=
{
`Switch lock property
${
switchLockShortcut
}
`
}
mouseLeaveDelay
=
{
0
}
>
{
locked
?
(
<
Icon
type
=
'lock'
theme
=
'filled'
onClick
=
{
unlock
}
/>
<
Icon
{
...
classes
.
lock
.
enabled
}
type
=
'lock'
theme
=
'filled'
onClick
=
{
unlock
}
/>
)
:
(
<
Icon
type
=
'unlock'
onClick
=
{
lock
}
/>
<
Icon
{
...
classes
.
lock
.
disabled
}
type
=
'unlock'
onClick
=
{
lock
}
/>
)
}
</
Tooltip
>
</
Col
>
<
Col
>
<
Tooltip
title
=
{
`Switch occluded property
${
switchOccludedShortcut
}
`
}
mouseLeaveDelay
=
{
0
}
>
{
occluded
?
(
<
Icon
type
=
'team'
onClick
=
{
unsetOccluded
}
/>
<
Icon
{
...
classes
.
occluded
.
enabled
}
type
=
'team'
onClick
=
{
unsetOccluded
}
/>
)
:
(
<
Icon
type
=
'user'
onClick
=
{
setOccluded
}
/>
<
Icon
{
...
classes
.
occluded
.
disabled
}
type
=
'user'
onClick
=
{
setOccluded
}
/>
)
}
</
Tooltip
>
</
Col
>
<
Col
>
<
Tooltip
title
=
{
`Switch hidden property
${
switchHiddenShortcut
}
`
}
mouseLeaveDelay
=
{
0
}
>
{
hidden
?
(
<
Icon
type
=
'eye-invisible'
theme
=
'filled'
onClick
=
{
show
}
style
=
{
hiddenStyle
}
/>
<
Icon
{
...
classes
.
hidden
.
enabled
}
type
=
'eye-invisible'
theme
=
'filled'
onClick
=
{
show
}
style
=
{
hiddenStyle
}
/>
)
:
(
<
Icon
type
=
'eye'
onClick
=
{
hide
}
style
=
{
hiddenStyle
}
/>
<
Icon
{
...
classes
.
hidden
.
disabled
}
type
=
'eye'
onClick
=
{
hide
}
style
=
{
hiddenStyle
}
/>
)
}
</
Tooltip
>
</
Col
>
<
Col
>
<
Tooltip
title
=
{
`Switch keyframe property
${
switchKeyFrameShortcut
}
`
}
mouseLeaveDelay
=
{
0
}
>
{
keyframe
?
(
<
Icon
type
=
'star'
theme
=
'filled'
onClick
=
{
unsetKeyframe
}
style
=
{
keyframeStyle
}
/>
<
Icon
{
...
classes
.
keyframe
.
enabled
}
type
=
'star'
theme
=
'filled'
onClick
=
{
unsetKeyframe
}
style
=
{
keyframeStyle
}
/>
)
:
(
<
Icon
type
=
'star'
onClick
=
{
setKeyframe
}
style
=
{
keyframeStyle
}
/>
<
Icon
{
...
classes
.
keyframe
.
disabled
}
type
=
'star'
onClick
=
{
setKeyframe
}
style
=
{
keyframeStyle
}
/>
)
}
</
Tooltip
>
</
Col
>
...
...
@@ -181,9 +269,14 @@ function ItemButtonsComponent(props: Props): JSX.Element {
<
Col
>
<
Tooltip
title
=
'Switch pinned property'
mouseLeaveDelay
=
{
0
}
>
{
pinned
?
(
<
Icon
type
=
'pushpin'
theme
=
'filled'
onClick
=
{
unpin
}
/>
<
Icon
{
...
classes
.
pinned
.
enabled
}
type
=
'pushpin'
theme
=
'filled'
onClick
=
{
unpin
}
/>
)
:
(
<
Icon
type
=
'pushpin'
onClick
=
{
pin
}
/>
<
Icon
{
...
classes
.
pinned
.
disabled
}
type
=
'pushpin'
onClick
=
{
pin
}
/>
)
}
</
Tooltip
>
</
Col
>
...
...
@@ -202,9 +295,9 @@ function ItemButtonsComponent(props: Props): JSX.Element {
<
Col
>
<
Tooltip
title
=
{
`Switch lock property
${
switchLockShortcut
}
`
}
mouseLeaveDelay
=
{
0
}
>
{
locked
?
(
<
Icon
type
=
'lock'
onClick
=
{
unlock
}
theme
=
'filled'
/>
<
Icon
{
...
classes
.
lock
.
enabled
}
type
=
'lock'
onClick
=
{
unlock
}
theme
=
'filled'
/>
)
:
(
<
Icon
type
=
'unlock'
onClick
=
{
lock
}
/>
<
Icon
{
...
classes
.
lock
.
disabled
}
type
=
'unlock'
onClick
=
{
lock
}
/>
)
}
</
Tooltip
>
</
Col
>
...
...
@@ -221,33 +314,37 @@ function ItemButtonsComponent(props: Props): JSX.Element {
<
Col
>
<
Tooltip
title
=
{
`Switch lock property
${
switchLockShortcut
}
`
}
mouseLeaveDelay
=
{
0
}
>
{
locked
?
(
<
Icon
type
=
'lock'
onClick
=
{
unlock
}
theme
=
'filled'
/>
<
Icon
{
...
classes
.
lock
.
enabled
}
type
=
'lock'
onClick
=
{
unlock
}
theme
=
'filled'
/>
)
:
(
<
Icon
type
=
'unlock'
onClick
=
{
lock
}
/>
<
Icon
{
...
classes
.
lock
.
disabled
}
type
=
'unlock'
onClick
=
{
lock
}
/>
)
}
</
Tooltip
>
</
Col
>
<
Col
>
<
Tooltip
title
=
{
`Switch occluded property
${
switchOccludedShortcut
}
`
}
mouseLeaveDelay
=
{
0
}
>
{
occluded
?
(
<
Icon
type
=
'team'
onClick
=
{
unsetOccluded
}
/>
<
Icon
{
...
classes
.
occluded
.
enabled
}
type
=
'team'
onClick
=
{
unsetOccluded
}
/>
)
:
(
<
Icon
type
=
'user'
onClick
=
{
setOccluded
}
/>
<
Icon
{
...
classes
.
occluded
.
disabled
}
type
=
'user'
onClick
=
{
setOccluded
}
/>
)
}
</
Tooltip
>
</
Col
>
<
Col
>
<
Tooltip
title
=
{
`Switch hidden property
${
switchHiddenShortcut
}
`
}
mouseLeaveDelay
=
{
0
}
>
{
hidden
?
<
Icon
type
=
'eye-invisible'
onClick
=
{
show
}
/>
:
<
Icon
type
=
'eye'
onClick
=
{
hide
}
/>
}
{
hidden
?
(
<
Icon
{
...
classes
.
hidden
.
enabled
}
type
=
'eye-invisible'
onClick
=
{
show
}
/>
)
:
(
<
Icon
{
...
classes
.
hidden
.
disabled
}
type
=
'eye'
onClick
=
{
hide
}
/>
)
}
</
Tooltip
>
</
Col
>
{
shapeType
!==
ShapeType
.
POINTS
&&
(
<
Col
>
<
Tooltip
title
=
'Switch pinned property'
mouseLeaveDelay
=
{
0
}
>
{
pinned
?
(
<
Icon
type
=
'pushpin'
theme
=
'filled'
onClick
=
{
unpin
}
/>
<
Icon
{
...
classes
.
pinned
.
enabled
}
type
=
'pushpin'
theme
=
'filled'
onClick
=
{
unpin
}
/>
)
:
(
<
Icon
type
=
'pushpin'
onClick
=
{
pin
}
/>
<
Icon
{
...
classes
.
pinned
.
disabled
}
type
=
'pushpin'
onClick
=
{
pin
}
/>
)
}
</
Tooltip
>
</
Col
>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录