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
7f0bfe19
Commit
7f0bfe19
authored
6 years ago
by
Alexandru Munteanu
Browse files
Options
Downloads
Patches
Plain Diff
feat(reviewers): add reviewers endpoint
parent
d489c68b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
packages/components-faraday/src/components/Dashboard/ReviewerForm.js
+6
-4
6 additions, 4 deletions
...mponents-faraday/src/components/Dashboard/ReviewerForm.js
packages/components-faraday/src/redux/reviewers.js
+19
-0
19 additions, 0 deletions
packages/components-faraday/src/redux/reviewers.js
with
25 additions
and
4 deletions
packages/components-faraday/src/components/Dashboard/ReviewerForm.js
+
6
−
4
View file @
7f0bfe19
import
React
from
'
react
'
import
{
connect
}
from
'
react-redux
'
import
styled
from
'
styled-components
'
import
{
reduxForm
,
change
as
changeForm
,
initialize
}
from
'
redux-form
'
import
{
th
,
Button
}
from
'
@pubsweet/ui
'
import
{
compose
,
withHandlers
}
from
'
recompose
'
import
{
reduxForm
,
change
as
changeForm
,
initialize
}
from
'
redux-form
'
import
{
ReviewersSelect
}
from
'
./
'
import
{
ValidatedTextField
}
from
'
../AuthorList/FormItems
'
import
{
inviteReviewer
}
from
'
../../redux/reviewers
'
// const emailRegex = new RegExp(
// /^(([^<>()\[\]\.,;:\s@\"]+(\.[^<>()\[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i, //eslint-disable-line
...
...
@@ -15,7 +16,7 @@ import { ValidatedTextField } from '../AuthorList/FormItems'
// const emailValidator = value =>
// emailRegex.test(value) ? undefined : 'Invalid email'
const
ReviewerForm
=
({
clearForm
,
selectReviewer
})
=>
(
const
ReviewerForm
=
({
clearForm
,
selectReviewer
,
handleSubmit
})
=>
(
<
Root
>
<
Row
>
<
ReviewersSelect
onSelect
=
{
selectReviewer
}
/
>
...
...
@@ -27,7 +28,7 @@ const ReviewerForm = ({ clearForm, selectReviewer }) => (
<
/Row
>
<
ButtonsContainer
>
<
FormButton
onClick
=
{
clearForm
}
>
Clear
<
/FormButton
>
<
FormButton
disabled
primary
>
<
FormButton
onClick
=
{
handleSubmit
}
primary
>
Send
<
/FormButton
>
<
/ButtonsContainer
>
...
...
@@ -35,9 +36,10 @@ const ReviewerForm = ({ clearForm, selectReviewer }) => (
)
export
default
compose
(
connect
(
null
,
{
changeForm
,
initialize
}),
connect
(
null
,
{
changeForm
,
initialize
,
inviteReviewer
}),
reduxForm
({
form
:
'
inviteReviewer
'
,
onSubmit
:
(
values
,
dispatch
,
{
inviteReviewer
})
=>
{},
}),
withHandlers
({
selectReviewer
:
({
changeForm
,
initialize
})
=>
reviewer
=>
()
=>
{
...
...
This diff is collapsed.
Click to expand it.
packages/components-faraday/src/redux/reviewers.js
0 → 100644
+
19
−
0
View file @
7f0bfe19
import
{
create
}
from
'
pubsweet-client/src/helpers/api
'
const
initialState
=
{
fetching
:
false
,
}
export
const
inviteReviewer
=
(
email
,
collectionId
)
=>
dispatch
=>
{
create
(
`collections/
${
collectionId
}
/invitation`
,
{
email
,
role
:
'
reviewer
'
,
})
}
export
default
(
state
=
initialState
,
action
=
{})
=>
{
switch
(
action
.
type
)
{
default
:
return
state
}
}
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