diff --git a/client/src/components/ProjectExternalAccessionsDetail.js b/client/src/components/ProjectExternalAccessionsDetail.js new file mode 100644 index 00000000..e477d99d --- /dev/null +++ b/client/src/components/ProjectExternalAccessionsDetail.js @@ -0,0 +1,25 @@ +import React from 'react' +import { Box } from 'grommet' +import { Link } from 'components/Link' + +export const ProjectExternalAccessionsDetail = ({ inline = false, externalAccessions }) => { + + // Comma separated list. + if (inline) { + return externalAccessions.map(({ accession, url }, i) => ( + + {i != 0 && ', '} + + + )) + } + + // One external accession per line. + return externalAccessions.map(({ accession, url }, i) => ( + + + + )) +} + +export default ProjectExternalAccessionsDetail diff --git a/client/src/components/ProjectSearchResult.js b/client/src/components/ProjectSearchResult.js index d4ab18ea..27879e29 100644 --- a/client/src/components/ProjectSearchResult.js +++ b/client/src/components/ProjectSearchResult.js @@ -5,6 +5,7 @@ import { Link } from 'components/Link' import { ProjectHeader } from 'components/ProjectHeader' import { ProjectAbstractDetail } from 'components/ProjectAbstractDetail' import { ProjectPublicationsDetail } from 'components/ProjectPublicationsDetail' +import { ProjectExternalAccessionsDetail } from 'components/ProjectExternalAccessionsDetail' export const ProjectSearchResult = ({ project }) => { const searchDetails = [ @@ -25,6 +26,14 @@ export const ProjectSearchResult = ({ project }) => { '' ) }, + { + title: 'Also deposited under', + value: project.external_accessions.length > 0 ? ( + + ) : ( + '' + ) + }, { title: 'Additional Sample Metadata Fields', value: project.additional_metadata_keys diff --git a/client/src/pages/projects/[scpca_id].js b/client/src/pages/projects/[scpca_id].js index 5a03b115..6fca7b8c 100644 --- a/client/src/pages/projects/[scpca_id].js +++ b/client/src/pages/projects/[scpca_id].js @@ -5,6 +5,7 @@ import { ProjectHeader } from 'components/ProjectHeader' import { DetailsTable } from 'components/DetailsTable' import { ProjectAbstractDetail } from 'components/ProjectAbstractDetail' import { ProjectPublicationsDetail } from 'components/ProjectPublicationsDetail' +import { ProjectExternalAccessionsDetail } from 'components/ProjectExternalAccessionsDetail' import { ProjectSamplesTable } from 'components/ProjectSamplesTable' import { ProjectSamplesSummaryTable } from 'components/ProjectSamplesSummaryTable' import { Link } from 'components/Link' @@ -49,6 +50,17 @@ const Project = ({ project }) => { '' ) }, + { + label: 'Also deposited under', + value: + project.external_accessions.length > 0 ? ( + + ) : ( + '' + ) + }, { label: 'DOI', value: