Commit babc2a9b authored by Viacheslav Pavlov's avatar Viacheslav Pavlov Committed by Matija Obreza
Browse files

Accession images and files

parent 2a5c6817
......@@ -10,6 +10,7 @@
"create": "Create",
"delete": "Delete",
"deleteData": "Delete data",
"download": "Download",
"edit": "Edit",
"logout": "Logout",
"manage": "Manage",
......
......@@ -222,7 +222,9 @@
"metadata": "Metadata",
"permanentURL": "Permanent URL",
"associatedDatasets": "Associated Datasets",
"associatedSubsets": "Associated Subsets"
"associatedSubsets": "Associated Subsets",
"relatedResources": "Related resources",
"imageGallery": "Image gallery"
},
"browse": {
"title": "Accession browser",
......
......@@ -47,7 +47,9 @@
"metadata": "Metadata",
"permanentURL": "Permanent URL",
"associatedDatasets": "Associated Datasets",
"associatedSubsets": "Associated Subsets"
"associatedSubsets": "Associated Subsets",
"relatedResources": "Related resources",
"imageGallery": "Image gallery"
},
"browse": {
"title": "Accession browser",
......
......@@ -9,6 +9,7 @@ import {addAccessionToMyList, removeAccessionFromMyList} from 'list/actions/publ
// Models
import AccessionDetails from 'model/accession/AccessionDetails';
import RepositoryFile from 'model/repository/RepositoryFile';
// UI
import { Link } from 'react-router-dom';
......@@ -29,6 +30,8 @@ import PropertiesCard from 'ui/common/PropertiesCard';
import GridLayout from 'ui/layout/GridLayout';
import McpdDate from 'ui/common/time/McpdDate';
import PdciTable from './c/PdciTable';
import ImageGalleryView from 'repository/ui/c/ImageGalleryView';
import Button from '@material-ui/core/Button/Button';
interface IBrowsePageProps extends React.ClassAttributes<any> {
......@@ -79,10 +82,10 @@ class BrowsePage extends React.Component<IBrowsePageProps, any> {
public render() {
const { t, error, uuid, doi, accessions } = this.props;
const {details: accession, pdci, datasets, subsets} = this.props.accession ?
const {details: accession, pdci, datasets, subsets, files, imageGallery} = this.props.accession ?
this.props.accession
:
{details: null, pdci: null, datasets: null, subsets: null};
{details: null, pdci: null, datasets: null, subsets: null, files: null, imageGallery: null};
const isChecked = accession && accessions && accessions.includes(accession.uuid);
const theDoi = `10.${doi}`;
......@@ -180,6 +183,29 @@ class BrowsePage extends React.Component<IBrowsePageProps, any> {
</Properties>
</PageSection>
}
{ files &&
<PageSection title={ t('accessions.public.p.display.relatedResources') }>
<Properties>
{ files.map((e: RepositoryFile) => (
<PropertiesItem key={ e.uuid } title={
<a href={ `/proxy/api/v1/repository/download/${e.uuid}` }>
<Button variant="raised" component="span">
{ t('common:action.download') }
</Button>
</a>
}>
<b>{ e.originalFilename }</b>
</PropertiesItem>
)) }
</Properties>
</PageSection>
}
{ imageGallery &&
<PageSection title={ t('accessions.public.p.display.imageGallery') }>
<ImageGalleryView imageGallery={ imageGallery }/>
</PageSection>
}
{ accession.coll &&
<PageSection title={ t('accessions.public.p.display.collectingInformation') }>
......
import Accession from 'model/accession/Accession';
import Subset from 'model/subset/Subset';
import PDCI from 'model/accession/PDCI';
import RepositoryFile from 'model/repository/RepositoryFile';
import ImageGallery from 'model/repository/ImageGallery';
class AccessionDetails {
public details: Accession;
public datasets: any[];
public subsets: Subset[];
public pdci: PDCI;
public files: RepositoryFile[];
public imageGallery: ImageGallery;
}
export default AccessionDetails;
\ No newline at end of file
export default AccessionDetails;
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