Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
X
xpub-faraday
Manage
Activity
Members
Labels
Plan
Issues
2
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Container Registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
xpub
xpub-faraday
Commits
5360df2b
Commit
5360df2b
authored
7 years ago
by
Alexandru Munteanu
Browse files
Options
Downloads
Patches
Plain Diff
feat(reviewer-email): accept to work from email
parent
aba46fd2
No related branches found
No related tags found
1 merge request
!6
Agree/Decline to work on a manuscript
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
packages/component-manuscript/src/components/Details.js
+4
-4
4 additions, 4 deletions
packages/component-manuscript/src/components/Details.js
packages/components-faraday/src/components/SignUp/ReviewerSignUp.js
+20
-10
20 additions, 10 deletions
...omponents-faraday/src/components/SignUp/ReviewerSignUp.js
with
24 additions
and
14 deletions
packages/component-manuscript/src/components/Details.js
+
4
−
4
View file @
5360df2b
...
...
@@ -5,7 +5,7 @@ import { compose, lifecycle } from 'recompose'
import
{
selectCurrentUser
}
from
'
xpub-selectors
'
import
{
parseSearchParams
}
from
'
./utils
'
import
{
reviewer
Accept
}
from
'
../../../components-faraday/src/redux/reviewers
'
import
{
reviewer
Decision
}
from
'
../../../components-faraday/src/redux/reviewers
'
const
Details
=
()
=>
<
div
>
eu
sunt
manuscript
details
<
/div
>
...
...
@@ -14,15 +14,15 @@ export default compose(
state
=>
({
currentUser
:
selectCurrentUser
(
state
),
}),
{
reviewer
Accept
,
replace
},
{
reviewer
Decision
,
replace
},
),
lifecycle
({
componentDidMount
()
{
const
{
reviewer
Accept
,
location
,
match
,
replace
}
=
this
.
props
const
{
reviewer
Decision
,
location
,
match
,
replace
}
=
this
.
props
const
collectionId
=
match
.
params
.
project
const
{
agree
,
invitationId
}
=
parseSearchParams
(
location
.
search
)
if
(
agree
===
'
true
'
)
{
reviewer
Accept
(
invitationId
,
collectionId
)
reviewer
Decision
(
invitationId
,
collectionId
,
true
)
replace
(
location
.
pathname
)
}
},
...
...
This diff is collapsed.
Click to expand it.
packages/components-faraday/src/components/SignUp/ReviewerSignUp.js
+
20
−
10
View file @
5360df2b
...
...
@@ -4,6 +4,7 @@ import { reduxForm } from 'redux-form'
import
{
push
}
from
'
react-router-redux
'
import
{
required
,
minChars
}
from
'
xpub-validators
'
import
{
compose
,
withState
,
lifecycle
}
from
'
recompose
'
import
{
loginUser
}
from
'
pubsweet-component-login/actions
'
import
{
Button
,
ValidatedField
,
TextField
}
from
'
@pubsweet/ui
'
import
{
...
...
@@ -68,7 +69,7 @@ const ReviewerSignUp = ({
export
default
compose
(
withState
(
'
searchParams
'
,
'
setParams
'
,
{
agree
:
true
}),
withState
(
'
reviewer
'
,
'
setReviewer
'
,
{}),
connect
(
null
,
{
push
,
setReviewerPassword
,
reviewerDecision
}),
connect
(
null
,
{
push
,
loginUser
,
setReviewerPassword
,
reviewerDecision
}),
lifecycle
({
componentDidMount
()
{
const
{
setParams
,
location
,
setReviewer
,
reviewerDecision
}
=
this
.
props
...
...
@@ -98,16 +99,25 @@ export default compose(
onSubmit
:
(
{
password
},
dispatch
,
{
push
,
searchParams
,
reviewer
,
location
,
setReviewerPassword
},
{
push
,
loginUser
,
searchParams
,
reviewer
,
location
,
setReviewerPassword
,
},
)
=>
{
// setReviewerPassword({
// ...reviewer,
// password,
// })
const
{
agree
,
collectionId
,
invitationId
,
fragmentId
}
=
searchParams
push
(
`/projects/
${
collectionId
}
/versions/
${
fragmentId
}
/details?agree=
${
agree
}
&invitationId=
${
invitationId
}
`
,
)
const
{
collectionId
,
fragmentId
,
agree
,
invitationId
}
=
searchParams
setReviewerPassword
({
...
reviewer
,
password
,
}).
then
(()
=>
{
loginUser
(
{
username
:
reviewer
.
email
,
password
},
`/projects/
${
collectionId
}
/versions/
${
fragmentId
}
/details?agree=
${
agree
}
&invitationId=
${
invitationId
}
`
,
)
})
},
}),
)(
ReviewerSignUp
)
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