From 8b329630f8a00a5affa86262f372363619ff53af Mon Sep 17 00:00:00 2001 From: Bruce Martin Date: Thu, 16 Jan 2020 09:28:29 -0800 Subject: [PATCH] fix for issue 1112 - all user annotation category names must be unique across all obs annotatoins (#1114) --- client/src/components/categorical/categorical.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/client/src/components/categorical/categorical.js b/client/src/components/categorical/categorical.js index b5556c0f..31f3d370 100644 --- a/client/src/components/categorical/categorical.js +++ b/client/src/components/categorical/categorical.js @@ -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);