categorical UI improvements (#1649)

* return undefined for unknown fields

* memoize fetch response

* handle rename of user annotation

* performance and cleanup

* fix snapshots

* fix comment

* lint
This commit is contained in:
Bruce Martin
2020-07-20 08:52:41 -07:00
committed by GitHub
parent 410566f5e1
commit 2715157793
13 changed files with 274 additions and 229 deletions
+12
View File
@@ -33,6 +33,18 @@ const ColorsReducer = (
return state;
}
case "annotation: category edited": {
const { colorAccessor } = state;
if (action.metadataField !== colorAccessor) {
return state;
}
/* else update colorAccessor */
return {
...state,
colorAccessor: action.newCategoryText,
};
}
case "annotation: delete category": {
const { colorAccessor } = state;
if (action.metadataField !== colorAccessor) {