未验证 提交 277a3bad 编写于 作者: D Dmitry Kalinin 提交者: GitHub

Fixed project search field (#2901)

* Fixed project search field clearing

* Added CHANGELOG and incresed npm package version
上级 9b62b71a
......@@ -62,6 +62,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Prevented creating several issues for the same object (<https://github.com/openvinotoolkit/cvat/pull/2868>)
- Fixed label editor name field validator (<https://github.com/openvinotoolkit/cvat/pull/2879>)
- An error about track shapes outside of the task frames during export (<https://github.com/openvinotoolkit/cvat/pull/2890>)
- Fixed project search field updating (<https://github.com/openvinotoolkit/cvat/pull/2901>)
### Security
......
{
"name": "cvat-ui",
"version": "1.15.2",
"version": "1.15.3",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
{
"name": "cvat-ui",
"version": "1.15.2",
"version": "1.15.3",
"description": "CVAT single-page application",
"main": "src/index.tsx",
"scripts": {
......
......@@ -59,19 +59,23 @@ export default function ProjectSearchField(props: Props): JSX.Element {
};
useEffect(() => {
if (value && !projects.filter((project) => project.id === value).length) {
core.projects.get({ id: value }).then((result: Project[]) => {
const [project] = result;
setProjects([
...projects,
{
id: project.id,
name: project.name,
},
]);
setSearchPhrase(project.name);
onSelect(project.id);
});
if (value) {
if (!projects.filter((project) => project.id === value).length) {
core.projects.get({ id: value }).then((result: Project[]) => {
const [project] = result;
setProjects([
...projects,
{
id: project.id,
name: project.name,
},
]);
setSearchPhrase(project.name);
onSelect(project.id);
});
}
} else {
setSearchPhrase('');
}
}, [value]);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册