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

Better visualization of staging/embargo/published state in entry and upload list. #238

parent 8cb59bab
......@@ -483,9 +483,6 @@ class DataTableUnStyled extends React.Component {
</TableCell> : <React.Fragment/> }
{Object.keys(columns).filter(key => selectedColumns.indexOf(key) !== -1).map((key, i) => {
const column = columns[key]
if (column.ellipsisFront) {
console.log('####################')
}
return (
<TableCell
className={clsx([classes.cell, column.ellipsisFront && classes.ellipsisFront, (selectedEntry === rowId) && classes.selectedEntryCell])}
......
......@@ -54,7 +54,6 @@ Once you assigned a DOI to a dataset, no entries can be removed or added to the
`
class UserdataPage extends React.Component {
render() {
return (
<div>
......@@ -66,7 +65,7 @@ class UserdataPage extends React.Component {
<Search
resultTab="uploads"
tabs={['uploads', 'datasets', 'entries']}
entryListProps={{selectedColumns: ['formula', 'upload_time', 'mainfile', 'co_authors', 'references', 'datasets']}}
entryListProps={{selectedColumns: ['formula', 'upload_time', 'mainfile', 'published', 'co_authors', 'references', 'datasets']}}
/>
</SearchContext>
</div>
......
......@@ -10,6 +10,21 @@ import { Link as RouterLink } from 'react-router-dom'
import DetailsIcon from '@material-ui/icons/MoreHoriz'
import EditUserMetadataDialog from '../EditUserMetadataDialog'
import DownloadButton from '../DownloadButton'
import PublishedIcon from '@material-ui/icons/Public'
import PrivateIcon from '@material-ui/icons/AccountCircle'
export function Published(props) {
const {entry} = props
if (entry.published) {
return <Tooltip title={entry.with_embargo ? 'published with embargo' : 'published'}>
{entry.with_embargo ? <PrivateIcon color="primary"/> : <PublishedIcon color="primary" />}
</Tooltip>
} else {
return <Tooltip title="not published yet">
<PrivateIcon color="secondary"/>
</Tooltip>
}
}
export class EntryListUnstyled extends React.Component {
static propTypes = {
......@@ -77,6 +92,11 @@ export class EntryListUnstyled extends React.Component {
supportsSort: true,
description: 'The time this entry was uploaded.'
},
published: {
label: 'Published',
align: 'center',
render: (entry) => <Published entry={entry} />
},
authors: {
label: 'Authors',
render: entry => entry.authors.map(author => author.name).join('; '),
......
......@@ -13,6 +13,7 @@ import DownloadButton from '../DownloadButton'
import ClipboardIcon from '@material-ui/icons/Assignment'
import { CopyToClipboard } from 'react-copy-to-clipboard'
import DetailsIcon from '@material-ui/icons/MoreHoriz'
import { Published } from './EntryList'
class UploadIdUnstyled extends React.Component {
static propTypes = {
......@@ -170,7 +171,8 @@ class UploadListUnstyled extends React.Component {
},
published: {
label: 'Published',
render: (upload) => upload.example.published ? 'Yes' : 'No'
align: 'center',
render: upload => <Published entry={upload.example} />
}
}
......
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