Skip to content

Commit

Permalink
John conroy/publication authors (#3058)
Browse files Browse the repository at this point in the history
* Update contributors to handle missing orcid id

* Add contributors to publication

* Add changelog

---------

Co-authored-by: John Conroy <[email protected]>
  • Loading branch information
john-conroy and john-conroy authored Mar 25, 2023
1 parent 327a8dd commit 7b7d3d5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
1 change: 1 addition & 0 deletions CHANGELOG-publication-authors.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Add authors section to publication page.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function ContributorsTable({ title, contributors }) {
];

return (
<DetailPageSection id="contributors">
<DetailPageSection id={title}>
<SectionHeader>{title}</SectionHeader>
<Paper>
<StyledTableContainer>
Expand All @@ -37,14 +37,16 @@ function ContributorsTable({ title, contributors }) {
</TableRow>
</TableHead>
<TableBody>
{contributors.map((row) => (
<TableRow key={row.orcid_id}>
<TableCell>{row.name}</TableCell>
<TableCell>{row.affiliation}</TableCell>
{contributors.map(({ orcid_id, name, affiliation }) => (
<TableRow key={orcid_id}>
<TableCell>{name}</TableCell>
<TableCell>{affiliation}</TableCell>
<TableCell>
<OutboundIconLink href={`https://orcid.org/${row.orcid_id}`} variant="body2">
{row.orcid_id}
</OutboundIconLink>
{orcid_id && (
<OutboundIconLink href={`https://orcid.org/${orcid_id}`} variant="body2">
{orcid_id}
</OutboundIconLink>
)}
</TableCell>
</TableRow>
))}
Expand Down
4 changes: 3 additions & 1 deletion context/app/static/js/pages/Publication/Publication.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import Summary from 'js/components/detailPage/summary/Summary';
import SummaryItem from 'js/components/detailPage/summary/SummaryItem';
import OutboundIconLink from 'js/shared-styles/Links/iconLinks/OutboundIconLink';
import { getCombinedDatasetStatus } from 'js/components/detailPage/utils';

import PublicationRelatedEntities from 'js/components/publications/PublicationRelatedEntities';
import ContributorsTable from 'js/components/detailPage/ContributorsTable/ContributorsTable';

function Publication({ publication }) {
const {
Expand All @@ -22,6 +22,7 @@ function Publication({ publication }) {
mapped_data_access_level,
mapped_external_group_name,
doi_url,
contributors,
} = publication;

const combinedStatus = getCombinedDatasetStatus({ sub_status, status });
Expand All @@ -47,6 +48,7 @@ function Publication({ publication }) {
{hasDOI && <OutboundIconLink href={doi_url}>{doi_url}</OutboundIconLink>}
</Summary>
<PublicationRelatedEntities uuid={uuid} />
<ContributorsTable contributors={contributors} title="Authors" />
</>
);
}
Expand Down

0 comments on commit 7b7d3d5

Please sign in to comment.