From 3e9cb0265e045e7f609620db4c0a185a03333058 Mon Sep 17 00:00:00 2001 From: Severiano Badajoz Date: Tue, 15 Sep 2020 12:03:59 -0700 Subject: [PATCH] Fix InfoFormat parameter checking (#1831) Went through and ensured that undefined/null values were caught and handled correctly in render functions. Also documented some of the more complicated functions. --- Closes #1825 --- .../src/components/infoDrawer/infoFormat.js | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/client/src/components/infoDrawer/infoFormat.js b/client/src/components/infoDrawer/infoFormat.js index 5a3db6a5..8361b6de 100644 --- a/client/src/components/infoDrawer/infoFormat.js +++ b/client/src/components/infoDrawer/infoFormat.js @@ -3,7 +3,7 @@ import React from "react"; const renderContributors = (contributors, affiliations, skeleton) => { // eslint-disable-next-line no-constant-condition -- Temp removed contributor section to avoid publishing PII - if (contributors?.length === 0 && true) return null; + if (!contributors || contributors.length === 0 || true) return null; return ( <>

Contributors

@@ -25,6 +25,7 @@ const renderContributors = (contributors, affiliations, skeleton) => { ); }; +// generates a list of unique institutions by order of appearance in contributors const buildAffiliations = (contributors = []) => { const affiliations = []; contributors.forEach((contributor) => { @@ -43,11 +44,7 @@ const renderAffiliations = (affiliations, skeleton) => {

Affiliations