Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

John conroy/publication authors #3058

Merged
merged 3 commits into from
Mar 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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