Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return paginatedResults.map(job => {
let user =
job.hasOwnProperty('userMetadata') &&
job.userMetadata.hasOwnProperty('email')
? job.userMetadata.email
: job.userId
let dateAdded = moment(job.analysis.created).format('L')
let timeago = moment(job.analysis.created).fromNow(true)
const datasetId = bids.decodeId(job.datasetId)
const snapshotId = bids.decodeId(job.snapshotId)
const jobQuery = {
app: job.appLabel,
version: job.appVersion,
job: job._id,
}
const queryString = querystring(jobQuery)
const jobUrl =
'/datasets/' + datasetId + '/versions/' + snapshotId + queryString
return (
<div>
<div>
<div>
<div>
<h4>
{job.appLabel} - v{job.appVersion}
</h4>
<div>
<div>
Status: {job.analysis.status}
</div></div></div></div></div></div>
dismissJobsModal(success, snapshotId, appLabel, appVersion, jobId, history) {
this.toggleModal('jobs')
if (success) {
if (snapshotId !== this.data.dataset._id) {
let datasetId = this.data.dataset.original
? this.data.dataset.original
: this.data.dataset._id
const base = '/datasets/' + datasetId + '/versions/' + snapshotId
const query = { app: appLabel, version: appVersion, job: jobId }
const url = base + querystring(query)
history.push(url)
}
}
},
dismissJobsModal(success, snapshotId, appLabel, appVersion, jobId, history) {
this.toggleModal('jobs')
if (success) {
if (snapshotId !== this.data.dataset._id) {
let datasetId = this.data.dataset.original
? this.data.dataset.original
: this.data.dataset._id
const base = '/datasets/' + datasetId + '/versions/' + snapshotId
const query = { app: appLabel, version: appVersion, job: jobId }
const url = base + querystring(query)
history.push(url)
}
}
},
dismissJobsModal(success, snapshotId, appLabel, appVersion, jobId, history) {
this.toggleModal('jobs')
if (success) {
if (snapshotId !== this.data.dataset._id) {
let datasetId = this.data.dataset.original
? this.data.dataset.original
: this.data.dataset._id
const base = '/datasets/' + datasetId + '/versions/' + snapshotId
const query = { app: appLabel, version: appVersion, job: jobId }
const url = base + querystring(query)
history.push(url)
}
}
},