Make sure there are more than 1 values in a category before rendering it (#1871)

This commit is contained in:
maniarathi
2020-09-29 15:32:21 -07:00
committed by GitHub
parent 7bee09cd16
commit 4aabb8e092
+3 -1
View File
@@ -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) ? (
<Category
key={catName}
metadataField={catName}