From 8b27dbe61327845ce8cddf733c0f557b41d4a81e Mon Sep 17 00:00:00 2001 From: Dmitry Kalinin Date: Wed, 11 Mar 2020 14:16:55 +0300 Subject: [PATCH] Fixed tags color changing and hiding --- cvat-core/src/annotations-objects.js | 5 +++ .../objects-side-bar/object-item.tsx | 37 +++++++------------ .../objects-side-bar/objects-list.tsx | 4 +- 3 files changed, 22 insertions(+), 24 deletions(-) diff --git a/cvat-core/src/annotations-objects.js b/cvat-core/src/annotations-objects.js index 65a30b56..245d8e37 100644 --- a/cvat-core/src/annotations-objects.js +++ b/cvat-core/src/annotations-objects.js @@ -1139,6 +1139,7 @@ attributes: { ...this.attributes }, label: this.label, group: this.groupObject, + color: this.color, updated: this.updated, frame, }; @@ -1171,6 +1172,10 @@ this._saveLock(data.lock); } + if (updated.color) { + this._saveColor(data.color); + } + this.updateTimestamp(updated); updated.reset(); diff --git a/cvat-ui/src/components/annotation-page/standard-workspace/objects-side-bar/object-item.tsx b/cvat-ui/src/components/annotation-page/standard-workspace/objects-side-bar/object-item.tsx index fbe21a8d..72e2d0e6 100644 --- a/cvat-ui/src/components/annotation-page/standard-workspace/objects-side-bar/object-item.tsx +++ b/cvat-ui/src/components/annotation-page/standard-workspace/objects-side-bar/object-item.tsx @@ -719,30 +719,21 @@ function ObjectItemComponent(props: Props): JSX.Element { return (
- { - objectType !== ObjectType.TAG ? ( - - )} - > -
- - ) : ( -
- ) - } - + )} + > +
+
{ const { clientID, lock } = objectState; if (!lock) { - statesHidden = statesHidden && objectState.hidden; + if (objectState.objectType !== ObjectType.TAG) { + statesHidden = statesHidden && objectState.hidden; + } statesLocked = statesLocked && objectState.lock; } const stateCollapsed = clientID in collapsed ? collapsed[clientID] : true;