Skip to content
Snippets Groups Projects
Commit b724ad8f authored by Nikos Marinos's avatar Nikos Marinos
Browse files

Merge remote-tracking branch 'origin/shared-data-model' into shared-data-model

parents 01d52b0f 4b6111ab
No related branches found
No related tags found
2 merge requests!110Dev,!109Shared data model
...@@ -251,14 +251,14 @@ const RightComponent = ({ user, loginLink, onLogoutClick }) => ( ...@@ -251,14 +251,14 @@ const RightComponent = ({ user, loginLink, onLogoutClick }) => (
} }
to="/manage-users" to="/manage-users"
> >
Manage Users Manage users
</Link> </Link>
) : ( ) : (
<Link <Link
className={window.location.pathname === '/user-guide' && 'current'} className={window.location.pathname === '/user-guide' && 'current'}
to="/user-guide" to="/user-guide"
> >
User Guide User guide
</Link> </Link>
)} )}
</Section> </Section>
......
...@@ -19,7 +19,11 @@ const ActivityPage = props => ( ...@@ -19,7 +19,11 @@ const ActivityPage = props => (
const ActivityPageWithHeader = SubmissionHeader(ActivityPage) const ActivityPageWithHeader = SubmissionHeader(ActivityPage)
const ActivityPageContainer = ({ currentUser, history, match, ...props }) => ( const ActivityPageContainer = ({ currentUser, history, match, ...props }) => (
<Query query={QUERY_ACTIVITY_INFO} variables={{ id: match.params.id }}> <Query
fetchPolicy="cache-and-network"
query={QUERY_ACTIVITY_INFO}
variables={{ id: match.params.id }}
>
{({ data, loading }) => { {({ data, loading }) => {
if (loading || !data || !data.activities) { if (loading || !data || !data.activities) {
return ( return (
......
...@@ -79,16 +79,24 @@ class Review extends React.Component { ...@@ -79,16 +79,24 @@ class Review extends React.Component {
showAll: false, showAll: false,
} }
componentDidMount() { componentDidMount() {
if (!this.props.manuscript.files.find(f => f.type === 'PMC')) { if (this.page && this.props.manuscript) {
this.setState({ showAll: true }) if (
} this.props.manuscript.files &&
if ( !this.props.manuscript.files.find(f => f.type === 'PMC')
['xml-triage', 'tagging'].includes(this.props.manuscript.status) && ) {
this.props.currentUser.admin this.setState({ showAll: true })
) { }
this.setState({ pane: 'files' }) if (
['xml-triage', 'tagging'].includes(this.props.manuscript.status) &&
this.props.currentUser.admin
) {
this.setState({ pane: 'files' })
}
} }
} }
setRef = page => {
this.page = page
}
render() { render() {
const { manuscript, currentUser, review } = this.props const { manuscript, currentUser, review } = this.props
const { pane, showManuscript, showAll } = this.state const { pane, showManuscript, showAll } = this.state
...@@ -122,7 +130,7 @@ class Review extends React.Component { ...@@ -122,7 +130,7 @@ class Review extends React.Component {
} }
return ( return (
<React.Fragment> <React.Fragment>
<PreviewPageDiv> <PreviewPageDiv ref={this.setRef}>
<PreviewPanel <PreviewPanel
style={{ style={{
flex: showManuscript && '1 1 750px', flex: showManuscript && '1 1 750px',
...@@ -323,6 +331,7 @@ class Review extends React.Component { ...@@ -323,6 +331,7 @@ class Review extends React.Component {
</React.Fragment> </React.Fragment>
) )
} }
return null
} }
} }
......
...@@ -28,8 +28,8 @@ const ReviewFormDisplay = ({ ...@@ -28,8 +28,8 @@ const ReviewFormDisplay = ({
if (status === 'tagging') { if (status === 'tagging') {
return ( return (
<React.Fragment> <React.Fragment>
<H3>Tagging complete?</H3>
<Content> <Content>
<H3>Tagging complete?</H3>
<p> <p>
{`When all files have been uploaded and both the Web and PDF previews have been generated, please click the button below to move the manuscript to XML QA.`} {`When all files have been uploaded and both the Web and PDF previews have been generated, please click the button below to move the manuscript to XML QA.`}
</p> </p>
......
...@@ -9,12 +9,10 @@ export const FileTypes = [ ...@@ -9,12 +9,10 @@ export const FileTypes = [
'application/rtf', 'application/rtf',
'application/msword', 'application/msword',
'application/pdf', 'application/pdf',
'application/xml',
'application/zip', 'application/zip',
'application/x-zip-compressed', 'application/x-zip-compressed',
'application/x-compressed', 'application/x-compressed',
'multipart/x-zip', 'multipart/x-zip',
'application/rtf',
'application/ogg', 'application/ogg',
'application/postscript', // ai, eps 'application/postscript', // ai, eps
'application/vnd.oasis.opendocument.text', 'application/vnd.oasis.opendocument.text',
...@@ -44,7 +42,6 @@ export const FileTypes = [ ...@@ -44,7 +42,6 @@ export const FileTypes = [
'text/csv', 'text/csv',
'text/rtf', 'text/rtf',
'text/plain', 'text/plain',
'text/rtf',
'text/html', 'text/html',
'video/mpeg', 'video/mpeg',
......
...@@ -18,22 +18,21 @@ export const AllowedFiles = () => { ...@@ -18,22 +18,21 @@ export const AllowedFiles = () => {
<H3>Manuscript text file</H3> <H3>Manuscript text file</H3>
<p>This file can be either a PDF or Microsoft Word file.</p> <p>This file can be either a PDF or Microsoft Word file.</p>
<H3>Figures and supplemental files</H3> <H3>Figures and supplemental files</H3>
<H4>Application</H4>
{mimetypes.map(type => ( {mimetypes.map(type => (
<div key={type}> <div key={type}>
<H2>{type.charAt(0).toUpperCase() + type.slice(1)}</H2> <H4>{type.charAt(0).toUpperCase() + type.slice(1)}</H4>
<Table> <Table>
<tbody> <tbody>
<tr> <tr>
<th>File extension</th>
<th>MIME type</th> <th>MIME type</th>
<th>Default file extension</th>
</tr> </tr>
{FileTypes.filter(subtype => subtype.startsWith(type)).map( {FileTypes.filter(subtype => subtype.startsWith(type)).map(
subtype => subtype =>
mime.extension(subtype) && ( mime.extension(subtype) && (
<tr key={subtype}> <tr key={subtype}>
<td>.{mime.extension(subtype)}</td>
<td>{subtype}</td> <td>{subtype}</td>
<td>.{mime.extension(subtype)}</td>
</tr> </tr>
), ),
)} )}
......
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