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 ( <>
- - {doi} - -
- > - ) + <> ++ + {doi} + +
+ > ); }; @@ -84,6 +79,8 @@ const renderOrganism = (organism, skeleton) => { ); }; +// Render list of metadata attributes found in categorical field +// Ignores categories with empty or null values const renderSingleValueCategories = (singleValueCategories, skeleton) => { if (singleValueCategories.size === 0) return null; return ( @@ -104,6 +101,8 @@ const renderSingleValueCategories = (singleValueCategories, skeleton) => { ); }; +// Renders any links found in the config where link_type is not "SUMMARY" +// If there are no links in the config, render the aboutURL const renderLinks = (projectLinks, aboutURL, skeleton) => { if (!projectLinks && !aboutURL) return null; if (projectLinks) @@ -147,6 +146,7 @@ const renderLinks = (projectLinks, aboutURL, skeleton) => { const NUM_CATEGORIES = 8; +// Generates arbitrary placeholder array for singleValueCategories skeleton shape const singleValueCategoriesPlaceholder = Array.from(Array(NUM_CATEGORIES)).map( (_, index) => { return [index, index];