From 99de4034da9ee1e35abe1a42c3c4ded06373f304 Mon Sep 17 00:00:00 2001 From: Nikolay Akhmetov Date: Mon, 17 Jul 2023 09:21:34 -0400 Subject: [PATCH] Restore display of publication status for preprints (#3178) --- CHANGELOG-fix-missing-preprint-info.md | 1 + .../detailPage/summary/SummaryData/SummaryData.jsx | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 CHANGELOG-fix-missing-preprint-info.md diff --git a/CHANGELOG-fix-missing-preprint-info.md b/CHANGELOG-fix-missing-preprint-info.md new file mode 100644 index 0000000000..e25328179b --- /dev/null +++ b/CHANGELOG-fix-missing-preprint-info.md @@ -0,0 +1 @@ +- Restore display of publication status for preprints. \ No newline at end of file diff --git a/context/app/static/js/components/detailPage/summary/SummaryData/SummaryData.jsx b/context/app/static/js/components/detailPage/summary/SummaryData/SummaryData.jsx index e2d17fa0ca..3f0a3c18fe 100644 --- a/context/app/static/js/components/detailPage/summary/SummaryData/SummaryData.jsx +++ b/context/app/static/js/components/detailPage/summary/SummaryData/SummaryData.jsx @@ -12,7 +12,10 @@ import SummaryItem from 'js/components/detailPage/summary/SummaryItem'; import StatusIcon from 'js/components/detailPage/StatusIcon'; import { FlexEnd, JsonButton, StyledTypography } from './style'; -const datasetEntityTypes = ['Dataset', 'Support', 'Publication']; +const datasetEntityTypes = ['Dataset', 'Support', 'Publication', 'Preprint']; +const publicationEntityTypes = ['Publication', 'Preprint']; + +const entitiesWithStatus = datasetEntityTypes.concat(...publicationEntityTypes); function SummaryData({ entity_type, @@ -24,7 +27,7 @@ function SummaryData({ children, mapped_external_group_name, }) { - const isPublication = entity_type === 'Publication'; + const isPublication = publicationEntityTypes.includes(entity_type); const LeftTextContainer = isPublication ? React.Fragment : 'div'; return ( <> @@ -40,7 +43,7 @@ function SummaryData({ } buttons={ - {datasetEntityTypes.includes(entity_type) && ( + {entitiesWithStatus.includes(entity_type) && ( <> }>{status} {`${mapped_data_access_level} Access`}