Skip to content
Snippets Groups Projects
Commit 4b6111ab authored by Audrey Hamelers's avatar Audrey Hamelers
Browse files

#458

parent 11edb625
No related branches found
No related tags found
2 merge requests!110Dev,!109Shared data model
......@@ -19,7 +19,11 @@ const ActivityPage = props => (
const ActivityPageWithHeader = SubmissionHeader(ActivityPage)
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 }) => {
if (loading || !data || !data.activities) {
return (
......
......@@ -79,16 +79,24 @@ class Review extends React.Component {
showAll: false,
}
componentDidMount() {
if (!this.props.manuscript.files.find(f => f.type === 'PMC')) {
this.setState({ showAll: true })
}
if (
['xml-triage', 'tagging'].includes(this.props.manuscript.status) &&
this.props.currentUser.admin
) {
this.setState({ pane: 'files' })
if (this.page && this.props.manuscript) {
if (
this.props.manuscript.files &&
!this.props.manuscript.files.find(f => f.type === 'PMC')
) {
this.setState({ showAll: true })
}
if (
['xml-triage', 'tagging'].includes(this.props.manuscript.status) &&
this.props.currentUser.admin
) {
this.setState({ pane: 'files' })
}
}
}
setRef = page => {
this.page = page
}
render() {
const { manuscript, currentUser, review } = this.props
const { pane, showManuscript, showAll } = this.state
......@@ -122,7 +130,7 @@ class Review extends React.Component {
}
return (
<React.Fragment>
<PreviewPageDiv>
<PreviewPageDiv ref={this.setRef}>
<PreviewPanel
style={{
flex: showManuscript && '1 1 750px',
......@@ -323,6 +331,7 @@ class Review extends React.Component {
</React.Fragment>
)
}
return null
}
}
......
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