Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
疯人忠
Cvat
提交
9bca5357
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,发现更多精彩内容 >>
提交
9bca5357
编写于
12月 07, 2020
作者:
B
Boris Sekachev
浏览文件
操作
浏览文件
下载
差异文件
Merged develop
上级
804384f9
be938041
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
135 addition
and
2 deletion
+135
-2
cvat-ui/src/components/annotation-page/standard-workspace/objects-side-bar/object-item-menu.tsx
.../standard-workspace/objects-side-bar/object-item-menu.tsx
+1
-0
cvat-ui/src/components/cvat-app.tsx
cvat-ui/src/components/cvat-app.tsx
+4
-2
cvat-ui/src/reducers/interfaces.ts
cvat-ui/src/reducers/interfaces.ts
+1
-0
cvat-ui/src/reducers/notifications-reducer.ts
cvat-ui/src/reducers/notifications-reducer.ts
+1
-0
tests/cypress/integration/actions_tasks_objects/case_24_delete_unlock_lock_object.js
...ctions_tasks_objects/case_24_delete_unlock_lock_object.js
+128
-0
未找到文件。
cvat-ui/src/components/annotation-page/standard-workspace/objects-side-bar/object-item-menu.tsx
浏览文件 @
9bca5357
...
...
@@ -200,6 +200,7 @@ function RemoveItem(props: ItemProps): JSX.Element {
onClick
=
{
():
void
=>
{
if
(
locked
)
{
Modal
.
confirm
({
className
:
'
cvat-modal-confirm
'
,
title
:
'
Object is locked
'
,
content
:
'
Are you sure you want to remove it?
'
,
onOk
()
{
...
...
cvat-ui/src/components/cvat-app.tsx
浏览文件 @
9bca5357
...
...
@@ -188,9 +188,11 @@ class CVATApplication extends React.PureComponent<CVATAppProps & RouteComponentP
}
private
showErrors
():
void
{
function
showError
(
title
:
string
,
_error
:
any
):
void
{
function
showError
(
title
:
string
,
_error
:
any
,
className
?:
string
):
void
{
const
error
=
_error
.
toString
();
const
dynamicProps
=
typeof
className
===
'
undefined
'
?
{}
:
{
className
};
notification
.
error
({
...
dynamicProps
,
message
:
(
<
div
// eslint-disable-next-line
...
...
@@ -215,7 +217,7 @@ class CVATApplication extends React.PureComponent<CVATAppProps & RouteComponentP
const
error
=
(
notifications
as
any
).
errors
[
where
][
what
];
shown
=
shown
||
!!
error
;
if
(
error
)
{
showError
(
error
.
message
,
error
.
reason
);
showError
(
error
.
message
,
error
.
reason
,
error
.
className
);
}
}
}
...
...
cvat-ui/src/reducers/interfaces.ts
浏览文件 @
9bca5357
...
...
@@ -214,6 +214,7 @@ export interface ModelsState {
export
interface
ErrorState
{
message
:
string
;
reason
:
string
;
className
?:
string
;
}
export
interface
NotificationsState
{
...
...
cvat-ui/src/reducers/notifications-reducer.ts
浏览文件 @
9bca5357
...
...
@@ -776,6 +776,7 @@ export default function (state = defaultState, action: AnyAction): Notifications
removing
:
{
message
:
'
Could not remove the object
'
,
reason
:
action
.
payload
.
error
.
toString
(),
className
:
'
cvat-notification-notice-remove-object-failed
'
,
},
},
},
...
...
tests/cypress/integration/actions_tasks_objects/case_24_delete_unlock_lock_object.js
0 → 100644
浏览文件 @
9bca5357
// Copyright (C) 2020 Intel Corporation
//
// SPDX-License-Identifier: MIT
/// <reference types="cypress" />
import
{
taskName
,
labelName
}
from
'
../../support/const
'
;
context
(
'
Delete unlock/lock object
'
,
()
=>
{
const
caseId
=
'
24
'
;
const
createRectangleShape2Points
=
{
points
:
'
By 2 Points
'
,
type
:
'
Shape
'
,
labelName
:
labelName
,
firstX
:
100
,
firstY
:
100
,
secondX
:
300
,
secondY
:
300
,
};
function
lockObject
()
{
cy
.
get
(
'
.cvat-objects-sidebar-state-item
'
).
within
(()
=>
{
cy
.
get
(
'
.cvat-object-item-button-lock
'
).
click
();
});
};
function
deleteObjectViaShortcut
(
shortcut
,
stateLockObject
)
{
if
(
stateLockObject
==
'
unlock
'
)
{
cy
.
get
(
'
.cvat-canvas-container
'
).
within
(()
=>
{
cy
.
get
(
'
.cvat_canvas_shape
'
)
.
trigger
(
'
mousemove
'
)
.
should
(
'
have.class
'
,
'
cvat_canvas_shape_activated
'
);
});
};
cy
.
get
(
'
body
'
)
.
type
(
shortcut
);
};
function
clickRemoveOnDropdownMenu
()
{
cy
.
get
(
'
.cvat-object-item-menu
'
)
.
contains
(
new
RegExp
(
'
^Remove$
'
,
'
g
'
))
.
click
({
force
:
true
});
};
function
deleteObjectViaGUIFromSidebar
()
{
cy
.
get
(
'
.cvat-objects-sidebar-states-list
'
).
within
(()
=>
{
cy
.
get
(
'
.cvat-objects-sidebar-state-item
'
).
within
(()
=>
{
cy
.
get
(
'
[aria-label="icon: more"]
'
).
click
();
});
});
clickRemoveOnDropdownMenu
();
};
function
deleteObjectViaGUIFromObject
()
{
cy
.
get
(
'
.cvat-canvas-container
'
).
within
(()
=>
{
cy
.
get
(
'
.cvat_canvas_shape
'
)
.
trigger
(
'
mousemove
'
)
.
rightclick
();
});
cy
.
get
(
'
.cvat-canvas-context-menu
'
).
within
(()
=>
{
cy
.
get
(
'
.cvat-objects-sidebar-state-item
'
).
within
(()
=>
{
cy
.
get
(
'
[aria-label="icon: more"]
'
).
click
();
});
});
clickRemoveOnDropdownMenu
();
};
function
actionOnConfirmWindow
(
textBuntton
)
{
cy
.
get
(
'
.cvat-modal-confirm
'
).
within
(()
=>
{
cy
.
contains
(
new
RegExp
(
`^
${
textBuntton
}
$`
,
'
g
'
))
.
click
();
});
};
function
checkFailDeleteLockObject
(
shortcut
)
{
deleteObjectViaShortcut
(
shortcut
,
'
lock
'
);
checkExistObject
(
'
exist
'
);
cy
.
get
(
'
.cvat-notification-notice-remove-object-failed
'
).
should
(
'
exist
'
);
};
function
checkExistObject
(
state
)
{
cy
.
get
(
'
.cvat_canvas_shape
'
).
should
(
state
);
cy
.
get
(
'
.cvat-objects-sidebar-state-item
'
).
should
(
state
);
};
before
(()
=>
{
cy
.
openTaskJob
(
taskName
);
});
describe
(
`Testing case "
${
caseId
}
"`
,
()
=>
{
it
(
'
Create and delete object via "Delete" shortcut
'
,
()
=>
{
cy
.
createRectangle
(
createRectangleShape2Points
);
deleteObjectViaShortcut
(
'
{del}
'
,
'
unlock
'
);
checkExistObject
(
'
not.exist
'
);
});
it
(
'
Create and delete object via GUI from sidebar
'
,
()
=>
{
cy
.
createRectangle
(
createRectangleShape2Points
);
deleteObjectViaGUIFromSidebar
();
checkExistObject
(
'
not.exist
'
);
});
it
(
'
Create, lock and delete object via "Shift+Delete" shortcuts
'
,
()
=>
{
cy
.
createRectangle
(
createRectangleShape2Points
);
lockObject
();
checkFailDeleteLockObject
(
'
{del}
'
);
deleteObjectViaShortcut
(
'
{shift}{del}
'
,
'
lock
'
);
checkExistObject
(
'
not.exist
'
);
});
it
(
'
Create, lock and delete object via GUI from sidebar
'
,
()
=>
{
cy
.
createRectangle
(
createRectangleShape2Points
);
lockObject
();
deleteObjectViaGUIFromSidebar
();
actionOnConfirmWindow
(
'
OK
'
);
checkExistObject
(
'
not.exist
'
);
});
it
(
'
Create, lock and cancel delete object via GUI from object
'
,
()
=>
{
cy
.
createRectangle
(
createRectangleShape2Points
);
lockObject
();
deleteObjectViaGUIFromObject
();
actionOnConfirmWindow
(
'
Cancel
'
);
checkExistObject
(
'
exist
'
);
});
});
});
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录