Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
X
xpub-elife
Manage
Activity
Members
Labels
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review 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-elife
Merge requests
!5
Beginnings of author details form
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Beginnings of author details form
author-details
into
master
Overview
5
Commits
6
Pipelines
3
Changes
8
1 unresolved thread
Hide all comments
Merged
Aanand Prasad
requested to merge
author-details
into
master
6 years ago
Overview
5
Commits
6
Pipelines
3
Changes
3
1 unresolved thread
Hide all comments
Expand
Integrates formik and theming.
1
0
Merge request reports
Compare
version 1
version 2
78edbc76
6 years ago
version 1
08c12dc9
6 years ago
master (base)
and
version 2
latest version
cea38811
6 commits,
6 years ago
version 2
78edbc76
5 commits,
6 years ago
version 1
08c12dc9
3 commits,
6 years ago
Show latest version
3 files
+
132
−
38
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
3
Search (e.g. *.vue) (Ctrl+P)
app/components/submission/AuthorDetails.js
+
120
−
6
Options
import
React
from
'
react
'
import
{
Flex
,
Box
}
from
'
grid-styled
'
export
default
({
value
})
=>
(
import
{
TextField
,
Button
,
Heading
}
from
'
@pubsweet/ui
'
class
AuthorDetails
extends
React
.
Component
{
constructor
()
{
super
()
this
.
openAssigneeForm
=
this
.
openAssigneeForm
.
bind
(
this
)
this
.
closeAssigneeForm
=
this
.
closeAssigneeForm
.
bind
(
this
)
this
.
state
=
{
assigneeFormOpen
:
false
,
}
}
openAssigneeForm
()
{
this
.
setState
({
assigneeFormOpen
:
true
})
}
closeAssigneeForm
()
{
this
.
props
.
setFieldValue
(
'
assignee
'
,
{})
this
.
setState
({
assigneeFormOpen
:
false
})
}
render
()
{
const
{
values
,
handleChange
}
=
this
.
props
const
{
assigneeFormOpen
}
=
this
.
state
return
(
<
div
>
<
Flex
>
<
Box
width
=
{
1
/
2
}
>
<
TextField
label
=
"
First name
"
name
=
"
firstName
"
onChange
=
{
handleChange
}
value
=
{
values
.
firstName
}
/
>
<
/Box
>
<
Box
width
=
{
1
/
2
}
>
<
TextField
label
=
"
Last name
"
name
=
"
lastName
"
onChange
=
{
handleChange
}
value
=
{
values
.
lastName
}
/
>
<
/Box
>
<
/Flex
>
<
Flex
>
<
Box
width
=
{
1
/
2
}
>
<
TextField
label
=
"
Email (correspondence)
"
name
=
"
email
"
onChange
=
{
handleChange
}
value
=
{
values
.
email
}
/
>
<
/Box
>
<
Box
width
=
{
1
/
2
}
>
<
TextField
label
=
"
Institute
"
name
=
"
institute
"
onChange
=
{
handleChange
}
value
=
{
values
.
institute
}
/
>
<
/Box
>
<
/Flex
>
{
assigneeFormOpen
?
(
<
AssigneeForm
handleChange
=
{
handleChange
}
handleClose
=
{
this
.
closeAssigneeForm
}
values
=
{
values
.
assignee
}
/
>
)
:
(
<
Button
onClick
=
{
this
.
openAssigneeForm
}
>
Assign
a
colleague
to
handle
this
submission
<
/Button
>
)}
<
/div
>
)
}
}
const
AssigneeForm
=
({
values
,
handleChange
,
handleClose
})
=>
(
<
div
>
<
input
disabled
type
=
"
text
"
value
=
{
value
.
firstName
}
/
>
<
input
disabled
type
=
"
text
"
value
=
{
value
.
lastName
}
/
>
<
br
/>
<
input
disabled
type
=
"
text
"
value
=
{
value
.
email
}
/
>
<
input
disabled
type
=
"
text
"
value
=
{
value
.
institute
}
/
>
<
Heading
level
=
{
3
}
>
Assignee
for
correspondence
<
/Heading
>
<
Flex
>
<
Box
width
=
{
1
/
2
}
>
<
TextField
label
=
"
First name
"
name
=
"
assignee.firstName
"
onChange
=
{
handleChange
}
value
=
{
values
.
firstName
}
/
>
<
/Box
>
<
Box
width
=
{
1
/
2
}
>
<
TextField
label
=
"
Last name
"
name
=
"
assignee.lastName
"
onChange
=
{
handleChange
}
value
=
{
values
.
lastName
}
/
>
<
/Box
>
<
/Flex
>
<
Flex
>
<
Box
width
=
{
1
/
2
}
>
<
TextField
label
=
"
Email
"
name
=
"
assignee.email
"
onChange
=
{
handleChange
}
value
=
{
values
.
email
}
/
>
<
/Box
>
<
Box
width
=
{
1
/
2
}
>
<
Button
onClick
=
{
handleClose
}
>
Remove
assignment
<
/Button
>
<
/Box
>
<
/Flex
>
<
/div
>
)
export
default
AuthorDetails