ensure there is always an unassigned label in user created category (#1644)

This commit is contained in:
Bruce Martin
2020-07-17 13:22:26 -07:00
committed by GitHub
parent 7b99d1a1b8
commit b6412b5b8a
+4
View File
@@ -48,6 +48,10 @@ export const annotationCreateCategoryAction = (
const col = catToDupDf.col(categoryToDuplicate);
initialValue = col.asArray();
({ categories } = col.summarize());
// all user-created annotations must have the unassigned category
if (!categories.includes(globals.unassignedCategoryLabel)) {
categories.push(globals.unassignedCategoryLabel);
}
} else {
/* else assign to the standard default value */
initialValue = globals.unassignedCategoryLabel;