Commit 2d33a040 authored by Markus Scheidgen's avatar Markus Scheidgen
Browse files

Merge branch 'experimental' of gitlab.mpcdf.mpg.de:nomad-lab/nomad-FAIR into experimental

parents 078eb1dc acaeaec7
......@@ -190,7 +190,19 @@ class Api {
calc_id: calcId
}))
.catch(this.handleApiError)
.then(response => response.body)
.then(response => {
console.log(response)
const result = response.body || response.text || response.data
if (typeof result === 'string') {
try {
return JSON.parse(result)
} catch (e) {
return result
}
} else {
return result
}
})
.finally(this.onFinishLoading)
}
......
import React from 'react'
import PropTypes from 'prop-types'
import { withStyles, Fab, Card, CardContent, CardActions, Button } from '@material-ui/core'
import { withStyles, Fab, Card, CardContent, CardActions, Button, Typography } from '@material-ui/core'
import { Link } from 'react-router-dom'
import ReactJson from 'react-json-view'
import { compose } from 'recompose'
......@@ -151,14 +151,21 @@ class ArchiveEntryView extends React.Component {
<Card className={classes.data}>
<CardContent>
{
data
data && typeof data !== 'string'
? <ReactJson
src={this.state.data}
enableClipboard={false}
collapsed={2}
displayObjectSize={false}
onSelect={this.handleShowMetaInfo.bind(this)} />
: ''
: <div>{
data
? <div>
<Typography>Archive data is not valid JSON. Displaying plain text instead.</Typography>
<pre>{data || ''}</pre>
</div>
: <Typography>loading ...</Typography>
}</div>
}
</CardContent>
</Card>
......
......@@ -480,6 +480,20 @@ class Upload(Proc):
return True # do not save the process status on the delete upload
@process
def enforce_consistency(self):
"""
Takes the proc data of this upload as truth and updates coe repository db and
ES index accordingly. It takes userdata from coe repository db, if exists as truth.
"""
# retrive data from coe repository
# diff coe repository data with proc data
# update coe repository data with diffs
# update the elastic search index (with diffs?)
@process
def publish_upload(self):
"""
......
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