fix for issue 1112 - all user annotation category names must be unique across all obs annotatoins (#1114)

This commit is contained in:
Bruce Martin
2020-01-16 09:28:29 -08:00
committed by GitHub
parent 30f3ce49e4
commit 8b329630f8

View File

@@ -71,8 +71,12 @@ class Categories extends React.Component {
/* allow empty string */
if (name === "") return false;
const { categoricalSelection } = this.props;
const allCategoryNames = Object.keys(categoricalSelection);
/*
test for uniqueness against *all* annotation names, not just the subset
we render as categorical.
*/
const { schema } = this.props;
const allCategoryNames = schema.annotations.obs.columns.map(c => c.name);
/* check category name syntax */
const error = AnnotationsHelpers.annotationNameIsErroneous(name);