Commit f4c1189c authored by Matija Obreza's avatar Matija Obreza

Accession details page reorganized

parent 48e86d6c
......@@ -330,6 +330,51 @@ class BrowsePage extends React.Component<IBrowsePageProps, any> {
</PageSection>
}
{ accession.remarks && accession.remarks.length > 0 && <PageSection title={ t('accessions.public.p.display.remarks') }>
<Properties>
{ accession.remarks && accession.remarks.map((remark) => (
<PropertiesItem key={ remark.id } title={ remark.fieldName }>{ remark.remark }</PropertiesItem>
)) }
</Properties>
</PageSection> }
<GridContainer className="mb-15">
{ datasets && datasets.length > 0 &&
<PropertiesCard
small
title={ t('accessions.public.p.display.associatedDatasets') }
propertyItemProps={ { keepEmpty: true } }
propertiesList={ datasets.map((dataset) => ({ value: <DatasetLink to={ dataset } /> })) }
/>
}
{ subsets && subsets.length > 0 &&
<PropertiesCard
small
title={ t('accessions.public.p.display.associatedSubsets') }
propertyItemProps={ { keepEmpty: true } }
propertiesList={ subsets.map((subset) => ({ value: <SubsetLink to={ subset } /> })) }
/>
}
</GridContainer>
{ files && files.length > 0 &&
<PageSection title={ t('accessions.public.p.display.relatedResources') }>
<Properties>
{ files.map((e: RepositoryFile) => (
<PropertiesItem key={ e.uuid } title={
<a href={ `${apiUrl}/api/v1/repository/download/${e.uuid}` }>
<Button variant="contained" component="span">
{ t('common:action.download') }
</Button>
</a>
}>
<b>{ e.originalFilename }</b>
</PropertiesItem>
)) }
</Properties>
</PageSection>
}
{ (accession.coll || accession.countryOfOrigin || accession.geo) &&
<PageSection title={ t('accessions.public.p.display.collectingInformation') }>
<Properties>
......@@ -393,32 +438,6 @@ class BrowsePage extends React.Component<IBrowsePageProps, any> {
<BioClimateDisplay climateData={ accession.geo.climate } extraFilters={ { taxa: { genus: [ accession.taxonomy.genus ] } } } />
}
{ accession.remarks && accession.remarks.length > 0 && <PageSection title={ t('accessions.public.p.display.remarks') }>
<Properties>
{ accession.remarks && accession.remarks.map((remark) => (
<PropertiesItem key={ remark.id } title={ remark.fieldName }>{ remark.remark }</PropertiesItem>
)) }
</Properties>
</PageSection> }
{ files &&
<PageSection title={ t('accessions.public.p.display.relatedResources') }>
<Properties>
{ files.map((e: RepositoryFile) => (
<PropertiesItem key={ e.uuid } title={
<a href={ `${apiUrl}/api/v1/repository/download/${e.uuid}` }>
<Button variant="contained" component="span">
{ t('common:action.download') }
</Button>
</a>
}>
<b>{ e.originalFilename }</b>
</PropertiesItem>
)) }
</Properties>
</PageSection>
}
{ pdci && <PdciTable pdci={ pdci } title={ t('accessions.public.p.display.pdci') }/> }
<PageSection title={ t('accessions.public.p.display.metadata') }>
......@@ -432,25 +451,6 @@ class BrowsePage extends React.Component<IBrowsePageProps, any> {
<PropertiesItem title={ t('common:label.created') }><PrettyDate value={ accession.createdDate } /></PropertiesItem>
</Properties>
</PageSection>
<GridContainer className="mb-15">
{ datasets && datasets.length > 0 &&
<PropertiesCard
small
title={ t('accessions.public.p.display.associatedDatasets') }
propertyItemProps={ { keepEmpty: true } }
propertiesList={ datasets.map((dataset) => ({ value: <DatasetLink to={ dataset } /> })) }
/>
}
{ subsets && subsets.length > 0 &&
<PropertiesCard
small
title={ t('accessions.public.p.display.associatedSubsets') }
propertyItemProps={ { keepEmpty: true } }
propertiesList={ subsets.map((subset) => ({ value: <SubsetLink to={ subset } /> })) }
/>
}
</GridContainer>
</PageContents>
}
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment