Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
疯人忠
Cvat
提交
b7da49d7
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,发现更多精彩内容 >>
未验证
提交
b7da49d7
编写于
11月 19, 2020
作者:
B
Boris Sekachev
提交者:
GitHub
11月 19, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #2445 from openvinotoolkit/dk/cvat-core-pacth-requests-fix
Partly update fields with PATCH requests
上级
d1679fcb
c1efd370
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
85 addition
and
13 deletion
+85
-13
CHANGELOG.md
CHANGELOG.md
+1
-1
cvat-core/package-lock.json
cvat-core/package-lock.json
+1
-1
cvat-core/package.json
cvat-core/package.json
+1
-1
cvat-core/src/session.js
cvat-core/src/session.js
+82
-10
未找到文件。
CHANGELOG.md
浏览文件 @
b7da49d7
...
...
@@ -13,7 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
-
-
PATCH requests from cvat-core submit only changed fields (
<https://github.com/openvinotoolkit/cvat/pull/2445>
)
### Deprecated
...
...
cvat-core/package-lock.json
浏览文件 @
b7da49d7
{
"name": "cvat-core",
"version": "3.9.
0
",
"version": "3.9.
1
",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
...
...
cvat-core/package.json
浏览文件 @
b7da49d7
{
"name"
:
"cvat-core"
,
"version"
:
"3.9.
0
"
,
"version"
:
"3.9.
1
"
,
"description"
:
"Part of Computer Vision Tool which presents an interface for client-side integration"
,
"main"
:
"babel.config.js"
,
"scripts"
:
{
...
...
cvat-core/src/session.js
浏览文件 @
b7da49d7
...
...
@@ -674,6 +674,11 @@
task
:
undefined
,
};
let
updatedFields
=
{
assignee
:
false
,
status
:
false
,
};
for
(
const
property
in
data
)
{
if
(
Object
.
prototype
.
hasOwnProperty
.
call
(
data
,
property
))
{
if
(
property
in
initialData
)
{
...
...
@@ -715,6 +720,7 @@
if
(
assignee
!==
null
&&
!
(
assignee
instanceof
User
))
{
throw
new
ArgumentError
(
'
Value must be a user instance
'
);
}
updatedFields
.
assignee
=
true
;
data
.
assignee
=
assignee
;
},
},
...
...
@@ -743,6 +749,7 @@
);
}
updatedFields
.
status
=
true
;
data
.
status
=
status
;
},
},
...
...
@@ -776,6 +783,12 @@
task
:
{
get
:
()
=>
data
.
task
,
},
__updatedFields
:
{
get
:
()
=>
updatedFields
,
set
:
(
fields
)
=>
{
updatedFields
=
fields
;
},
},
}),
);
...
...
@@ -879,6 +892,13 @@
use_cache
:
undefined
,
};
let
updatedFields
=
{
name
:
false
,
assignee
:
false
,
bug_tracker
:
false
,
labels
:
false
,
};
for
(
const
property
in
data
)
{
if
(
Object
.
prototype
.
hasOwnProperty
.
call
(
data
,
property
)
&&
property
in
initialData
)
{
data
[
property
]
=
initialData
[
property
];
...
...
@@ -948,6 +968,7 @@
if
(
!
value
.
trim
().
length
)
{
throw
new
ArgumentError
(
'
Value must not be empty
'
);
}
updatedFields
.
name
=
true
;
data
.
name
=
value
;
},
},
...
...
@@ -1006,6 +1027,7 @@
if
(
assignee
!==
null
&&
!
(
assignee
instanceof
User
))
{
throw
new
ArgumentError
(
'
Value must be a user instance
'
);
}
updatedFields
.
assignee
=
true
;
data
.
assignee
=
assignee
;
},
},
...
...
@@ -1039,6 +1061,7 @@
bugTracker
:
{
get
:
()
=>
data
.
bug_tracker
,
set
:
(
tracker
)
=>
{
updatedFields
.
bug_tracker
=
true
;
data
.
bug_tracker
=
tracker
;
},
},
...
...
@@ -1145,6 +1168,7 @@
}
}
updatedFields
.
labels
=
true
;
data
.
labels
=
[...
labels
];
},
},
...
...
@@ -1311,6 +1335,12 @@
dataChunkType
:
{
get
:
()
=>
data
.
data_compressed_chunk_type
,
},
__updatedFields
:
{
get
:
()
=>
updatedFields
,
set
:
(
fields
)
=>
{
updatedFields
=
fields
;
},
},
}),
);
...
...
@@ -1443,12 +1473,30 @@
Job
.
prototype
.
save
.
implementation
=
async
function
()
{
// TODO: Add ability to change an assignee
if
(
this
.
id
)
{
const
jobData
=
{
status
:
this
.
status
,
assignee_id
:
this
.
assignee
?
this
.
assignee
.
id
:
null
,
};
const
jobData
=
{};
for
(
const
[
field
,
isUpdated
]
of
Object
.
entries
(
this
.
__updatedFields
))
{
if
(
isUpdated
)
{
switch
(
field
)
{
case
'
status
'
:
jobData
.
status
=
this
.
status
;
break
;
case
'
assignee
'
:
jobData
.
assignee_id
=
this
.
assignee
?
this
.
assignee
.
id
:
null
;
break
;
default
:
break
;
}
}
}
await
serverProxy
.
jobs
.
saveJob
(
this
.
id
,
jobData
);
this
.
__updatedFields
=
{
status
:
false
,
assignee
:
false
,
};
return
this
;
}
...
...
@@ -1653,14 +1701,38 @@
// TODO: Add ability to change an owner and an assignee
if
(
typeof
this
.
id
!==
'
undefined
'
)
{
// If the task has been already created, we update it
const
taskData
=
{
assignee_id
:
this
.
assignee
?
this
.
assignee
.
id
:
null
,
name
:
this
.
name
,
bug_tracker
:
this
.
bugTracker
,
labels
:
[...
this
.
labels
.
map
((
el
)
=>
el
.
toJSON
())],
};
const
taskData
=
{};
for
(
const
[
field
,
isUpdated
]
of
Object
.
entries
(
this
.
__updatedFields
))
{
if
(
isUpdated
)
{
switch
(
field
)
{
case
'
assignee
'
:
taskData
.
assignee_id
=
this
.
assignee
?
this
.
assignee
.
id
:
null
;
break
;
case
'
name
'
:
taskData
.
name
=
this
.
name
;
break
;
case
'
bug_tracker
'
:
taskData
.
bug_tracker
=
this
.
bugTracker
;
break
;
case
'
labels
'
:
taskData
.
labels
=
[...
this
.
labels
.
map
((
el
)
=>
el
.
toJSON
())];
break
;
default
:
break
;
}
}
}
await
serverProxy
.
tasks
.
saveTask
(
this
.
id
,
taskData
);
this
.
updatedFields
=
{
assignee
:
false
,
name
:
false
,
bugTracker
:
false
,
labels
:
false
,
};
return
this
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录