Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
X
xpub-epmc
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package Registry
Container Registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Literature-services
public-projects
xpub-epmc
Commits
f599c9c9
Commit
f599c9c9
authored
6 years ago
by
Zhan Huang
Browse files
Options
Downloads
Patches
Plain Diff
388
parent
0345e7ad
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!81
Dev
,
!80
Shared data model
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/components/review-wizard/Review.jsx
+33
-15
33 additions, 15 deletions
app/components/review-wizard/Review.jsx
with
33 additions
and
15 deletions
app/components/review-wizard/Review.jsx
+
33
−
15
View file @
f599c9c9
...
...
@@ -120,7 +120,7 @@ class Review extends React.Component {
banner
:
false
,
showManuscript
:
false
,
showAll
:
false
,
waitingFor
Final
:
false
,
waitingFor
Generation
:
false
,
}
componentDidMount
()
{
const
hidePopup
=
document
.
cookie
.
split
(
'
;
'
).
reduce
((
r
,
v
)
=>
{
...
...
@@ -146,7 +146,7 @@ class Review extends React.Component {
instruct
,
showManuscript
,
showAll
,
waitingFor
Final
,
waitingFor
Generation
,
}
=
this
.
state
const
{
files
:
allfiles
,
status
,
teams
}
=
manuscript
const
sourceFile
=
allfiles
.
find
(
f
=>
f
.
type
===
'
manuscript
'
)
...
...
@@ -161,19 +161,34 @@ class Review extends React.Component {
const
xml
=
files
.
find
(
f
=>
f
.
type
===
'
PMC
'
)
||
null
const
final
=
files
.
find
(
f
=>
f
.
type
===
'
PMCfinal
'
)
||
null
const
tempHTML
=
files
.
find
(
f
=>
f
.
type
===
'
tempHTML
'
)
||
null
const
hasFinal
=
final
&&
tempHTML
&&
final
.
filename
.
split
(
'
.
'
)
.
slice
(
0
,
-
1
)
.
join
(
'
.
'
)
===
tempHTML
.
filename
const
pdf4print
=
files
.
find
(
f
=>
f
.
type
===
'
pdf4print
'
)
||
null
const
finalFilename
=
final
?
final
.
filename
.
split
(
'
.
'
)
.
slice
(
0
,
-
1
)
.
join
(
'
.
'
)
if
(
waitingForFinal
&&
hasFinal
)
{
this
.
setState
({
waitingForFinal
:
false
})
:
null
const
tempHTMLFilename
=
tempHTML
?
tempHTML
.
filename
.
split
(
'
.
'
)
.
slice
(
0
,
-
1
)
.
join
(
'
.
'
)
:
null
const
pdf4printFilename
=
pdf4print
?
pdf4print
.
filename
.
split
(
'
.
'
)
.
slice
(
0
,
-
1
)
.
join
(
'
.
'
)
:
null
const
prod
=
window
.
location
.
hostname
.
startsWith
(
'
beta
'
)
const
hasFinal
=
finalFilename
===
tempHTMLFilename
&&
(
!
prod
||
finalFilename
===
pdf4printFilename
)
if
(
waitingForGeneration
&&
hasFinal
)
{
this
.
setState
({
waitingForGeneration
:
false
})
}
const
reviewer
=
teams
.
find
(
t
=>
t
.
role
===
'
reviewer
'
).
teamMembers
[
0
]
if
(
...
...
@@ -187,6 +202,9 @@ class Review extends React.Component {
this
.
props
.
history
.
push
(
'
/
'
)
return
null
}
const
generating
=
!
xml
||
(
waitingForGeneration
&&
!
hasFinal
)
return
(
<
PreviewPageDiv
>
{
instruct
&&
(
...
...
@@ -251,7 +269,7 @@ class Review extends React.Component {
>
{
(
convertXML
,
{
data
})
=>
{
const
generatePreviews
=
async
()
=>
{
this
.
setState
({
waitingFor
Final
:
true
})
this
.
setState
({
waitingFor
Generation
:
true
})
await
convertXML
({
variables
:
{
id
:
xml
.
id
},
})
...
...
@@ -260,7 +278,7 @@ class Review extends React.Component {
<
React
.
Fragment
>
<
Buttons
left
top
>
<
Button
disabled
=
{
!
xml
||
(
waitingForFinal
&&
!
hasFinal
)
}
disabled
=
{
generating
}
onClick
=
{
()
=>
generatePreviews
()
}
>
Regenerate previews
...
...
@@ -284,7 +302,7 @@ class Review extends React.Component {
/>
<
Buttons
left
top
>
<
Button
disabled
=
{
!
xml
||
(
waitingForFinal
&&
!
hasFinal
)
}
disabled
=
{
generating
}
onClick
=
{
()
=>
generatePreviews
()
}
>
Regenerate previews
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment