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