Skip to content
Snippets Groups Projects
Commit 0f228e5a authored by Bogdan Cochior's avatar Bogdan Cochior
Browse files

refactor(reviewers): refresh breakdown after revoke/resend actions

parent 9c2cf3d0
No related branches found
No related tags found
1 merge request!8Sprint #10
......@@ -34,7 +34,7 @@ const ReviewsAndReports = ({ project, reviewers = [] }) => (
<Root>
<Expandable
label="Reviewers & Reports"
rightHTML={<ReviewerBreakdown values={project.invitations || []} />}
rightHTML={<ReviewerBreakdown type="reviewer" values={reviewers || []} />}
startExpanded
>
<Tabs activeKey={1} sections={getTabSections(project.id, reviewers)} />
......
......@@ -15,6 +15,7 @@ import {
inviteReviewer,
selectFetchingInvite,
selectReviewersError,
getCollectionReviewers,
} from '../../redux/reviewers'
const ResendRevoke = withTheme(
......@@ -55,15 +56,13 @@ const TR = ({
</DateText>
</td>
<td> {r.submittedOn ? `: ${renderTimestamp(r.submittedOn)}` : ''} </td>
<td>
{r.status === 'pending' ? (
<td width={100}>
{r.status === 'pending' && (
<ResendRevoke
showConfirmResend={showConfirmResend(r)}
showConfirmRevoke={showConfirmRevoke(r.invitationId)}
status={r.status}
/>
) : (
<div />
)}
</td>
</Row>
......@@ -116,7 +115,7 @@ const ModalWrapper = compose(
))
export default compose(
connect(null, { inviteReviewer, revokeReviewer }),
connect(null, { inviteReviewer, revokeReviewer, getCollectionReviewers }),
withModal2(props => ({
modalComponent: ModalWrapper,
})),
......@@ -145,6 +144,7 @@ export default compose(
goBackToReviewers,
inviteReviewer,
collectionId,
getCollectionReviewers,
}) => reviewer => () => {
showModal({
title: 'Resend reviewer invite',
......@@ -153,7 +153,9 @@ export default compose(
inviteReviewer(
pick(reviewer, ['email', 'firstName', 'lastName', 'affiliation']),
collectionId,
).then(hideModal)
)
.then(() => getCollectionReviewers(collectionId))
.then(hideModal)
},
onCancel: hideModal,
})
......@@ -165,12 +167,15 @@ export default compose(
goBackToReviewers,
revokeReviewer,
collectionId,
getCollectionReviewers,
}) => invitationId => () => {
showModal({
title: 'Unassign Reviewer',
confirmText: 'Unassign',
onConfirm: () => {
revokeReviewer(invitationId, collectionId).then(hideModal)
revokeReviewer(invitationId, collectionId)
.then(() => getCollectionReviewers(collectionId))
.then(hideModal)
},
onCancel: hideModal,
})
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment