undo/redo cleanup (#1165)

* fix refactoring error which disabled annotation file clearing

* fix undo behavior on add category label

* fix various undo/redo bugs

* remove logging

* further refinement of annotation undo/redo and actions

* address PR comment
This commit is contained in:
Bruce Martin
2020-02-24 18:51:26 -07:00
committed by GitHub
parent 5c70cc5bcd
commit 7bc58bba2b
10 changed files with 75 additions and 60 deletions
-21
View File
@@ -80,15 +80,6 @@ const Annotations = (
isAddingNewLabel: false,
categoryAddingNewLabel: null
};
/* this handles both cases, since at this point it's just a string */
case "annotation: add new label to category":
return {
...state,
isAddingNewLabel: false,
categoryAddingNewLabel: null,
isAddingNewLabelFromOntology: false,
categoryAddingNewLabelFromOntology: null
};
case "annotation: activate category edit mode":
return {
...state,
@@ -101,12 +92,6 @@ const Annotations = (
isEditingCategoryName: false,
categoryBeingEdited: null
};
case "annotation: category edited":
return {
...state,
isEditingCategoryName: false,
categoryBeingEdited: null
};
/* LABEL */
case "annotation: activate edit label mode":
@@ -124,12 +109,6 @@ const Annotations = (
isEditingLabelName: false,
labelEditable: { category: null, label: null }
};
case "annotation: label edited":
return {
...state,
isEditingLabelName: false,
labelEditable: { category: null, label: null }
};
default:
return state;
}