Skip to content
Snippets Groups Projects
Commit c76f40c3 authored by Markus Scheidgen's avatar Markus Scheidgen
Browse files

Fixed invisble datasets probelm due to wrong dataset id keys.

parent 2ed6df49
Branches
Tags
2 merge requests!115V0.8.0 beta,!113V0.8.0
...@@ -57,7 +57,7 @@ class DatasetPage extends React.Component { ...@@ -57,7 +57,7 @@ class DatasetPage extends React.Component {
per_page: 1 per_page: 1
}).then(data => { }).then(data => {
const entry = data.results[0] 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) { if (!dataset) {
this.setState({dataset: {}, empty: true}) this.setState({dataset: {}, empty: true})
} }
...@@ -96,7 +96,7 @@ class DatasetPage extends React.Component { ...@@ -96,7 +96,7 @@ class DatasetPage extends React.Component {
<div> <div>
<div className={classes.header}> <div className={classes.header}>
<div className={classes.description}> <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> <Typography>
dataset{dataset.doi ? <span>, with DOI <DOI doi={dataset.doi} /></span> : ''} dataset{dataset.doi ? <span>, with DOI <DOI doi={dataset.doi} /></span> : ''}
</Typography> </Typography>
......
...@@ -121,8 +121,8 @@ class RepoEntryView extends React.Component { ...@@ -121,8 +121,8 @@ class RepoEntryView extends React.Component {
{calcData.datasets && {calcData.datasets &&
<div> <div>
{calcData.datasets.map(ds => ( {calcData.datasets.map(ds => (
<Typography key={ds.id}> <Typography key={ds.dataset_id}>
<Link component={RouterLink} to={`/dataset/id/${ds.id}`}>{ds.name}</Link> <Link component={RouterLink} to={`/dataset/id/${ds.dataset_id}`}>{ds.name}</Link>
{ds.doi ? <span>&nbsp; (<DOI doi={ds.doi}/>)</span> : ''} {ds.doi ? <span>&nbsp; (<DOI doi={ds.doi}/>)</span> : ''}
</Typography>))} </Typography>))}
</div>} </div>}
......
...@@ -250,7 +250,7 @@ class DatasetListUnstyled extends React.Component { ...@@ -250,7 +250,7 @@ class DatasetListUnstyled extends React.Component {
const { classes, data, total, datasets_after, onChange, actions } = this.props const { classes, data, total, datasets_after, onChange, actions } = this.props
const datasets = data.datasets_grouped || {values: []} const datasets = data.datasets_grouped || {values: []}
const results = Object.keys(datasets.values).map(id => { 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 { return {
...exampleDataset, ...exampleDataset,
id: id, id: id,
......
...@@ -43,7 +43,8 @@ export class EntryListUnstyled extends React.Component { ...@@ -43,7 +43,8 @@ export class EntryListUnstyled extends React.Component {
actions: PropTypes.element, actions: PropTypes.element,
showEntryActions: PropTypes.func, showEntryActions: PropTypes.func,
selectedColumns: PropTypes.arrayOf(PropTypes.string), selectedColumns: PropTypes.arrayOf(PropTypes.string),
domain: PropTypes.object domain: PropTypes.object,
user: PropTypes.object
} }
static styles = theme => ({ static styles = theme => ({
...@@ -232,8 +233,8 @@ export class EntryListUnstyled extends React.Component { ...@@ -232,8 +233,8 @@ export class EntryListUnstyled extends React.Component {
<Quantity quantity='datasets' placeholder='no datasets' data={row}> <Quantity quantity='datasets' placeholder='no datasets' data={row}>
<div> <div>
{(row.datasets || []).map(ds => ( {(row.datasets || []).map(ds => (
<Typography key={ds.id}> <Typography key={ds.dataset_id}>
<Link component={RouterLink} to={`/dataset/id/${ds.id}`}>{ds.name}</Link> <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/>} {ds.doi ? <span>&nbsp; (<Link href={ds.doi}>{ds.doi}</Link>)</span> : <React.Fragment/>}
</Typography>))} </Typography>))}
</div> </div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment