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
f64b5867
Commit
f64b5867
authored
6 years ago
by
Bogdan Cochior
Browse files
Options
Downloads
Patches
Plain Diff
feat(report): hide form when report is submitted
parent
1a8f4924
No related branches found
No related tags found
1 merge request
!8
Sprint #10
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
packages/component-manuscript/src/components/ReviewsAndReports.js
+18
-6
18 additions, 6 deletions
.../component-manuscript/src/components/ReviewsAndReports.js
packages/components-faraday/src/redux/recommendations.js
+8
-0
8 additions, 0 deletions
packages/components-faraday/src/redux/recommendations.js
with
26 additions
and
6 deletions
packages/component-manuscript/src/components/ReviewsAndReports.js
+
18
−
6
View file @
f64b5867
import
React
,
{
Fragment
}
from
'
react
'
import
{
head
}
from
'
lodash
'
import
{
th
}
from
'
@pubsweet/ui
'
import
{
connect
}
from
'
react-redux
'
import
styled
from
'
styled-components
'
import
{
compose
,
withHandlers
,
lifecycle
}
from
'
recompose
'
import
{
compose
,
withHandlers
,
lifecycle
,
withProps
}
from
'
recompose
'
import
{
ReviewerBreakdown
}
from
'
pubsweet-components-faraday/src/components/Invitations
'
import
ReviewersDetailsList
from
'
pubsweet-components-faraday/src/components/Reviewers/ReviewersDetailsList
'
import
ReviewerReportForm
from
'
pubsweet-component-manuscript/src/components/ReviewerReportForm
'
...
...
@@ -39,6 +40,7 @@ const ReviewsAndReports = ({
recommendations
=
[],
isReviewer
,
currentUserIs
,
report
,
})
=>
(
<
Fragment
>
{
currentUserIs
(
'
staff
'
)
&&
(
...
...
@@ -60,11 +62,18 @@ const ReviewsAndReports = ({
{
isReviewer
&&
(
<
Root
id
=
"
review-report
"
>
<
Expandable
label
=
"
Your Report
"
startExpanded
>
<
ReviewerReportForm
project
=
{
project
}
recommendations
=
{
recommendations
}
version
=
{
version
}
/
>
{
report
?
(
<
div
>
You
have
a
submitted
report
with
recommendation
{
'
'
}
{
report
.
recommendation
}
<
/div
>
)
:
(
<
ReviewerReportForm
project
=
{
project
}
recommendations
=
{
recommendations
}
version
=
{
version
}
/
>
)}
<
/Expandable
>
<
/Root
>
)}
...
...
@@ -86,6 +95,9 @@ export default compose(
getCollectionReviewers
(
project
.
id
)
},
}),
withProps
(({
recommendations
=
[]
})
=>
({
report
:
head
(
recommendations
.
filter
(
r
=>
r
.
submittedOn
)),
})),
lifecycle
({
componentDidMount
()
{
const
{
getReviewers
}
=
this
.
props
...
...
This diff is collapsed.
Click to expand it.
packages/components-faraday/src/redux/recommendations.js
+
8
−
0
View file @
f64b5867
...
...
@@ -5,6 +5,7 @@ import { create, update } from 'pubsweet-client/src/helpers/api'
const
REQUEST
=
'
recommendations/REQUEST
'
const
ERROR
=
'
recommendations/ERROR
'
const
GET_FRAGMENT_SUCCESS
=
'
GET_FRAGMENT_SUCCESS
'
const
GET_RECOMMENDATIONS_SUCCESS
=
'
recommendations/GET_SUCCESS
'
const
CREATE_RECOMMENDATION_SUCCESS
=
'
recommendations/CREATE_SUCCESS
'
const
UPDATE_RECOMMENDATION_SUCCESS
=
'
recommendations/UPDATE_SUCCESS
'
...
...
@@ -117,6 +118,13 @@ export default (state = initialState, action = {}) => {
fetching
:
false
,
error
:
action
.
error
,
}
case
GET_FRAGMENT_SUCCESS
:
return
{
...
state
,
fetching
:
false
,
error
:
null
,
recommendations
:
get
(
action
,
'
fragment.recommendations
'
),
}
case
GET_RECOMMENDATIONS_SUCCESS
:
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