From 39b858123ee738f849229151d4284a8e4d22ee73 Mon Sep 17 00:00:00 2001 From: David Mejia Date: Fri, 10 Nov 2023 16:33:10 -0500 Subject: [PATCH 1/8] add support for displaying external accessions --- .../ProjectExternalAccessionsDetail.js | 25 +++++++++++++++++++ client/src/components/ProjectSearchResult.js | 9 +++++++ client/src/pages/projects/[scpca_id].js | 12 +++++++++ 3 files changed, 46 insertions(+) create mode 100644 client/src/components/ProjectExternalAccessionsDetail.js 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: From 6f09961c5fa6c84fdad9088fb5c69b955a982c1e Mon Sep 17 00:00:00 2001 From: David Mejia Date: Fri, 10 Nov 2023 16:43:01 -0500 Subject: [PATCH 2/8] fix inequality operator --- client/src/components/ProjectExternalAccessionsDetail.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/components/ProjectExternalAccessionsDetail.js b/client/src/components/ProjectExternalAccessionsDetail.js index e477d99d..777bbc1e 100644 --- a/client/src/components/ProjectExternalAccessionsDetail.js +++ b/client/src/components/ProjectExternalAccessionsDetail.js @@ -8,7 +8,7 @@ export const ProjectExternalAccessionsDetail = ({ inline = false, externalAccess if (inline) { return externalAccessions.map(({ accession, url }, i) => ( - {i != 0 && ', '} + {i !== 0 && ', '} )) From f41cb93f57b9a8caf2590cb7e37c62878c855b58 Mon Sep 17 00:00:00 2001 From: David Mejia Date: Fri, 10 Nov 2023 16:50:08 -0500 Subject: [PATCH 3/8] remove middle alignment on table --- client/src/theme/table.js | 1 - 1 file changed, 1 deletion(-) diff --git a/client/src/theme/table.js b/client/src/theme/table.js index b7a4baef..5dd95758 100644 --- a/client/src/theme/table.js +++ b/client/src/theme/table.js @@ -37,7 +37,6 @@ export default { tr td, tr th { background-color: #fff; box-shadow: 1px 0 0 0 #ccc inset, 0 1px 0 0 #ccc inset; - vertical-align: middle; } tr th { box-shadow: 1px 0 0 0 #ccc inset, From 85a4ad8bee2dc05526251b3499efea7b05fa42da Mon Sep 17 00:00:00 2001 From: David Mejia Date: Fri, 10 Nov 2023 16:53:23 -0500 Subject: [PATCH 4/8] prettier --- client/src/components/ProjectSearchResult.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/client/src/components/ProjectSearchResult.js b/client/src/components/ProjectSearchResult.js index 27879e29..2c34eda3 100644 --- a/client/src/components/ProjectSearchResult.js +++ b/client/src/components/ProjectSearchResult.js @@ -29,7 +29,10 @@ export const ProjectSearchResult = ({ project }) => { { title: 'Also deposited under', value: project.external_accessions.length > 0 ? ( - + ) : ( '' ) From 868a9cbc4ed114a54579e20bde0383259a217367 Mon Sep 17 00:00:00 2001 From: David Mejia Date: Fri, 10 Nov 2023 17:00:08 -0500 Subject: [PATCH 5/8] even prettier --- client/src/components/ProjectSearchResult.js | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/client/src/components/ProjectSearchResult.js b/client/src/components/ProjectSearchResult.js index 2c34eda3..20cb325e 100644 --- a/client/src/components/ProjectSearchResult.js +++ b/client/src/components/ProjectSearchResult.js @@ -28,14 +28,15 @@ export const ProjectSearchResult = ({ project }) => { }, { title: 'Also deposited under', - value: project.external_accessions.length > 0 ? ( - - ) : ( - '' - ) + value: + project.external_accessions.length > 0 ? ( + + ) : ( + '' + ) }, { title: 'Additional Sample Metadata Fields', From 618d4a50d6617591f73a42ac2e681a2ceb2d07c4 Mon Sep 17 00:00:00 2001 From: David Mejia Date: Fri, 10 Nov 2023 17:11:38 -0500 Subject: [PATCH 6/8] add defaults for listed details --- client/src/components/ProjectExternalAccessionsDetail.js | 5 ++++- client/src/components/ProjectPublicationsDetail.js | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/client/src/components/ProjectExternalAccessionsDetail.js b/client/src/components/ProjectExternalAccessionsDetail.js index 777bbc1e..2a4daaec 100644 --- a/client/src/components/ProjectExternalAccessionsDetail.js +++ b/client/src/components/ProjectExternalAccessionsDetail.js @@ -2,7 +2,10 @@ import React from 'react' import { Box } from 'grommet' import { Link } from 'components/Link' -export const ProjectExternalAccessionsDetail = ({ inline = false, externalAccessions }) => { +export const ProjectExternalAccessionsDetail = ({ + inline = false, + externalAccessions = [] +}) => { // Comma separated list. if (inline) { diff --git a/client/src/components/ProjectPublicationsDetail.js b/client/src/components/ProjectPublicationsDetail.js index aa5c8d7f..922bc21a 100644 --- a/client/src/components/ProjectPublicationsDetail.js +++ b/client/src/components/ProjectPublicationsDetail.js @@ -2,7 +2,7 @@ import React from 'react' import { Box, Text } from 'grommet' import { Link } from 'components/Link' -export const ProjectPublicationsDetail = ({ publications }) => ( +export const ProjectPublicationsDetail = ({ publications = [] }) => ( <> {publications.map((publication, i) => ( From 957342fc6e4f09ee513558c7cd30ae87838c4b47 Mon Sep 17 00:00:00 2001 From: David Mejia Date: Fri, 10 Nov 2023 17:15:08 -0500 Subject: [PATCH 7/8] remove extra newline --- client/src/components/ProjectExternalAccessionsDetail.js | 1 - 1 file changed, 1 deletion(-) diff --git a/client/src/components/ProjectExternalAccessionsDetail.js b/client/src/components/ProjectExternalAccessionsDetail.js index 2a4daaec..26881ae9 100644 --- a/client/src/components/ProjectExternalAccessionsDetail.js +++ b/client/src/components/ProjectExternalAccessionsDetail.js @@ -6,7 +6,6 @@ export const ProjectExternalAccessionsDetail = ({ inline = false, externalAccessions = [] }) => { - // Comma separated list. if (inline) { return externalAccessions.map(({ accession, url }, i) => ( From 4a8df46ec7484cc47215869de430a1c5d2624c60 Mon Sep 17 00:00:00 2001 From: David Mejia Date: Mon, 13 Nov 2023 11:05:23 -0500 Subject: [PATCH 8/8] empty values Not Specified --- client/src/components/ProjectSearchResult.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/components/ProjectSearchResult.js b/client/src/components/ProjectSearchResult.js index 20cb325e..1f3dfcba 100644 --- a/client/src/components/ProjectSearchResult.js +++ b/client/src/components/ProjectSearchResult.js @@ -54,7 +54,7 @@ export const ProjectSearchResult = ({ project }) => { {d.value} ) : ( - Not Available + Not Specified )}