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

* Fixed issue when save filtered object in AAM

* Updated version & changelog
main
Boris Sekachev 5 years ago committed by GitHub
parent de2ce7e867
commit 719fcf30bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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>) - 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 - 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>) (<https://github.com/openvinotoolkit/cvat/pull/3379>)
- Fixed issue when save filtered object in AAM (<https://github.com/openvinotoolkit/cvat/pull/3401>)
### Security ### Security

@ -1,6 +1,6 @@
{ {
"name": "cvat-ui", "name": "cvat-ui",
"version": "1.20.6", "version": "1.20.7",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {

@ -1,6 +1,6 @@
{ {
"name": "cvat-ui", "name": "cvat-ui",
"version": "1.20.6", "version": "1.20.7",
"description": "CVAT single-page application", "description": "CVAT single-page application",
"main": "src/index.tsx", "main": "src/index.tsx",
"scripts": { "scripts": {

@ -20,6 +20,12 @@ import {
Workspace, Workspace,
} from './interfaces'; } 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 = { const defaultState: AnnotationState = {
activities: { activities: {
loads: {}, loads: {},
@ -252,6 +258,7 @@ export default (state = defaultState, action: AnyAction): AnnotationState => {
}; };
} }
case AnnotationActionTypes.CHANGE_FRAME_SUCCESS: { case AnnotationActionTypes.CHANGE_FRAME_SUCCESS: {
const { activatedStateID } = state.annotations;
const { const {
number, number,
data, data,
@ -265,12 +272,6 @@ export default (state = defaultState, action: AnyAction): AnnotationState => {
changeTime, changeTime,
} = action.payload; } = action.payload;
const activatedStateID = states
.map((_state: any) => _state.clientID)
.includes(state.annotations.activatedStateID) ?
state.annotations.activatedStateID :
null;
return { return {
...state, ...state,
player: { player: {
@ -291,7 +292,7 @@ export default (state = defaultState, action: AnyAction): AnnotationState => {
}, },
annotations: { annotations: {
...state.annotations, ...state.annotations,
activatedStateID, activatedStateID: updateActivatedStateID(states, activatedStateID),
states, states,
zLayer: { zLayer: {
min: minZ, min: minZ,
@ -343,11 +344,14 @@ export default (state = defaultState, action: AnyAction): AnnotationState => {
} }
case AnnotationActionTypes.SAVE_ANNOTATIONS_SUCCESS: { case AnnotationActionTypes.SAVE_ANNOTATIONS_SUCCESS: {
const { states } = action.payload; const { states } = action.payload;
const { activatedStateID } = state.annotations;
return { return {
...state, ...state,
annotations: { annotations: {
...state.annotations, ...state.annotations,
states, states,
activatedStateID: updateActivatedStateID(states, activatedStateID),
saving: { saving: {
...state.annotations.saving, ...state.annotations.saving,
uploading: false, uploading: false,
@ -964,21 +968,16 @@ export default (state = defaultState, action: AnyAction): AnnotationState => {
} }
case AnnotationActionTypes.REDO_ACTION_SUCCESS: case AnnotationActionTypes.REDO_ACTION_SUCCESS:
case AnnotationActionTypes.UNDO_ACTION_SUCCESS: { case AnnotationActionTypes.UNDO_ACTION_SUCCESS: {
const { activatedStateID } = state.annotations;
const { const {
history, states, minZ, maxZ, history, states, minZ, maxZ,
} = action.payload; } = action.payload;
const activatedStateID = states
.map((_state: any) => _state.clientID)
.includes(state.annotations.activatedStateID) ?
state.annotations.activatedStateID :
null;
return { return {
...state, ...state,
annotations: { annotations: {
...state.annotations, ...state.annotations,
activatedStateID, activatedStateID: updateActivatedStateID(states, activatedStateID),
states, states,
history, history,
zLayer: { zLayer: {
@ -990,18 +989,14 @@ export default (state = defaultState, action: AnyAction): AnnotationState => {
}; };
} }
case AnnotationActionTypes.FETCH_ANNOTATIONS_SUCCESS: { case AnnotationActionTypes.FETCH_ANNOTATIONS_SUCCESS: {
const { activatedStateID } = state.annotations;
const { states, minZ, maxZ } = action.payload; const { states, minZ, maxZ } = action.payload;
const activatedStateID = states
.map((_state: any) => _state.clientID)
.includes(state.annotations.activatedStateID) ?
state.annotations.activatedStateID :
null;
return { return {
...state, ...state,
annotations: { annotations: {
...state.annotations, ...state.annotations,
activatedStateID, activatedStateID: updateActivatedStateID(states, activatedStateID),
states, states,
zLayer: { zLayer: {
min: minZ, min: minZ,

Loading…
Cancel
Save