From 4aabb8e0927153aa90365a04d831fee64e583e62 Mon Sep 17 00:00:00 2001 From: maniarathi Date: Tue, 29 Sep 2020 15:32:21 -0700 Subject: [PATCH] Make sure there are more than 1 values in a category before rendering it (#1871) --- client/src/components/categorical/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client/src/components/categorical/index.js b/client/src/components/categorical/index.js index 99ccbfcd..5003ab8c 100644 --- a/client/src/components/categorical/index.js +++ b/client/src/components/categorical/index.js @@ -185,7 +185,9 @@ class Categories extends React.Component { {/* READ ONLY CATEGORICAL FIELDS */} {/* this is duplicative but flat, could be abstracted */} {allCategoryNames.map((catName) => - !schema.annotations.obsByName[catName].writable ? ( + !schema.annotations.obsByName[catName].writable && + (schema.annotations.obsByName[catName].categories?.length > 1 || + !schema.annotations.obsByName[catName].categories) ? (