Commit c76f40c3 authored by Markus Scheidgen's avatar Markus Scheidgen
Browse files

Fixed invisble datasets probelm due to wrong dataset id keys.

parent 2ed6df49
......@@ -57,7 +57,7 @@ class DatasetPage extends React.Component {
per_page: 1
}).then(data => {
const entry = data.results[0]
const dataset = entry && entry.datasets.find(ds => ds.id + '' === datasetId)
const dataset = entry && entry.datasets.find(ds => ds.dataset_id + '' === datasetId)
if (!dataset) {
this.setState({dataset: {}, empty: true})
}
......@@ -96,7 +96,7 @@ class DatasetPage extends React.Component {
<div>
<div className={classes.header}>
<div className={classes.description}>
<Typography variant="h4">{dataset.name || (empty && 'Empty or non existing dataset') ||'loading ...'}</Typography>
<Typography variant="h4">{dataset.name || (empty && 'Empty or non existing dataset') || 'loading ...'}</Typography>
<Typography>
dataset{dataset.doi ? <span>, with DOI <DOI doi={dataset.doi} /></span> : ''}
</Typography>
......
......@@ -121,8 +121,8 @@ class RepoEntryView extends React.Component {
{calcData.datasets &&
<div>
{calcData.datasets.map(ds => (
<Typography key={ds.id}>
<Link component={RouterLink} to={`/dataset/id/${ds.id}`}>{ds.name}</Link>
<Typography key={ds.dataset_id}>
<Link component={RouterLink} to={`/dataset/id/${ds.dataset_id}`}>{ds.name}</Link>
{ds.doi ? <span>&nbsp; (<DOI doi={ds.doi}/>)</span> : ''}
</Typography>))}
</div>}
......
......@@ -250,7 +250,7 @@ class DatasetListUnstyled extends React.Component {
const { classes, data, total, datasets_after, onChange, actions } = this.props
const datasets = data.datasets_grouped || {values: []}
const results = Object.keys(datasets.values).map(id => {
const exampleDataset = datasets.values[id].examples[0].datasets.find(ds => ds.id === id)
const exampleDataset = datasets.values[id].examples[0].datasets.find(ds => ds.dataset_id === id)
return {
...exampleDataset,
id: id,
......
......@@ -43,7 +43,8 @@ export class EntryListUnstyled extends React.Component {
actions: PropTypes.element,
showEntryActions: PropTypes.func,
selectedColumns: PropTypes.arrayOf(PropTypes.string),
domain: PropTypes.object
domain: PropTypes.object,
user: PropTypes.object
}
static styles = theme => ({
......@@ -232,8 +233,8 @@ export class EntryListUnstyled extends React.Component {
<Quantity quantity='datasets' placeholder='no datasets' data={row}>
<div>
{(row.datasets || []).map(ds => (
<Typography key={ds.id}>
<Link component={RouterLink} to={`/dataset/id/${ds.id}`}>{ds.name}</Link>
<Typography key={ds.dataset_id}>
<Link component={RouterLink} to={`/dataset/id/${ds.dataset_id}`}>{ds.name}</Link>
{ds.doi ? <span>&nbsp; (<Link href={ds.doi}>{ds.doi}</Link>)</span> : <React.Fragment/>}
</Typography>))}
</div>
......
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