未验证 提交 719fcf30 编写于 作者: B Boris Sekachev 提交者: GitHub

Fixed issue when save filtered object in AAM (#3401)

* Fixed issue when save filtered object in AAM

* Updated version & changelog
上级 de2ce7e8
......@@ -45,6 +45,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Calculate precise progress of decoding a video file (<https://github.com/openvinotoolkit/cvat/pull/3381>)
- Falsely successful `cvat_ui` image build in case of OOM error that leads to the default nginx welcome page
(<https://github.com/openvinotoolkit/cvat/pull/3379>)
- Fixed issue when save filtered object in AAM (<https://github.com/openvinotoolkit/cvat/pull/3401>)
### Security
......
{
"name": "cvat-ui",
"version": "1.20.6",
"version": "1.20.7",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
{
"name": "cvat-ui",
"version": "1.20.6",
"version": "1.20.7",
"description": "CVAT single-page application",
"main": "src/index.tsx",
"scripts": {
......
......@@ -20,6 +20,12 @@ import {
Workspace,
} from './interfaces';
function updateActivatedStateID(newStates: any[], prevActivatedStateID: number | null): number | null {
return prevActivatedStateID === null || newStates.some((_state: any) => _state.clientID === prevActivatedStateID) ?
prevActivatedStateID :
null;
}
const defaultState: AnnotationState = {
activities: {
loads: {},
......@@ -252,6 +258,7 @@ export default (state = defaultState, action: AnyAction): AnnotationState => {
};
}
case AnnotationActionTypes.CHANGE_FRAME_SUCCESS: {
const { activatedStateID } = state.annotations;
const {
number,
data,
......@@ -265,12 +272,6 @@ export default (state = defaultState, action: AnyAction): AnnotationState => {
changeTime,
} = action.payload;
const activatedStateID = states
.map((_state: any) => _state.clientID)
.includes(state.annotations.activatedStateID) ?
state.annotations.activatedStateID :
null;
return {
...state,
player: {
......@@ -291,7 +292,7 @@ export default (state = defaultState, action: AnyAction): AnnotationState => {
},
annotations: {
...state.annotations,
activatedStateID,
activatedStateID: updateActivatedStateID(states, activatedStateID),
states,
zLayer: {
min: minZ,
......@@ -343,11 +344,14 @@ export default (state = defaultState, action: AnyAction): AnnotationState => {
}
case AnnotationActionTypes.SAVE_ANNOTATIONS_SUCCESS: {
const { states } = action.payload;
const { activatedStateID } = state.annotations;
return {
...state,
annotations: {
...state.annotations,
states,
activatedStateID: updateActivatedStateID(states, activatedStateID),
saving: {
...state.annotations.saving,
uploading: false,
......@@ -964,21 +968,16 @@ export default (state = defaultState, action: AnyAction): AnnotationState => {
}
case AnnotationActionTypes.REDO_ACTION_SUCCESS:
case AnnotationActionTypes.UNDO_ACTION_SUCCESS: {
const { activatedStateID } = state.annotations;
const {
history, states, minZ, maxZ,
} = action.payload;
const activatedStateID = states
.map((_state: any) => _state.clientID)
.includes(state.annotations.activatedStateID) ?
state.annotations.activatedStateID :
null;
return {
...state,
annotations: {
...state.annotations,
activatedStateID,
activatedStateID: updateActivatedStateID(states, activatedStateID),
states,
history,
zLayer: {
......@@ -990,18 +989,14 @@ export default (state = defaultState, action: AnyAction): AnnotationState => {
};
}
case AnnotationActionTypes.FETCH_ANNOTATIONS_SUCCESS: {
const { activatedStateID } = state.annotations;
const { states, minZ, maxZ } = action.payload;
const activatedStateID = states
.map((_state: any) => _state.clientID)
.includes(state.annotations.activatedStateID) ?
state.annotations.activatedStateID :
null;
return {
...state,
annotations: {
...state.annotations,
activatedStateID,
activatedStateID: updateActivatedStateID(states, activatedStateID),
states,
zLayer: {
min: minZ,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册